From 290fe5dfd6866db4a13a9c8e755ff86fc761c31d Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Fri, 21 Feb 2020 03:16:22 +0200 Subject: [PATCH 1/8] added git ignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..485dee64b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea -- 2.40.1 From b8c9f964e220205a3b620b876eedec2fbe298421 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Fri, 21 Feb 2020 03:20:50 +0200 Subject: [PATCH 2/8] Fixed gh-522 so that file in assets/js/ containing the added code. --- admin/helpers/compiler/e_Interpretation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 9bceeabc6..081d353de 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -10202,7 +10202,7 @@ class Interpretation extends Fields if (isset($list_fileScript) && ComponentbuilderHelper::checkString($list_fileScript)) { // load the script - $this->viewScriptBuilder[$viewName]['list_fileScript'] = $list_fileScript; + $this->viewScriptBuilder[$viewName_list]['list_fileScript'] = $list_fileScript; } // make sure there is script to add if (isset($fileScript) && ComponentbuilderHelper::checkString($fileScript)) -- 2.40.1 From a2db06fb4377d23361ebd9f800428ccda6634c0f Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Sat, 22 Feb 2020 11:56:01 +0200 Subject: [PATCH 3/8] Fixed gh-514 that table ordering in the admin list views will work again. --- admin/compiler/joomla_3/default.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/compiler/joomla_3/default.php b/admin/compiler/joomla_3/default.php index 80a0b50b3..b93d04e3f 100644 --- a/admin/compiler/joomla_3/default.php +++ b/admin/compiler/joomla_3/default.php @@ -80,8 +80,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + -- 2.40.1 From aae9ffb6e02eb67acd774ead8aa05e986b635194 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Thu, 27 Feb 2020 23:05:28 +0200 Subject: [PATCH 4/8] Added the option to use advance field modeling to store data in other tables in combination with the field being set to not be stored in the view/table in the admin view. Fixed gh-487 yet once again to allow the datalength to be stored everytime, and not get dropped. Imporved the JCB way of conditions field behavior. --- README.md | 4 +- admin/README.txt | 4 +- admin/helpers/compiler/c_Fields.php | 8 +-- admin/helpers/compiler/e_Interpretation.php | 46 ++++++++++------- admin/models/forms/admin_view.js | 51 ++++++++++++------- admin/models/forms/admin_view.xml | 2 +- admin/models/forms/class_method.js | 51 ++++++++++++------- admin/models/forms/class_property.js | 51 ++++++++++++------- admin/models/forms/custom_admin_view.xml | 2 +- admin/models/forms/custom_code.js | 51 ++++++++++++------- admin/models/forms/custom_code.xml | 2 +- admin/models/forms/dynamic_get.js | 51 ++++++++++++------- admin/models/forms/dynamic_get.xml | 2 +- admin/models/forms/field.js | 51 ++++++++++++------- admin/models/forms/field.xml | 2 +- admin/models/forms/fieldtype.js | 51 ++++++++++++------- admin/models/forms/fieldtype.xml | 2 +- admin/models/forms/help_document.js | 51 ++++++++++++------- admin/models/forms/help_document.xml | 2 +- admin/models/forms/joomla_component.js | 51 ++++++++++++------- admin/models/forms/joomla_component.xml | 2 +- admin/models/forms/joomla_module.js | 51 ++++++++++++------- admin/models/forms/joomla_module.xml | 2 +- admin/models/forms/joomla_plugin.js | 51 ++++++++++++------- admin/models/forms/joomla_plugin.xml | 2 +- admin/models/forms/layout.xml | 2 +- admin/models/forms/library.js | 51 ++++++++++++------- admin/models/forms/library.xml | 2 +- admin/models/forms/server.js | 51 ++++++++++++------- admin/models/forms/server.xml | 2 +- admin/models/forms/site_view.xml | 2 +- admin/models/forms/template.xml | 2 +- admin/sql/install.mysql.utf8.sql | 23 ++++----- admin/views/admin_views/tmpl/default.php | 4 +- .../views/admins_custom_tabs/tmpl/default.php | 4 +- admin/views/admins_fields/tmpl/default.php | 4 +- .../admins_fields_conditions/tmpl/default.php | 4 +- .../admins_fields_relations/tmpl/default.php | 4 +- admin/views/class_extendings/tmpl/default.php | 4 +- admin/views/class_methods/tmpl/default.php | 4 +- admin/views/class_properties/tmpl/default.php | 4 +- .../components_admin_views/tmpl/default.php | 4 +- .../views/components_config/tmpl/default.php | 4 +- .../tmpl/default.php | 4 +- .../tmpl/default.php | 4 +- .../components_dashboard/tmpl/default.php | 4 +- .../components_files_folders/tmpl/default.php | 4 +- .../views/components_modules/tmpl/default.php | 4 +- .../components_mysql_tweaks/tmpl/default.php | 4 +- .../components_placeholders/tmpl/default.php | 4 +- .../views/components_plugins/tmpl/default.php | 4 +- .../components_site_views/tmpl/default.php | 4 +- .../views/components_updates/tmpl/default.php | 4 +- .../views/custom_admin_views/tmpl/default.php | 4 +- admin/views/custom_codes/tmpl/default.php | 4 +- admin/views/dynamic_gets/tmpl/default.php | 4 +- admin/views/fields/tmpl/default.php | 4 +- admin/views/fieldtypes/tmpl/default.php | 4 +- admin/views/help_documents/tmpl/default.php | 4 +- .../views/joomla_components/tmpl/default.php | 4 +- admin/views/joomla_modules/tmpl/default.php | 4 +- .../tmpl/default.php | 4 +- .../joomla_modules_updates/tmpl/default.php | 4 +- .../joomla_plugin_groups/tmpl/default.php | 4 +- admin/views/joomla_plugins/tmpl/default.php | 4 +- .../tmpl/default.php | 4 +- .../joomla_plugins_updates/tmpl/default.php | 4 +- .../language_translations/tmpl/default.php | 4 +- admin/views/languages/tmpl/default.php | 4 +- admin/views/layouts/tmpl/default.php | 4 +- admin/views/libraries/tmpl/default.php | 4 +- admin/views/libraries_config/tmpl/default.php | 4 +- .../tmpl/default.php | 4 +- admin/views/placeholders/tmpl/default.php | 4 +- admin/views/servers/tmpl/default.php | 4 +- admin/views/site_views/tmpl/default.php | 4 +- admin/views/snippet_types/tmpl/default.php | 4 +- admin/views/snippets/tmpl/default.php | 4 +- admin/views/templates/tmpl/default.php | 4 +- admin/views/validation_rules/tmpl/default.php | 4 +- componentbuilder.xml | 2 +- script.php | 24 ++++----- 82 files changed, 598 insertions(+), 394 deletions(-) diff --git a/README.md b/README.md index 225f0e156..17a1baab6 100644 --- a/README.md +++ b/README.md @@ -144,11 +144,11 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 17th February, 2020 ++ *Last Build*: 27th February, 2020 + *Version*: 2.10.11 + *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **278479** ++ *Line count*: **278669** + *Field count*: **1505** + *File count*: **1756** + *Folder count*: **278** diff --git a/admin/README.txt b/admin/README.txt index 225f0e156..17a1baab6 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -144,11 +144,11 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 17th February, 2020 ++ *Last Build*: 27th February, 2020 + *Version*: 2.10.11 + *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **278479** ++ *Line count*: **278669** + *Field count*: **1505** + *File count*: **1756** + *Folder count*: **278** diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index 9754adf52..e258d4a4a 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -2987,7 +2987,9 @@ class Fields extends Structure $this->checkboxBuilder[$view_name_single][] = $name; } // setup checkboxes and other json items for this view - if ($dbSwitch && (($typeName === 'subform' || $typeName === 'checkboxes' || $multiple || $field['settings']->store != 0) && $typeName != 'tag')) + // if we have advance field modeling and the field is not being set in the DB + // this could mean that field is modeled manually (so we add it) + if (($dbSwitch || $field['settings']->store == 6) && (($typeName === 'subform' || $typeName === 'checkboxes' || $multiple || $field['settings']->store != 0) && $typeName != 'tag')) { $subformJsonSwitch = true; switch ($field['settings']->store) @@ -3069,8 +3071,8 @@ class Fields extends Structure } } - // subform house keeping - if ('subform' === $typeName) + // subform house keeping (only if not advance modeling) + if ('subform' === $typeName && $field['settings']->store != 6) { // the values must revert to array $this->jsonItemBuilderArray[$view_name_single][] = $name; diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 081d353de..0bee15833 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -10091,29 +10091,41 @@ class Interpretation extends Fields // add the needed validation to file if (isset($this->validationFixBuilder[$viewName]) && ComponentbuilderHelper::checkArray($this->validationFixBuilder[$viewName])) { - $validation .= PHP_EOL . "// update required fields"; - $validation .= PHP_EOL . "function updateFieldRequired(name,status)"; - $validation .= PHP_EOL . "{"; - $validation .= PHP_EOL . $this->_t(1) . "var not_required = jQuery('#jform_not_required').val();"; - $validation .= PHP_EOL . PHP_EOL . $this->_t(1) . "if(status == 1)"; - $validation .= PHP_EOL . $this->_t(1) . "{"; - $validation .= PHP_EOL . $this->_t(2) . "if (isSet(not_required) && not_required != 0)"; + $validation .= PHP_EOL . "// update fields required"; + $validation .= PHP_EOL . "function updateFieldRequired(name, status) {"; + $validation .= PHP_EOL . $this->_t(1) . "// check if not_required exist"; + $validation .= PHP_EOL . $this->_t(1) . "if (jQuery('#jform_not_required').length > 0) {"; + $validation .= PHP_EOL . $this->_t(2) . "var not_required = jQuery('#jform_not_required').val().split(\",\");"; + $validation .= PHP_EOL . PHP_EOL . $this->_t(2) . "if(status == 1)"; $validation .= PHP_EOL . $this->_t(2) . "{"; - $validation .= PHP_EOL . $this->_t(3) . "not_required = not_required+','+name;"; + $validation .= PHP_EOL . $this->_t(3) . "not_required.push(name);"; $validation .= PHP_EOL . $this->_t(2) . "}"; $validation .= PHP_EOL . $this->_t(2) . "else"; $validation .= PHP_EOL . $this->_t(2) . "{"; - $validation .= PHP_EOL . $this->_t(3) . "not_required = ','+name;"; + $validation .= PHP_EOL . $this->_t(3) . "not_required = removeFieldFromNotRequired(not_required, name);"; $validation .= PHP_EOL . $this->_t(2) . "}"; + $validation .= PHP_EOL . PHP_EOL . $this->_t(2) . "jQuery('#jform_not_required').val(fixNotRequiredArray(not_required).toString());"; $validation .= PHP_EOL . $this->_t(1) . "}"; - $validation .= PHP_EOL . $this->_t(1) . "else"; - $validation .= PHP_EOL . $this->_t(1) . "{"; - $validation .= PHP_EOL . $this->_t(2) . "if (isSet(not_required) && not_required != 0)"; - $validation .= PHP_EOL . $this->_t(2) . "{"; - $validation .= PHP_EOL . $this->_t(3) . "not_required = not_required.replace(','+name,'');"; - $validation .= PHP_EOL . $this->_t(2) . "}"; - $validation .= PHP_EOL . $this->_t(1) . "}"; - $validation .= PHP_EOL . PHP_EOL . $this->_t(1) . "jQuery('#jform_not_required').val(not_required);"; + $validation .= PHP_EOL . "}" . PHP_EOL; + $validation .= PHP_EOL . "// remove field from not_required"; + $validation .= PHP_EOL . "function removeFieldFromNotRequired(array, what) {"; + $validation .= PHP_EOL . $this->_t(1) . "return array.filter(function(element){"; + $validation .= PHP_EOL . $this->_t(2) . "return element !== what;"; + $validation .= PHP_EOL . $this->_t(1) . "});"; + $validation .= PHP_EOL . "}" . PHP_EOL; + $validation .= PHP_EOL . "// fix not required array"; + $validation .= PHP_EOL . "function fixNotRequiredArray(array) {"; + $validation .= PHP_EOL . $this->_t(1) . "var seen = {};"; + $validation .= PHP_EOL . $this->_t(1) . "return removeEmptyFromNotRequiredArray(array).filter(function(item) {"; + $validation .= PHP_EOL . $this->_t(2) . "return seen.hasOwnProperty(item) ? false : (seen[item] = true);"; + $validation .= PHP_EOL . $this->_t(1) . "});"; + $validation .= PHP_EOL . "}" . PHP_EOL; + $validation .= PHP_EOL . "// remove empty from not_required array"; + $validation .= PHP_EOL . "function removeEmptyFromNotRequiredArray(array) {"; + $validation .= PHP_EOL . $this->_t(1) . "return array.filter(function (el) {"; + $validation .= PHP_EOL . $this->_t(2) . "// remove ( 一_一) as well - lol"; + $validation .= PHP_EOL . $this->_t(2) . "return (el.length > 0 && '一_一' !== el);"; + $validation .= PHP_EOL . $this->_t(1) . "});"; $validation .= PHP_EOL . "}" . PHP_EOL; } // set the isSet function diff --git a/admin/models/forms/admin_view.js b/admin/models/forms/admin_view.js index c5f3d17b7..c1825ffcf 100644 --- a/admin/models/forms/admin_view.js +++ b/admin/models/forms/admin_view.js @@ -755,31 +755,46 @@ function vvvvwac(add_custom_button_vvvvwac) } } -// update required fields -function updateFieldRequired(name,status) -{ - var not_required = jQuery('#jform_not_required').val(); +// update fields required +function updateFieldRequired(name, status) { + // check if not_required exist + if (jQuery('#jform_not_required').length > 0) { + var not_required = jQuery('#jform_not_required').val().split(","); - if(status == 1) - { - if (isSet(not_required) && not_required != 0) + if(status == 1) { - not_required = not_required+','+name; + not_required.push(name); } else { - not_required = ','+name; + not_required = removeFieldFromNotRequired(not_required, name); } - } - else - { - if (isSet(not_required) && not_required != 0) - { - not_required = not_required.replace(','+name,''); - } - } - jQuery('#jform_not_required').val(not_required); + jQuery('#jform_not_required').val(fixNotRequiredArray(not_required).toString()); + } +} + +// remove field from not_required +function removeFieldFromNotRequired(array, what) { + return array.filter(function(element){ + return element !== what; + }); +} + +// fix not required array +function fixNotRequiredArray(array) { + var seen = {}; + return removeEmptyFromNotRequiredArray(array).filter(function(item) { + return seen.hasOwnProperty(item) ? false : (seen[item] = true); + }); +} + +// remove empty from not_required array +function removeEmptyFromNotRequiredArray(array) { + return array.filter(function (el) { + // remove ( 一_一) as well - lol + return (el.length > 0 && '一_一' !== el); + }); } // the isSet function diff --git a/admin/models/forms/admin_view.xml b/admin/models/forms/admin_view.xml index 184b247d8..8664ad8fb 100644 --- a/admin/models/forms/admin_view.xml +++ b/admin/models/forms/admin_view.xml @@ -379,7 +379,7 @@ 0) { + var not_required = jQuery('#jform_not_required').val().split(","); - if(status == 1) - { - if (isSet(not_required) && not_required != 0) + if(status == 1) { - not_required = not_required+','+name; + not_required.push(name); } else { - not_required = ','+name; + not_required = removeFieldFromNotRequired(not_required, name); } - } - else - { - if (isSet(not_required) && not_required != 0) - { - not_required = not_required.replace(','+name,''); - } - } - jQuery('#jform_not_required').val(not_required); + jQuery('#jform_not_required').val(fixNotRequiredArray(not_required).toString()); + } +} + +// remove field from not_required +function removeFieldFromNotRequired(array, what) { + return array.filter(function(element){ + return element !== what; + }); +} + +// fix not required array +function fixNotRequiredArray(array) { + var seen = {}; + return removeEmptyFromNotRequiredArray(array).filter(function(item) { + return seen.hasOwnProperty(item) ? false : (seen[item] = true); + }); +} + +// remove empty from not_required array +function removeEmptyFromNotRequiredArray(array) { + return array.filter(function (el) { + // remove ( 一_一) as well - lol + return (el.length > 0 && '一_一' !== el); + }); } // the isSet function diff --git a/admin/models/forms/class_property.js b/admin/models/forms/class_property.js index cec32bd50..38a6ac934 100644 --- a/admin/models/forms/class_property.js +++ b/admin/models/forms/class_property.js @@ -74,31 +74,46 @@ function extension_type_vvvvwcf_SomeFunc(extension_type_vvvvwcf) return false; } -// update required fields -function updateFieldRequired(name,status) -{ - var not_required = jQuery('#jform_not_required').val(); +// update fields required +function updateFieldRequired(name, status) { + // check if not_required exist + if (jQuery('#jform_not_required').length > 0) { + var not_required = jQuery('#jform_not_required').val().split(","); - if(status == 1) - { - if (isSet(not_required) && not_required != 0) + if(status == 1) { - not_required = not_required+','+name; + not_required.push(name); } else { - not_required = ','+name; + not_required = removeFieldFromNotRequired(not_required, name); } - } - else - { - if (isSet(not_required) && not_required != 0) - { - not_required = not_required.replace(','+name,''); - } - } - jQuery('#jform_not_required').val(not_required); + jQuery('#jform_not_required').val(fixNotRequiredArray(not_required).toString()); + } +} + +// remove field from not_required +function removeFieldFromNotRequired(array, what) { + return array.filter(function(element){ + return element !== what; + }); +} + +// fix not required array +function fixNotRequiredArray(array) { + var seen = {}; + return removeEmptyFromNotRequiredArray(array).filter(function(item) { + return seen.hasOwnProperty(item) ? false : (seen[item] = true); + }); +} + +// remove empty from not_required array +function removeEmptyFromNotRequiredArray(array) { + return array.filter(function (el) { + // remove ( 一_一) as well - lol + return (el.length > 0 && '一_一' !== el); + }); } // the isSet function diff --git a/admin/models/forms/custom_admin_view.xml b/admin/models/forms/custom_admin_view.xml index 2ff62340c..724a996ce 100644 --- a/admin/models/forms/custom_admin_view.xml +++ b/admin/models/forms/custom_admin_view.xml @@ -310,7 +310,7 @@ 0) { + var not_required = jQuery('#jform_not_required').val().split(","); - if(status == 1) - { - if (isSet(not_required) && not_required != 0) + if(status == 1) { - not_required = not_required+','+name; + not_required.push(name); } else { - not_required = ','+name; + not_required = removeFieldFromNotRequired(not_required, name); } - } - else - { - if (isSet(not_required) && not_required != 0) - { - not_required = not_required.replace(','+name,''); - } - } - jQuery('#jform_not_required').val(not_required); + jQuery('#jform_not_required').val(fixNotRequiredArray(not_required).toString()); + } +} + +// remove field from not_required +function removeFieldFromNotRequired(array, what) { + return array.filter(function(element){ + return element !== what; + }); +} + +// fix not required array +function fixNotRequiredArray(array) { + var seen = {}; + return removeEmptyFromNotRequiredArray(array).filter(function(item) { + return seen.hasOwnProperty(item) ? false : (seen[item] = true); + }); +} + +// remove empty from not_required array +function removeEmptyFromNotRequiredArray(array) { + return array.filter(function (el) { + // remove ( 一_一) as well - lol + return (el.length > 0 && '一_一' !== el); + }); } // the isSet function diff --git a/admin/models/forms/custom_code.xml b/admin/models/forms/custom_code.xml index 9f5c1f643..2d5d35ba3 100644 --- a/admin/models/forms/custom_code.xml +++ b/admin/models/forms/custom_code.xml @@ -158,7 +158,7 @@ 0) { + var not_required = jQuery('#jform_not_required').val().split(","); - if(status == 1) - { - if (isSet(not_required) && not_required != 0) + if(status == 1) { - not_required = not_required+','+name; + not_required.push(name); } else { - not_required = ','+name; + not_required = removeFieldFromNotRequired(not_required, name); } - } - else - { - if (isSet(not_required) && not_required != 0) - { - not_required = not_required.replace(','+name,''); - } - } - jQuery('#jform_not_required').val(not_required); + jQuery('#jform_not_required').val(fixNotRequiredArray(not_required).toString()); + } +} + +// remove field from not_required +function removeFieldFromNotRequired(array, what) { + return array.filter(function(element){ + return element !== what; + }); +} + +// fix not required array +function fixNotRequiredArray(array) { + var seen = {}; + return removeEmptyFromNotRequiredArray(array).filter(function(item) { + return seen.hasOwnProperty(item) ? false : (seen[item] = true); + }); +} + +// remove empty from not_required array +function removeEmptyFromNotRequiredArray(array) { + return array.filter(function (el) { + // remove ( 一_一) as well - lol + return (el.length > 0 && '一_一' !== el); + }); } // the isSet function diff --git a/admin/models/forms/dynamic_get.xml b/admin/models/forms/dynamic_get.xml index 0507a49ff..45d7fd914 100644 --- a/admin/models/forms/dynamic_get.xml +++ b/admin/models/forms/dynamic_get.xml @@ -682,7 +682,7 @@ 0) { + var not_required = jQuery('#jform_not_required').val().split(","); - if(status == 1) - { - if (isSet(not_required) && not_required != 0) + if(status == 1) { - not_required = not_required+','+name; + not_required.push(name); } else { - not_required = ','+name; + not_required = removeFieldFromNotRequired(not_required, name); } - } - else - { - if (isSet(not_required) && not_required != 0) - { - not_required = not_required.replace(','+name,''); - } - } - jQuery('#jform_not_required').val(not_required); + jQuery('#jform_not_required').val(fixNotRequiredArray(not_required).toString()); + } +} + +// remove field from not_required +function removeFieldFromNotRequired(array, what) { + return array.filter(function(element){ + return element !== what; + }); +} + +// fix not required array +function fixNotRequiredArray(array) { + var seen = {}; + return removeEmptyFromNotRequiredArray(array).filter(function(item) { + return seen.hasOwnProperty(item) ? false : (seen[item] = true); + }); +} + +// remove empty from not_required array +function removeEmptyFromNotRequiredArray(array) { + return array.filter(function (el) { + // remove ( 一_一) as well - lol + return (el.length > 0 && '一_一' !== el); + }); } // the isSet function diff --git a/admin/models/forms/field.xml b/admin/models/forms/field.xml index abea536b7..88f9c95c0 100644 --- a/admin/models/forms/field.xml +++ b/admin/models/forms/field.xml @@ -469,7 +469,7 @@ 0) { + var not_required = jQuery('#jform_not_required').val().split(","); - if(status == 1) - { - if (isSet(not_required) && not_required != 0) + if(status == 1) { - not_required = not_required+','+name; + not_required.push(name); } else { - not_required = ','+name; + not_required = removeFieldFromNotRequired(not_required, name); } - } - else - { - if (isSet(not_required) && not_required != 0) - { - not_required = not_required.replace(','+name,''); - } - } - jQuery('#jform_not_required').val(not_required); + jQuery('#jform_not_required').val(fixNotRequiredArray(not_required).toString()); + } +} + +// remove field from not_required +function removeFieldFromNotRequired(array, what) { + return array.filter(function(element){ + return element !== what; + }); +} + +// fix not required array +function fixNotRequiredArray(array) { + var seen = {}; + return removeEmptyFromNotRequiredArray(array).filter(function(item) { + return seen.hasOwnProperty(item) ? false : (seen[item] = true); + }); +} + +// remove empty from not_required array +function removeEmptyFromNotRequiredArray(array) { + return array.filter(function (el) { + // remove ( 一_一) as well - lol + return (el.length > 0 && '一_一' !== el); + }); } // the isSet function diff --git a/admin/models/forms/fieldtype.xml b/admin/models/forms/fieldtype.xml index c82eb4951..acdbb6afd 100644 --- a/admin/models/forms/fieldtype.xml +++ b/admin/models/forms/fieldtype.xml @@ -295,7 +295,7 @@ 0) { + var not_required = jQuery('#jform_not_required').val().split(","); - if(status == 1) - { - if (isSet(not_required) && not_required != 0) + if(status == 1) { - not_required = not_required+','+name; + not_required.push(name); } else { - not_required = ','+name; + not_required = removeFieldFromNotRequired(not_required, name); } - } - else - { - if (isSet(not_required) && not_required != 0) - { - not_required = not_required.replace(','+name,''); - } - } - jQuery('#jform_not_required').val(not_required); + jQuery('#jform_not_required').val(fixNotRequiredArray(not_required).toString()); + } +} + +// remove field from not_required +function removeFieldFromNotRequired(array, what) { + return array.filter(function(element){ + return element !== what; + }); +} + +// fix not required array +function fixNotRequiredArray(array) { + var seen = {}; + return removeEmptyFromNotRequiredArray(array).filter(function(item) { + return seen.hasOwnProperty(item) ? false : (seen[item] = true); + }); +} + +// remove empty from not_required array +function removeEmptyFromNotRequiredArray(array) { + return array.filter(function (el) { + // remove ( 一_一) as well - lol + return (el.length > 0 && '一_一' !== el); + }); } // the isSet function diff --git a/admin/models/forms/help_document.xml b/admin/models/forms/help_document.xml index f6a9bf71e..d2b7969a3 100644 --- a/admin/models/forms/help_document.xml +++ b/admin/models/forms/help_document.xml @@ -165,7 +165,7 @@ 0) { + var not_required = jQuery('#jform_not_required').val().split(","); - if(status == 1) - { - if (isSet(not_required) && not_required != 0) + if(status == 1) { - not_required = not_required+','+name; + not_required.push(name); } else { - not_required = ','+name; + not_required = removeFieldFromNotRequired(not_required, name); } - } - else - { - if (isSet(not_required) && not_required != 0) - { - not_required = not_required.replace(','+name,''); - } - } - jQuery('#jform_not_required').val(not_required); + jQuery('#jform_not_required').val(fixNotRequiredArray(not_required).toString()); + } +} + +// remove field from not_required +function removeFieldFromNotRequired(array, what) { + return array.filter(function(element){ + return element !== what; + }); +} + +// fix not required array +function fixNotRequiredArray(array) { + var seen = {}; + return removeEmptyFromNotRequiredArray(array).filter(function(item) { + return seen.hasOwnProperty(item) ? false : (seen[item] = true); + }); +} + +// remove empty from not_required array +function removeEmptyFromNotRequiredArray(array) { + return array.filter(function (el) { + // remove ( 一_一) as well - lol + return (el.length > 0 && '一_一' !== el); + }); } // the isSet function diff --git a/admin/models/forms/joomla_component.xml b/admin/models/forms/joomla_component.xml index c3d5b5c97..638aff063 100644 --- a/admin/models/forms/joomla_component.xml +++ b/admin/models/forms/joomla_component.xml @@ -768,7 +768,7 @@ 0) { + var not_required = jQuery('#jform_not_required').val().split(","); - if(status == 1) - { - if (isSet(not_required) && not_required != 0) + if(status == 1) { - not_required = not_required+','+name; + not_required.push(name); } else { - not_required = ','+name; + not_required = removeFieldFromNotRequired(not_required, name); } - } - else - { - if (isSet(not_required) && not_required != 0) - { - not_required = not_required.replace(','+name,''); - } - } - jQuery('#jform_not_required').val(not_required); + jQuery('#jform_not_required').val(fixNotRequiredArray(not_required).toString()); + } +} + +// remove field from not_required +function removeFieldFromNotRequired(array, what) { + return array.filter(function(element){ + return element !== what; + }); +} + +// fix not required array +function fixNotRequiredArray(array) { + var seen = {}; + return removeEmptyFromNotRequiredArray(array).filter(function(item) { + return seen.hasOwnProperty(item) ? false : (seen[item] = true); + }); +} + +// remove empty from not_required array +function removeEmptyFromNotRequiredArray(array) { + return array.filter(function (el) { + // remove ( 一_一) as well - lol + return (el.length > 0 && '一_一' !== el); + }); } // the isSet function diff --git a/admin/models/forms/joomla_module.xml b/admin/models/forms/joomla_module.xml index 1d6a70f6b..b290b7193 100644 --- a/admin/models/forms/joomla_module.xml +++ b/admin/models/forms/joomla_module.xml @@ -303,7 +303,7 @@ diff --git a/admin/models/forms/joomla_plugin.js b/admin/models/forms/joomla_plugin.js index 2ccd96661..d6007d990 100644 --- a/admin/models/forms/joomla_plugin.js +++ b/admin/models/forms/joomla_plugin.js @@ -612,31 +612,46 @@ function vvvvvyu(addreadme_vvvvvyu) } } -// update required fields -function updateFieldRequired(name,status) -{ - var not_required = jQuery('#jform_not_required').val(); +// update fields required +function updateFieldRequired(name, status) { + // check if not_required exist + if (jQuery('#jform_not_required').length > 0) { + var not_required = jQuery('#jform_not_required').val().split(","); - if(status == 1) - { - if (isSet(not_required) && not_required != 0) + if(status == 1) { - not_required = not_required+','+name; + not_required.push(name); } else { - not_required = ','+name; + not_required = removeFieldFromNotRequired(not_required, name); } - } - else - { - if (isSet(not_required) && not_required != 0) - { - not_required = not_required.replace(','+name,''); - } - } - jQuery('#jform_not_required').val(not_required); + jQuery('#jform_not_required').val(fixNotRequiredArray(not_required).toString()); + } +} + +// remove field from not_required +function removeFieldFromNotRequired(array, what) { + return array.filter(function(element){ + return element !== what; + }); +} + +// fix not required array +function fixNotRequiredArray(array) { + var seen = {}; + return removeEmptyFromNotRequiredArray(array).filter(function(item) { + return seen.hasOwnProperty(item) ? false : (seen[item] = true); + }); +} + +// remove empty from not_required array +function removeEmptyFromNotRequiredArray(array) { + return array.filter(function (el) { + // remove ( 一_一) as well - lol + return (el.length > 0 && '一_一' !== el); + }); } // the isSet function diff --git a/admin/models/forms/joomla_plugin.xml b/admin/models/forms/joomla_plugin.xml index 73e214f4f..1ec8662e8 100644 --- a/admin/models/forms/joomla_plugin.xml +++ b/admin/models/forms/joomla_plugin.xml @@ -378,7 +378,7 @@ 0) { + var not_required = jQuery('#jform_not_required').val().split(","); - if(status == 1) - { - if (isSet(not_required) && not_required != 0) + if(status == 1) { - not_required = not_required+','+name; + not_required.push(name); } else { - not_required = ','+name; + not_required = removeFieldFromNotRequired(not_required, name); } - } - else - { - if (isSet(not_required) && not_required != 0) - { - not_required = not_required.replace(','+name,''); - } - } - jQuery('#jform_not_required').val(not_required); + jQuery('#jform_not_required').val(fixNotRequiredArray(not_required).toString()); + } +} + +// remove field from not_required +function removeFieldFromNotRequired(array, what) { + return array.filter(function(element){ + return element !== what; + }); +} + +// fix not required array +function fixNotRequiredArray(array) { + var seen = {}; + return removeEmptyFromNotRequiredArray(array).filter(function(item) { + return seen.hasOwnProperty(item) ? false : (seen[item] = true); + }); +} + +// remove empty from not_required array +function removeEmptyFromNotRequiredArray(array) { + return array.filter(function (el) { + // remove ( 一_一) as well - lol + return (el.length > 0 && '一_一' !== el); + }); } // the isSet function diff --git a/admin/models/forms/library.xml b/admin/models/forms/library.xml index 54414605a..028c7002b 100644 --- a/admin/models/forms/library.xml +++ b/admin/models/forms/library.xml @@ -173,7 +173,7 @@ diff --git a/admin/models/forms/server.js b/admin/models/forms/server.js index 41bd932b7..0e8d5c6a4 100644 --- a/admin/models/forms/server.js +++ b/admin/models/forms/server.js @@ -539,31 +539,46 @@ function authentication_vvvvwei_SomeFunc(authentication_vvvvwei) return false; } -// update required fields -function updateFieldRequired(name,status) -{ - var not_required = jQuery('#jform_not_required').val(); +// update fields required +function updateFieldRequired(name, status) { + // check if not_required exist + if (jQuery('#jform_not_required').length > 0) { + var not_required = jQuery('#jform_not_required').val().split(","); - if(status == 1) - { - if (isSet(not_required) && not_required != 0) + if(status == 1) { - not_required = not_required+','+name; + not_required.push(name); } else { - not_required = ','+name; + not_required = removeFieldFromNotRequired(not_required, name); } - } - else - { - if (isSet(not_required) && not_required != 0) - { - not_required = not_required.replace(','+name,''); - } - } - jQuery('#jform_not_required').val(not_required); + jQuery('#jform_not_required').val(fixNotRequiredArray(not_required).toString()); + } +} + +// remove field from not_required +function removeFieldFromNotRequired(array, what) { + return array.filter(function(element){ + return element !== what; + }); +} + +// fix not required array +function fixNotRequiredArray(array) { + var seen = {}; + return removeEmptyFromNotRequiredArray(array).filter(function(item) { + return seen.hasOwnProperty(item) ? false : (seen[item] = true); + }); +} + +// remove empty from not_required array +function removeEmptyFromNotRequiredArray(array) { + return array.filter(function (el) { + // remove ( 一_一) as well - lol + return (el.length > 0 && '一_一' !== el); + }); } // the isSet function diff --git a/admin/models/forms/server.xml b/admin/models/forms/server.xml index e97b76fba..c88ab6d62 100644 --- a/admin/models/forms/server.xml +++ b/admin/models/forms/server.xml @@ -126,7 +126,7 @@ diff --git a/admin/models/forms/site_view.xml b/admin/models/forms/site_view.xml index c52ecb0b0..7a8c6fae1 100644 --- a/admin/models/forms/site_view.xml +++ b/admin/models/forms/site_view.xml @@ -249,7 +249,7 @@ \"', 1, '2015-04-29 14:00:56', '2015-08-25 21:15:22', 1, '', 45, '0d6970af-b361-4f65-84f6-0eb0c5f09bad'), (196, '', '', '', '', '', '', '', '', '', 64, '', 'VARCHAR', '', '', '', 'Mobile Phone', 'NOT NULL', '', 23, '\"\"', 1, '2015-04-07 22:12:58', '2016-03-28 14:00:02', 2, '', 7, '65933a19-243a-48b2-aae9-34e2da710051'), (199, '', '', '', '', '', '', '', '', '', 255, '', 'VARCHAR', 2, '', '', 'Name', 'NOT NULL', '', 24, '\"\"', 1, '2015-03-19 17:30:59', '2017-10-25 20:26:02', 8, '', 4, '5d3d34dd-4876-4c6a-86ab-b4e162f22c08'), -(203, '', '', '', '', '', '', '', '', '', 1, '', 'INT', '', '', '', 'Not Required', 'NOT NULL', '', 9, '\"\"', 1, '2015-05-08 16:19:16', '2015-08-25 21:15:22', 1, '', 19, 'da5e6901-6958-40e5-a4f5-6822d6fe57ac'), +(203, '', '', '', '', '', '', '', '', '', 1, '', 'INT', '', '', '', 'Not Required', 'NOT NULL', '', 9, '\"\"', 1, '2015-05-08 16:19:16', '2020-02-27 20:17:33', 13, '', 19, 'da5e6901-6958-40e5-a4f5-6822d6fe57ac'), (280, '', '', '', '', '', '', '', '', '', 255, '', 'VARCHAR', '', '', '', 'Website', 'NOT NULL', '', 27, '\"\"', 1, '2015-04-08 00:36:16', '2018-07-08 00:11:05', 2, '', 105, '6c3a6983-d1bf-4e5e-9e99-deea00b0cefd'), (682, '', '', '', '', '', '', '', '', '', 1, '', 'TINYINT', 2, '', '', 'Add More', 'NOT NULL', '', 17, '\"\"', 1, '2015-08-05 01:18:20', '2018-03-30 09:30:45', 4, '', 196, 'a66389aa-2323-4f44-8c23-ff44969639be'), (1011, '', '', '', '', '', '', '', 'Other', '0000-00-00', '', '', 'DATE', '', '', '', 'Date of Birth', 'NOT NULL', '', 1, '\"\"', 1, '2015-12-07 01:47:32', '2018-08-03 09:56:07', 4, '', 649, 'cb2bdf20-8800-407b-a4f6-250152a0bdfb'); @@ -2415,7 +2409,8 @@ INSERT INTO `#__componentbuilder_library_files_folders_urls` (`id`, `addfiles`, (2, '', '', '{\"addurls0\":{\"url\":\"https:\\/\\/maxcdn.bootstrapcdn.com\\/bootstrap\\/4.0.0-alpha.6\\/js\\/bootstrap.min.js\",\"type\":\"2\"},\"addurls1\":{\"url\":\"https:\\/\\/maxcdn.bootstrapcdn.com\\/bootstrap\\/4.0.0-alpha.6\\/css\\/bootstrap.min.css\",\"type\":\"2\"}}', 2, '', 1, '2017-11-25 16:17:36', '2018-05-02 23:29:05', 11, '', 2), (3, '', '', '{\"addurls0\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/uikit\\/3.0.0-rc.16\\/js\\/uikit.min.js\",\"type\":\"2\"},\"addurls2\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/uikit\\/3.0.0-rc.16\\/js\\/uikit-icons.min.js\",\"type\":\"2\"},\"addurls4\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/uikit\\/3.0.0-rc.16\\/css\\/uikit.min.css\",\"type\":\"2\"}}', 3, '', 1, '2017-11-25 21:47:40', '2018-09-19 14:22:09', 10, '', 3), (4, '{}', '{\"addfolders0\":{\"folder\":\"file_icon_vectors\",\"path\":\"\\/media\\/vector\",\"rename\":\"1\"}}', '{}', 7, '', 1, '2019-10-03 09:24:30', '2019-10-03 09:25:39', 2, '', 4), -(5, '{}', '{}', '{\"addurls0\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/grapesjs\\/0.14.15\\/css\\/grapes.min.css\",\"type\":2},\"addurls2\":{\"url\":\"https:\\/\\/raw.githubusercontent.com\\/artf\\/grapesjs-preset-webpage\\/master\\/dist\\/grapesjs-preset-webpage.min.css\",\"type\":2},\"addurls1\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/grapesjs\\/0.14.15\\/grapes.min.js\",\"type\":2},\"addurls3\":{\"url\":\"https:\\/\\/raw.githubusercontent.com\\/artf\\/grapesjs-preset-webpage\\/master\\/dist\\/grapesjs-preset-webpage.min.js\",\"type\":2}}', 8, '', 1, '2020-02-10 21:34:33', '2020-02-12 13:57:06', 4, '', 5); +(5, '{}', '{}', '{\"addurls0\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/grapesjs\\/0.14.15\\/css\\/grapes.min.css\",\"type\":2},\"addurls2\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/grapesjs\\/0.14.15\\/grapes.min.js\",\"type\":2}}', 8, '', 1, '2020-02-10 21:34:33', '2020-02-18 21:12:35', 5, '', 5), +(6, '{}', '{}', '{\"addurls0\":{\"url\":\"https:\\/\\/raw.githubusercontent.com\\/artf\\/grapesjs-preset-webpage\\/master\\/dist\\/grapesjs-preset-webpage.min.css\",\"type\":2},\"addurls1\":{\"url\":\"https:\\/\\/raw.githubusercontent.com\\/artf\\/grapesjs-preset-webpage\\/master\\/dist\\/grapesjs-preset-webpage.min.js\",\"type\":2},\"addurls2\":{\"url\":\"https:\\/\\/static.filestackapi.com\\/v3\\/filestack-0.1.10.js\",\"type\":2}}', 9, '', 1, '2020-02-18 21:13:16', '2020-02-18 21:14:11', 2, '', 5); CREATE TABLE IF NOT EXISTS `#__componentbuilder_external_code` ( diff --git a/admin/views/admin_views/tmpl/default.php b/admin/views/admin_views/tmpl/default.php index a46765abd..81bc87541 100644 --- a/admin/views/admin_views/tmpl/default.php +++ b/admin/views/admin_views/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/admins_custom_tabs/tmpl/default.php b/admin/views/admins_custom_tabs/tmpl/default.php index f70695f4a..cbe0eb57a 100644 --- a/admin/views/admins_custom_tabs/tmpl/default.php +++ b/admin/views/admins_custom_tabs/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/admins_fields/tmpl/default.php b/admin/views/admins_fields/tmpl/default.php index 650dc6726..61a8b37dd 100644 --- a/admin/views/admins_fields/tmpl/default.php +++ b/admin/views/admins_fields/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/admins_fields_conditions/tmpl/default.php b/admin/views/admins_fields_conditions/tmpl/default.php index f36a01d71..b04fdb62a 100644 --- a/admin/views/admins_fields_conditions/tmpl/default.php +++ b/admin/views/admins_fields_conditions/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/admins_fields_relations/tmpl/default.php b/admin/views/admins_fields_relations/tmpl/default.php index bf5cc3400..457b13264 100644 --- a/admin/views/admins_fields_relations/tmpl/default.php +++ b/admin/views/admins_fields_relations/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/class_extendings/tmpl/default.php b/admin/views/class_extendings/tmpl/default.php index 5a82e3896..cf196e3d1 100644 --- a/admin/views/class_extendings/tmpl/default.php +++ b/admin/views/class_extendings/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/class_methods/tmpl/default.php b/admin/views/class_methods/tmpl/default.php index cf2e2d721..95414bd34 100644 --- a/admin/views/class_methods/tmpl/default.php +++ b/admin/views/class_methods/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/class_properties/tmpl/default.php b/admin/views/class_properties/tmpl/default.php index 3d3c28711..42f995783 100644 --- a/admin/views/class_properties/tmpl/default.php +++ b/admin/views/class_properties/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/components_admin_views/tmpl/default.php b/admin/views/components_admin_views/tmpl/default.php index 92e940970..266415998 100644 --- a/admin/views/components_admin_views/tmpl/default.php +++ b/admin/views/components_admin_views/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/components_config/tmpl/default.php b/admin/views/components_config/tmpl/default.php index 9275949fb..8edd52a0c 100644 --- a/admin/views/components_config/tmpl/default.php +++ b/admin/views/components_config/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/components_custom_admin_menus/tmpl/default.php b/admin/views/components_custom_admin_menus/tmpl/default.php index 59efdfaf4..ea35f2709 100644 --- a/admin/views/components_custom_admin_menus/tmpl/default.php +++ b/admin/views/components_custom_admin_menus/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/components_custom_admin_views/tmpl/default.php b/admin/views/components_custom_admin_views/tmpl/default.php index bc15affc3..0fde9afd2 100644 --- a/admin/views/components_custom_admin_views/tmpl/default.php +++ b/admin/views/components_custom_admin_views/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/components_dashboard/tmpl/default.php b/admin/views/components_dashboard/tmpl/default.php index 2a4e58ff8..da24d5cdc 100644 --- a/admin/views/components_dashboard/tmpl/default.php +++ b/admin/views/components_dashboard/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/components_files_folders/tmpl/default.php b/admin/views/components_files_folders/tmpl/default.php index c24c8a0c6..1e6cb2418 100644 --- a/admin/views/components_files_folders/tmpl/default.php +++ b/admin/views/components_files_folders/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/components_modules/tmpl/default.php b/admin/views/components_modules/tmpl/default.php index 2c29f859a..f048d2109 100644 --- a/admin/views/components_modules/tmpl/default.php +++ b/admin/views/components_modules/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/components_mysql_tweaks/tmpl/default.php b/admin/views/components_mysql_tweaks/tmpl/default.php index ba1737baa..62f392248 100644 --- a/admin/views/components_mysql_tweaks/tmpl/default.php +++ b/admin/views/components_mysql_tweaks/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/components_placeholders/tmpl/default.php b/admin/views/components_placeholders/tmpl/default.php index c1dcae0e8..3612ef1b1 100644 --- a/admin/views/components_placeholders/tmpl/default.php +++ b/admin/views/components_placeholders/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/components_plugins/tmpl/default.php b/admin/views/components_plugins/tmpl/default.php index a4dcd693b..f79c12620 100644 --- a/admin/views/components_plugins/tmpl/default.php +++ b/admin/views/components_plugins/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/components_site_views/tmpl/default.php b/admin/views/components_site_views/tmpl/default.php index 077150658..f42d87bca 100644 --- a/admin/views/components_site_views/tmpl/default.php +++ b/admin/views/components_site_views/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/components_updates/tmpl/default.php b/admin/views/components_updates/tmpl/default.php index 7ea429079..193c6b494 100644 --- a/admin/views/components_updates/tmpl/default.php +++ b/admin/views/components_updates/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/custom_admin_views/tmpl/default.php b/admin/views/custom_admin_views/tmpl/default.php index e74f6e754..e20fde714 100644 --- a/admin/views/custom_admin_views/tmpl/default.php +++ b/admin/views/custom_admin_views/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/custom_codes/tmpl/default.php b/admin/views/custom_codes/tmpl/default.php index a2ea3c285..f9214e15e 100644 --- a/admin/views/custom_codes/tmpl/default.php +++ b/admin/views/custom_codes/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/dynamic_gets/tmpl/default.php b/admin/views/dynamic_gets/tmpl/default.php index 99e8c8d63..78a79ace1 100644 --- a/admin/views/dynamic_gets/tmpl/default.php +++ b/admin/views/dynamic_gets/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/fields/tmpl/default.php b/admin/views/fields/tmpl/default.php index 8687281a7..008cd39f0 100644 --- a/admin/views/fields/tmpl/default.php +++ b/admin/views/fields/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/fieldtypes/tmpl/default.php b/admin/views/fieldtypes/tmpl/default.php index 3a492e23d..876c961ce 100644 --- a/admin/views/fieldtypes/tmpl/default.php +++ b/admin/views/fieldtypes/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/help_documents/tmpl/default.php b/admin/views/help_documents/tmpl/default.php index 218b94a08..9c79c938f 100644 --- a/admin/views/help_documents/tmpl/default.php +++ b/admin/views/help_documents/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/joomla_components/tmpl/default.php b/admin/views/joomla_components/tmpl/default.php index a05fe3cc7..ecc519339 100644 --- a/admin/views/joomla_components/tmpl/default.php +++ b/admin/views/joomla_components/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/joomla_modules/tmpl/default.php b/admin/views/joomla_modules/tmpl/default.php index dd9582052..4100065a7 100644 --- a/admin/views/joomla_modules/tmpl/default.php +++ b/admin/views/joomla_modules/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/joomla_modules_files_folders_urls/tmpl/default.php b/admin/views/joomla_modules_files_folders_urls/tmpl/default.php index 6cf98b3a8..76bf426a9 100644 --- a/admin/views/joomla_modules_files_folders_urls/tmpl/default.php +++ b/admin/views/joomla_modules_files_folders_urls/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/joomla_modules_updates/tmpl/default.php b/admin/views/joomla_modules_updates/tmpl/default.php index 773ea33b0..6e2d69df4 100644 --- a/admin/views/joomla_modules_updates/tmpl/default.php +++ b/admin/views/joomla_modules_updates/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/joomla_plugin_groups/tmpl/default.php b/admin/views/joomla_plugin_groups/tmpl/default.php index b6f5bb304..cb53414e7 100644 --- a/admin/views/joomla_plugin_groups/tmpl/default.php +++ b/admin/views/joomla_plugin_groups/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/joomla_plugins/tmpl/default.php b/admin/views/joomla_plugins/tmpl/default.php index eee613380..67e1e8eac 100644 --- a/admin/views/joomla_plugins/tmpl/default.php +++ b/admin/views/joomla_plugins/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/joomla_plugins_files_folders_urls/tmpl/default.php b/admin/views/joomla_plugins_files_folders_urls/tmpl/default.php index 69e909642..de710474c 100644 --- a/admin/views/joomla_plugins_files_folders_urls/tmpl/default.php +++ b/admin/views/joomla_plugins_files_folders_urls/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/joomla_plugins_updates/tmpl/default.php b/admin/views/joomla_plugins_updates/tmpl/default.php index 90d6b4887..65d63db9b 100644 --- a/admin/views/joomla_plugins_updates/tmpl/default.php +++ b/admin/views/joomla_plugins_updates/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/language_translations/tmpl/default.php b/admin/views/language_translations/tmpl/default.php index 2270eeee6..2270d80e2 100644 --- a/admin/views/language_translations/tmpl/default.php +++ b/admin/views/language_translations/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/languages/tmpl/default.php b/admin/views/languages/tmpl/default.php index 29454e513..f7bc1f9a7 100644 --- a/admin/views/languages/tmpl/default.php +++ b/admin/views/languages/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/layouts/tmpl/default.php b/admin/views/layouts/tmpl/default.php index 835635544..71c5e14b5 100644 --- a/admin/views/layouts/tmpl/default.php +++ b/admin/views/layouts/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/libraries/tmpl/default.php b/admin/views/libraries/tmpl/default.php index f534989be..b68deb7d5 100644 --- a/admin/views/libraries/tmpl/default.php +++ b/admin/views/libraries/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/libraries_config/tmpl/default.php b/admin/views/libraries_config/tmpl/default.php index be211c97f..a0903a080 100644 --- a/admin/views/libraries_config/tmpl/default.php +++ b/admin/views/libraries_config/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/libraries_files_folders_urls/tmpl/default.php b/admin/views/libraries_files_folders_urls/tmpl/default.php index 48f530d2e..33e903268 100644 --- a/admin/views/libraries_files_folders_urls/tmpl/default.php +++ b/admin/views/libraries_files_folders_urls/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/placeholders/tmpl/default.php b/admin/views/placeholders/tmpl/default.php index 95246e912..242a4833c 100644 --- a/admin/views/placeholders/tmpl/default.php +++ b/admin/views/placeholders/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/servers/tmpl/default.php b/admin/views/servers/tmpl/default.php index d6157e504..cbb2a15bd 100644 --- a/admin/views/servers/tmpl/default.php +++ b/admin/views/servers/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/site_views/tmpl/default.php b/admin/views/site_views/tmpl/default.php index c2a6bff84..a9090f66c 100644 --- a/admin/views/site_views/tmpl/default.php +++ b/admin/views/site_views/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/snippet_types/tmpl/default.php b/admin/views/snippet_types/tmpl/default.php index ab5c6c4f4..820ed9c04 100644 --- a/admin/views/snippet_types/tmpl/default.php +++ b/admin/views/snippet_types/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/snippets/tmpl/default.php b/admin/views/snippets/tmpl/default.php index e6b2062e7..937eb60f0 100644 --- a/admin/views/snippets/tmpl/default.php +++ b/admin/views/snippets/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/templates/tmpl/default.php b/admin/views/templates/tmpl/default.php index 45fbdb5b5..30a5e9324 100644 --- a/admin/views/templates/tmpl/default.php +++ b/admin/views/templates/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/admin/views/validation_rules/tmpl/default.php b/admin/views/validation_rules/tmpl/default.php index 1c203d7b2..cfe4c2d20 100644 --- a/admin/views/validation_rules/tmpl/default.php +++ b/admin/views/validation_rules/tmpl/default.php @@ -75,8 +75,8 @@ if ($this->saveOrder) $this->loadTemplate('batch_body') ); ?> - - + + diff --git a/componentbuilder.xml b/componentbuilder.xml index b2b1e6da5..eb0c3abdf 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 17th February, 2020 + 27th February, 2020 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com diff --git a/script.php b/script.php index e23df6136..a6e132946 100644 --- a/script.php +++ b/script.php @@ -5976,7 +5976,7 @@ class com_componentbuilderInstallerScript $custom_admin_view->table = '{"special": {"dbtable": "#__componentbuilder_custom_admin_view","key": "id","type": "Custom_admin_view","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $custom_admin_view->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "css_document","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": {"system_name":"system_name","name":"name","description":"description","main_get":"main_get","add_php_jview_display":"add_php_jview_display","css_document":"css_document","css":"css","js_document":"js_document","javascript_file":"javascript_file","codename":"codename","default":"default","snippet":"snippet","icon":"icon","add_php_jview":"add_php_jview","context":"context","not_required":"not_required","add_js_document":"add_js_document","custom_get":"custom_get","add_javascript_file":"add_javascript_file","php_ajaxmethod":"php_ajaxmethod","add_css_document":"add_css_document","add_php_document":"add_php_document","add_css":"add_css","add_php_view":"add_php_view","add_php_ajax":"add_php_ajax","libraries":"libraries","dynamic_get":"dynamic_get","php_document":"php_document","php_view":"php_view","add_custom_button":"add_custom_button","php_jview_display":"php_jview_display","php_jview":"php_jview","php_controller":"php_controller","guid":"guid","php_model":"php_model"}}'; $custom_admin_view->router = 'ComponentbuilderHelperRoute::getCustom_admin_viewRoute'; - $custom_admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_admin_view.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","main_get","add_php_jview_display","snippet","add_php_jview","not_required","add_js_document","add_javascript_file","add_css_document","add_php_document","add_css","add_php_view","add_php_ajax","dynamic_get","add_custom_button"],"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": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; + $custom_admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_admin_view.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","main_get","add_php_jview_display","snippet","add_php_jview","add_js_document","add_javascript_file","add_css_document","add_php_document","add_css","add_php_view","add_php_ajax","dynamic_get","add_custom_button"],"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": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $custom_admin_view_Inserted = $db->insertObject('#__content_types', $custom_admin_view); @@ -5988,7 +5988,7 @@ class com_componentbuilderInstallerScript $site_view->table = '{"special": {"dbtable": "#__componentbuilder_site_view","key": "id","type": "Site_view","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $site_view->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "js_document","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": {"system_name":"system_name","name":"name","description":"description","main_get":"main_get","add_php_jview_display":"add_php_jview_display","add_php_document":"add_php_document","add_php_view":"add_php_view","js_document":"js_document","codename":"codename","javascript_file":"javascript_file","context":"context","not_required":"not_required","default":"default","snippet":"snippet","add_php_jview":"add_php_jview","custom_get":"custom_get","css_document":"css_document","add_javascript_file":"add_javascript_file","css":"css","add_js_document":"add_js_document","php_ajaxmethod":"php_ajaxmethod","add_css_document":"add_css_document","libraries":"libraries","add_css":"add_css","dynamic_get":"dynamic_get","add_php_ajax":"add_php_ajax","add_custom_button":"add_custom_button","php_document":"php_document","button_position":"button_position","php_view":"php_view","php_jview_display":"php_jview_display","php_jview":"php_jview","php_controller":"php_controller","guid":"guid","php_model":"php_model"}}'; $site_view->router = 'ComponentbuilderHelperRoute::getSite_viewRoute'; - $site_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/site_view.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","main_get","add_php_jview_display","add_php_document","add_php_view","not_required","snippet","add_php_jview","add_javascript_file","add_js_document","add_css_document","add_css","dynamic_get","add_php_ajax","add_custom_button","button_position"],"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": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; + $site_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/site_view.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","main_get","add_php_jview_display","add_php_document","add_php_view","snippet","add_php_jview","add_javascript_file","add_js_document","add_css_document","add_css","dynamic_get","add_php_ajax","add_custom_button","button_position"],"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": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $site_view_Inserted = $db->insertObject('#__content_types', $site_view); @@ -6024,7 +6024,7 @@ class com_componentbuilderInstallerScript $dynamic_get->table = '{"special": {"dbtable": "#__componentbuilder_dynamic_get","key": "id","type": "Dynamic_get","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $dynamic_get->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_before_getitems","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": {"name":"name","main_source":"main_source","gettype":"gettype","php_router_parse":"php_router_parse","php_before_getitems":"php_before_getitems","php_after_getitems":"php_after_getitems","php_after_getitem":"php_after_getitem","php_getlistquery":"php_getlistquery","view_selection":"view_selection","db_table_main":"db_table_main","php_custom_get":"php_custom_get","plugin_events":"plugin_events","db_selection":"db_selection","php_calculation":"php_calculation","php_before_getitem":"php_before_getitem","view_table_main":"view_table_main","select_all":"select_all","add_php_before_getitem":"add_php_before_getitem","getcustom":"getcustom","add_php_after_getitem":"add_php_after_getitem","pagination":"pagination","add_php_getlistquery":"add_php_getlistquery","not_required":"not_required","add_php_before_getitems":"add_php_before_getitems","add_php_after_getitems":"add_php_after_getitems","add_php_router_parse":"add_php_router_parse","addcalculation":"addcalculation","guid":"guid"}}'; $dynamic_get->router = 'ComponentbuilderHelperRoute::getDynamic_getRoute'; - $dynamic_get->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/dynamic_get.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","main_source","gettype","view_table_main","select_all","add_php_before_getitem","add_php_after_getitem","pagination","add_php_getlistquery","not_required","add_php_before_getitems","add_php_after_getitems","add_php_router_parse"],"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": "view_table_main","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + $dynamic_get->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/dynamic_get.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","main_source","gettype","view_table_main","select_all","add_php_before_getitem","add_php_after_getitem","pagination","add_php_getlistquery","add_php_before_getitems","add_php_after_getitems","add_php_router_parse"],"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": "view_table_main","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $dynamic_get_Inserted = $db->insertObject('#__content_types', $dynamic_get); @@ -6036,7 +6036,7 @@ class com_componentbuilderInstallerScript $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": "code","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","not_required":"not_required","function_name":"function_name","system_name":"system_name","code":"code","hashendtarget":"hashendtarget","to_line":"to_line","from_line":"from_line","hashtarget":"hashtarget"}}'; $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","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_joomla_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"],"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_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $custom_code_Inserted = $db->insertObject('#__content_types', $custom_code); @@ -6084,7 +6084,7 @@ class com_componentbuilderInstallerScript $library->table = '{"special": {"dbtable": "#__componentbuilder_library","key": "id","type": "Library","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $library->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","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": {"name":"name","target":"target","how":"how","type":"type","description":"description","not_required":"not_required","libraries":"libraries","php_setdocument":"php_setdocument","guid":"guid"}}'; $library->router = 'ComponentbuilderHelperRoute::getLibraryRoute'; - $library->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library.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","target","how","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": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $library->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library.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","target","how","type"],"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": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $library_Inserted = $db->insertObject('#__content_types', $library); @@ -6192,7 +6192,7 @@ class com_componentbuilderInstallerScript $server->table = '{"special": {"dbtable": "#__componentbuilder_server","key": "id","type": "Server","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $server->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","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": {"name":"name","protocol":"protocol","not_required":"not_required","signature":"signature","private_key":"private_key","secret":"secret","password":"password","private":"private","authentication":"authentication","path":"path","port":"port","host":"host","username":"username"}}'; $server->router = 'ComponentbuilderHelperRoute::getServerRoute'; - $server->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/server.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","protocol","not_required","authentication"],"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"}]}'; + $server->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/server.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","protocol","authentication"],"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"}]}'; // Set the object into the content types table. $server_Inserted = $db->insertObject('#__content_types', $server); @@ -7469,7 +7469,7 @@ class com_componentbuilderInstallerScript $custom_admin_view->table = '{"special": {"dbtable": "#__componentbuilder_custom_admin_view","key": "id","type": "Custom_admin_view","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $custom_admin_view->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "css_document","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": {"system_name":"system_name","name":"name","description":"description","main_get":"main_get","add_php_jview_display":"add_php_jview_display","css_document":"css_document","css":"css","js_document":"js_document","javascript_file":"javascript_file","codename":"codename","default":"default","snippet":"snippet","icon":"icon","add_php_jview":"add_php_jview","context":"context","not_required":"not_required","add_js_document":"add_js_document","custom_get":"custom_get","add_javascript_file":"add_javascript_file","php_ajaxmethod":"php_ajaxmethod","add_css_document":"add_css_document","add_php_document":"add_php_document","add_css":"add_css","add_php_view":"add_php_view","add_php_ajax":"add_php_ajax","libraries":"libraries","dynamic_get":"dynamic_get","php_document":"php_document","php_view":"php_view","add_custom_button":"add_custom_button","php_jview_display":"php_jview_display","php_jview":"php_jview","php_controller":"php_controller","guid":"guid","php_model":"php_model"}}'; $custom_admin_view->router = 'ComponentbuilderHelperRoute::getCustom_admin_viewRoute'; - $custom_admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_admin_view.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","main_get","add_php_jview_display","snippet","add_php_jview","not_required","add_js_document","add_javascript_file","add_css_document","add_php_document","add_css","add_php_view","add_php_ajax","dynamic_get","add_custom_button"],"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": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; + $custom_admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_admin_view.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","main_get","add_php_jview_display","snippet","add_php_jview","add_js_document","add_javascript_file","add_css_document","add_php_document","add_css","add_php_view","add_php_ajax","dynamic_get","add_custom_button"],"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": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; // Check if custom_admin_view type is already in content_type DB. $custom_admin_view_id = null; @@ -7498,7 +7498,7 @@ class com_componentbuilderInstallerScript $site_view->table = '{"special": {"dbtable": "#__componentbuilder_site_view","key": "id","type": "Site_view","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $site_view->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "js_document","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": {"system_name":"system_name","name":"name","description":"description","main_get":"main_get","add_php_jview_display":"add_php_jview_display","add_php_document":"add_php_document","add_php_view":"add_php_view","js_document":"js_document","codename":"codename","javascript_file":"javascript_file","context":"context","not_required":"not_required","default":"default","snippet":"snippet","add_php_jview":"add_php_jview","custom_get":"custom_get","css_document":"css_document","add_javascript_file":"add_javascript_file","css":"css","add_js_document":"add_js_document","php_ajaxmethod":"php_ajaxmethod","add_css_document":"add_css_document","libraries":"libraries","add_css":"add_css","dynamic_get":"dynamic_get","add_php_ajax":"add_php_ajax","add_custom_button":"add_custom_button","php_document":"php_document","button_position":"button_position","php_view":"php_view","php_jview_display":"php_jview_display","php_jview":"php_jview","php_controller":"php_controller","guid":"guid","php_model":"php_model"}}'; $site_view->router = 'ComponentbuilderHelperRoute::getSite_viewRoute'; - $site_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/site_view.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","main_get","add_php_jview_display","add_php_document","add_php_view","not_required","snippet","add_php_jview","add_javascript_file","add_js_document","add_css_document","add_css","dynamic_get","add_php_ajax","add_custom_button","button_position"],"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": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; + $site_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/site_view.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","main_get","add_php_jview_display","add_php_document","add_php_view","snippet","add_php_jview","add_javascript_file","add_js_document","add_css_document","add_css","dynamic_get","add_php_ajax","add_custom_button","button_position"],"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": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; // Check if site_view type is already in content_type DB. $site_view_id = null; @@ -7585,7 +7585,7 @@ class com_componentbuilderInstallerScript $dynamic_get->table = '{"special": {"dbtable": "#__componentbuilder_dynamic_get","key": "id","type": "Dynamic_get","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $dynamic_get->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_before_getitems","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": {"name":"name","main_source":"main_source","gettype":"gettype","php_router_parse":"php_router_parse","php_before_getitems":"php_before_getitems","php_after_getitems":"php_after_getitems","php_after_getitem":"php_after_getitem","php_getlistquery":"php_getlistquery","view_selection":"view_selection","db_table_main":"db_table_main","php_custom_get":"php_custom_get","plugin_events":"plugin_events","db_selection":"db_selection","php_calculation":"php_calculation","php_before_getitem":"php_before_getitem","view_table_main":"view_table_main","select_all":"select_all","add_php_before_getitem":"add_php_before_getitem","getcustom":"getcustom","add_php_after_getitem":"add_php_after_getitem","pagination":"pagination","add_php_getlistquery":"add_php_getlistquery","not_required":"not_required","add_php_before_getitems":"add_php_before_getitems","add_php_after_getitems":"add_php_after_getitems","add_php_router_parse":"add_php_router_parse","addcalculation":"addcalculation","guid":"guid"}}'; $dynamic_get->router = 'ComponentbuilderHelperRoute::getDynamic_getRoute'; - $dynamic_get->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/dynamic_get.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","main_source","gettype","view_table_main","select_all","add_php_before_getitem","add_php_after_getitem","pagination","add_php_getlistquery","not_required","add_php_before_getitems","add_php_after_getitems","add_php_router_parse"],"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": "view_table_main","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + $dynamic_get->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/dynamic_get.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","main_source","gettype","view_table_main","select_all","add_php_before_getitem","add_php_after_getitem","pagination","add_php_getlistquery","add_php_before_getitems","add_php_after_getitems","add_php_router_parse"],"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": "view_table_main","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if dynamic_get type is already in content_type DB. $dynamic_get_id = null; @@ -7614,7 +7614,7 @@ class com_componentbuilderInstallerScript $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": "code","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","not_required":"not_required","function_name":"function_name","system_name":"system_name","code":"code","hashendtarget":"hashendtarget","to_line":"to_line","from_line":"from_line","hashtarget":"hashtarget"}}'; $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","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_joomla_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"],"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_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if custom_code type is already in content_type DB. $custom_code_id = null; @@ -7730,7 +7730,7 @@ class com_componentbuilderInstallerScript $library->table = '{"special": {"dbtable": "#__componentbuilder_library","key": "id","type": "Library","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $library->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","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": {"name":"name","target":"target","how":"how","type":"type","description":"description","not_required":"not_required","libraries":"libraries","php_setdocument":"php_setdocument","guid":"guid"}}'; $library->router = 'ComponentbuilderHelperRoute::getLibraryRoute'; - $library->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library.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","target","how","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": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $library->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library.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","target","how","type"],"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": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Check if library type is already in content_type DB. $library_id = null; @@ -7991,7 +7991,7 @@ class com_componentbuilderInstallerScript $server->table = '{"special": {"dbtable": "#__componentbuilder_server","key": "id","type": "Server","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $server->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","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": {"name":"name","protocol":"protocol","not_required":"not_required","signature":"signature","private_key":"private_key","secret":"secret","password":"password","private":"private","authentication":"authentication","path":"path","port":"port","host":"host","username":"username"}}'; $server->router = 'ComponentbuilderHelperRoute::getServerRoute'; - $server->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/server.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","protocol","not_required","authentication"],"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"}]}'; + $server->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/server.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","protocol","authentication"],"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"}]}'; // Check if server type is already in content_type DB. $server_id = null; -- 2.40.1 From 86f671c87cd99172230e7bb71a988414a4fb9ce8 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Fri, 13 Mar 2020 04:45:08 +0200 Subject: [PATCH 5/8] Added module area target client switch. Added the custom code placeholder search to modules. Improved the JCB backup feature to only move the zip package to the backup location. --- README.md | 12 +- admin/README.txt | 12 +- admin/helpers/compiler/a_Get.php | 86 +++++- .../en-GB/en-GB.com_componentbuilder.ini | 5 + admin/layouts/joomla_module/html_above.php | 3 +- admin/models/forms/joomla_module.xml | 244 ++++++++++-------- admin/models/joomla_components.php | 21 +- admin/models/joomla_module.php | 29 ++- admin/models/joomla_modules.php | 52 +++- admin/sql/install.mysql.utf8.sql | 13 +- .../joomla_modules/tmpl/default_body.php | 3 + .../joomla_modules/tmpl/default_foot.php | 2 +- .../joomla_modules/tmpl/default_head.php | 3 + admin/views/joomla_modules/view.html.php | 66 +++++ componentbuilder.xml | 6 +- componentbuilder_update_server.xml | 17 ++ script.php | 10 +- 17 files changed, 403 insertions(+), 181 deletions(-) diff --git a/README.md b/README.md index 17a1baab6..40f307e44 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have! -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.10.11) 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.10.12) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -144,13 +144,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 27th February, 2020 -+ *Version*: 2.10.11 ++ *Last Build*: 13th March, 2020 ++ *Version*: 2.10.12 + *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **278669** -+ *Field count*: **1505** -+ *File count*: **1756** ++ *Line count*: **278824** ++ *Field count*: **1506** ++ *File count*: **1757** + *Folder count*: **278** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/README.txt b/admin/README.txt index 17a1baab6..40f307e44 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have! -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.10.11) 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.10.12) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -144,13 +144,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 27th February, 2020 -+ *Version*: 2.10.11 ++ *Last Build*: 13th March, 2020 ++ *Version*: 2.10.12 + *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **278669** -+ *Field count*: **1505** -+ *File count*: **1756** ++ *Line count*: **278824** ++ *Field count*: **1506** ++ *File count*: **1757** + *Folder count*: **278** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index aeaaddb44..14a6bacac 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -6278,6 +6278,64 @@ class Get return false; } + /** + * get the Joomla module path + * + * @return array of module path and target site area on success + * + */ + protected function getModulePath($id) + { + if (is_numeric($id) && $id > 0) + { + // Create a new query object. + $query = $this->db->getQuery(true); + + $query->select('a.*'); + $query->select( + $this->db->quoteName( + array( + 'a.name', + 'a.target' + ), array( + 'name', + 'target' + ) + ) + ); + // from these tables + $query->from('#__componentbuilder_joomla_module AS a'); + $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); + $this->db->setQuery($query); + $this->db->execute(); + if ($this->db->getNumRows()) + { + // get the module data + $module = $this->db->loadObject(); + // update the name if it has dynamic values + $module->name = $this->setPlaceholders($this->setDynamicValues($module->name), $this->globalPlaceholders); + // set safe class function name + $module->code_name = ComponentbuilderHelper::safeClassFunctionName($module->name); + // set module folder name + $module->folder_name = 'mod_' . strtolower($module->code_name); + // set the lang key + $this->langKeys[strtoupper($module->folder_name)] = $module->id . '_M0dU|3'; + // return the path + if ($module->target == 2) + { + // administrator client area + return JPATH_ADMINISTRATOR . '/modules/' . $module->folder_name; + } + else + { + // default is the site client area + return JPATH_ROOT . '/modules/' . $module->folder_name; + } + } + } + return false; + } + /** * get the Joomla Modules IDs * @@ -6379,11 +6437,22 @@ class Get { $module->module_version = '1.0.0'; } + // set target client + if ($module->target == 2) + { + $module->target_client = 'admin'; + } + else + { + // default is site area + $module->target_client = 'site'; + } + unset($module->target); // set GUI mapper $guiMapper = array( 'table' => 'joomla_module', 'id' => (int) $id, 'type' => 'php'); // update the name if it has dynamic values $module->name = $this->setPlaceholders($this->setDynamicValues($module->name), $this->placeholders); - // update the name if it has dynamic values + // set safe class function name $module->code_name = ComponentbuilderHelper::safeClassFunctionName($module->name); // set official name $module->official_name = ComponentbuilderHelper::safeString($module->name, 'W'); @@ -6832,7 +6901,7 @@ class Get public function getModuleXMLTemplate(&$module) { $xml = ''; - $xml .= PHP_EOL . ''; + $xml .= PHP_EOL . ''; $xml .= PHP_EOL . $this->_t(1) . '' . $module->lang_prefix . ''; $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'BUILDDATE' . $this->hhh . ''; $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'AUTHOR' . $this->hhh . ''; @@ -6912,7 +6981,6 @@ class Get $query->from('#__componentbuilder_joomla_plugin AS a'); $query->join('LEFT', $this->db->quoteName('#__componentbuilder_joomla_plugin_group', 'g') . ' ON (' . $this->db->quoteName('a.joomla_plugin_group') . ' = ' . $this->db->quoteName('g.id') . ')'); $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); - $query->where($this->db->quoteName('a.published') . ' >= 1'); $this->db->setQuery($query); $this->db->execute(); if ($this->db->getNumRows()) @@ -8390,12 +8458,12 @@ class Get { foreach ($module_ids as $module_id) { - // get the module group and folder name -// if (($path = $this->getModulePath($module_id)) !== false) -// { -// // set the path -// $localPaths['module_' . str_replace('/', '_', $path)] = JPATH_ROOT . '/modules/' . $path; -// } + // get the module folder path + if (($path = $this->getModulePath($module_id)) !== false) + { + // set the path + $localPaths['module_' . str_replace('/', '_', $path)] = $path; + } } } // Painfull but we need to folder paths for the linked plugins diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index ffa7124a2..6f813bd96 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -6167,6 +6167,7 @@ COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_SQL_UNINSTALL="Add Sql Uninstall" COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_SQL_UNINSTALL_LABEL="Add MySQL - (Uninstall)" COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_UPDATE_SERVER="Add Update Server" COM_COMPONENTBUILDER_JOOMLA_MODULE_ADD_UPDATE_SERVER_LABEL="Add Update Server" +COM_COMPONENTBUILDER_JOOMLA_MODULE_ADMIN="Admin" COM_COMPONENTBUILDER_JOOMLA_MODULE_CLASS="class" COM_COMPONENTBUILDER_JOOMLA_MODULE_CLASS_HELPER_CODE="Class Helper Code" COM_COMPONENTBUILDER_JOOMLA_MODULE_CLASS_HELPER_CODE_DESCRIPTION="Add the class properties & methods here." @@ -6422,6 +6423,7 @@ COM_COMPONENTBUILDER_JOOMLA_MODULE_SALES_SERVER_LABEL="Sales Server" COM_COMPONENTBUILDER_JOOMLA_MODULE_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Joomla Module to customise the alias." COM_COMPONENTBUILDER_JOOMLA_MODULE_SCRIPT_FILE="Script File" COM_COMPONENTBUILDER_JOOMLA_MODULE_SERVER="Server" +COM_COMPONENTBUILDER_JOOMLA_MODULE_SITE="Site" COM_COMPONENTBUILDER_JOOMLA_MODULE_SNIPPET="Snippet" COM_COMPONENTBUILDER_JOOMLA_MODULE_SNIPPET_DESCRIPTION="Select a snippet you would like to use or review." COM_COMPONENTBUILDER_JOOMLA_MODULE_SNIPPET_LABEL="Select a Snippet" @@ -6439,6 +6441,9 @@ COM_COMPONENTBUILDER_JOOMLA_MODULE_SYSTEM_NAME_DESCRIPTION="Used only in the sys COM_COMPONENTBUILDER_JOOMLA_MODULE_SYSTEM_NAME_HINT="The System Name Here" COM_COMPONENTBUILDER_JOOMLA_MODULE_SYSTEM_NAME_LABEL="System Name" COM_COMPONENTBUILDER_JOOMLA_MODULE_SYSTEM_NAME_MESSAGE="Error! Please add some text here." +COM_COMPONENTBUILDER_JOOMLA_MODULE_TARGET="Target" +COM_COMPONENTBUILDER_JOOMLA_MODULE_TARGET_DESCRIPTION="Set the area this module is targeting." +COM_COMPONENTBUILDER_JOOMLA_MODULE_TARGET_LABEL="Target Area" COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES="Joomla Module Updates" COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_CREATED_BY_DESC="The user that created this Joomla Module Updates." COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_CREATED_BY_LABEL="Created By" diff --git a/admin/layouts/joomla_module/html_above.php b/admin/layouts/joomla_module/html_above.php index b4cee2ab9..d0d101f99 100644 --- a/admin/layouts/joomla_module/html_above.php +++ b/admin/layouts/joomla_module/html_above.php @@ -27,7 +27,8 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( 'system_name', - 'module_version' + 'module_version', + 'target' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); diff --git a/admin/models/forms/joomla_module.xml b/admin/models/forms/joomla_module.xml index b290b7193..b1b2279f2 100644 --- a/admin/models/forms/joomla_module.xml +++ b/admin/models/forms/joomla_module.xml @@ -99,6 +99,22 @@ message="COM_COMPONENTBUILDER_JOOMLA_MODULE_SYSTEM_NAME_MESSAGE" hint="COM_COMPONENTBUILDER_JOOMLA_MODULE_SYSTEM_NAME_HINT" /> + + + + + + + + + + + + + + + + + + COM_COMPONENTBUILDER_JOOMLA_MODULE_NO - + + + + + + + + + + + + + + + + + + + + + + + + + + + COM_COMPONENTBUILDER_JOOMLA_MODULE_OTHER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - COM_COMPONENTBUILDER_JOOMLA_MODULE_NO - - + + COM_COMPONENTBUILDER_JOOMLA_MODULE_NO - + diff --git a/admin/models/joomla_components.php b/admin/models/joomla_components.php index 9c4a53cc2..aa3c20858 100644 --- a/admin/models/joomla_components.php +++ b/admin/models/joomla_components.php @@ -131,16 +131,14 @@ class ComponentbuilderModelJoomla_components extends JModelList { // set custom folder path $this->customPath = $this->params->get('custom_folder_path', JPATH_COMPONENT_ADMINISTRATOR.'/custom'); + // set the backup paths + $comConfig = JFactory::getConfig(); + $this->backupPath = $comConfig->get('tmp_path'); // check what type of export or backup this is if ('backup' === $this->activeType || 'manualBackup' === $this->activeType) { - // set the paths - if (!$this->backupPath = $this->params->get('cronjob_backup_folder_path', null)) - { - // set the paths - $comConfig = JFactory::getConfig(); - $this->backupPath = $comConfig->get('tmp_path'); - } + // set the zip path + $this->zipPath = $this->params->get('cronjob_backup_folder_path', $this->backupPath); // check what backup type we are working with here $this->backupType = $this->params->get('cronjob_backup_type', 1); // 1 = local folder; 2 = remote server (default is local) // if remote server get the ID @@ -162,9 +160,8 @@ class ComponentbuilderModelJoomla_components extends JModelList } else { - // set the paths - $comConfig = JFactory::getConfig(); - $this->backupPath = $comConfig->get('tmp_path'); + // set the zip path + $this->zipPath = $this->backupPath; // set the package name if (count($items) == 1) { @@ -177,7 +174,7 @@ class ComponentbuilderModelJoomla_components extends JModelList } // set the package path $this->packagePath = rtrim($this->backupPath, '/') . '/' . $this->packageName; - $this->zipPath = $this->packagePath .'.zip'; + $this->zipPath = rtrim($this->zipPath, '/') . '/' . $this->packageName .'.zip'; if (JFolder::exists($this->packagePath)) { // remove if old folder is found @@ -187,7 +184,7 @@ class ComponentbuilderModelJoomla_components extends JModelList JFolder::create($this->packagePath); // Get the basic encryption. $basickey = ComponentbuilderHelper::getCryptKey('basic'); - // Get the encription object. + // Get the encryption object. if ($basickey) { $basic = new FOFEncryptAes($basickey, 128); diff --git a/admin/models/joomla_module.php b/admin/models/joomla_module.php index 8732bc762..a513031ff 100644 --- a/admin/models/joomla_module.php +++ b/admin/models/joomla_module.php @@ -45,7 +45,8 @@ class ComponentbuilderModelJoomla_module extends JModelAdmin ), 'above' => array( 'system_name', - 'module_version' + 'module_version', + 'target' ) ), 'script_file' => array( @@ -66,19 +67,6 @@ class ComponentbuilderModelJoomla_module extends JModelAdmin 'php_method_uninstall' ) ), - 'dynamic_integration' => array( - 'left' => array( - 'add_update_server', - 'update_server_url', - 'update_server_target', - 'note_update_server_note_ftp', - 'note_update_server_note_zip', - 'note_update_server_note_other', - 'update_server', - 'add_sales_server', - 'sales_server' - ) - ), 'readme' => array( 'left' => array( 'addreadme', @@ -93,6 +81,19 @@ class ComponentbuilderModelJoomla_module extends JModelAdmin 'sql_uninstall' ) ), + 'dynamic_integration' => array( + 'left' => array( + 'add_update_server', + 'update_server_url', + 'update_server_target', + 'note_update_server_note_ftp', + 'note_update_server_note_zip', + 'note_update_server_note_other', + 'update_server', + 'add_sales_server', + 'sales_server' + ) + ), 'code' => array( 'left' => array( 'custom_get' diff --git a/admin/models/joomla_modules.php b/admin/models/joomla_modules.php index 606bb21ad..c2c550c10 100644 --- a/admin/models/joomla_modules.php +++ b/admin/models/joomla_modules.php @@ -28,7 +28,8 @@ class ComponentbuilderModelJoomla_modules extends JModelList 'a.created_by','created_by', 'a.modified_by','modified_by', 'a.system_name','system_name', - 'a.description','description' + 'a.description','description', + 'a.target','target' ); } @@ -53,7 +54,10 @@ class ComponentbuilderModelJoomla_modules extends JModelList $this->setState('filter.system_name', $system_name); $description = $this->getUserStateFromRequest($this->context . '.filter.description', 'filter_description'); - $this->setState('filter.description', $description); + $this->setState('filter.description', $description); + + $target = $this->getUserStateFromRequest($this->context . '.filter.target', 'filter_target'); + $this->setState('filter.target', $target); $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); $this->setState('filter.sorting', $sorting); @@ -109,10 +113,44 @@ class ComponentbuilderModelJoomla_modules extends JModelList } } - } + } + + // set selection value to a translatable value + if (ComponentbuilderHelper::checkArray($items)) + { + foreach ($items as $nr => &$item) + { + // convert target + $item->target = $this->selectionTranslation($item->target, 'target'); + } + } + // return items return $items; + } + + /** + * Method to convert selection values to translatable string. + * + * @return translatable string + */ + public function selectionTranslation($value,$name) + { + // Array of target language strings + if ($name === 'target') + { + $targetArray = array( + 1 => 'COM_COMPONENTBUILDER_JOOMLA_MODULE_SITE', + 2 => 'COM_COMPONENTBUILDER_JOOMLA_MODULE_ADMIN' + ); + // Now check if value is found in this array + if (isset($targetArray[$value]) && ComponentbuilderHelper::checkString($targetArray[$value])) + { + return $targetArray[$value]; + } + } + return $value; } /** @@ -174,6 +212,11 @@ class ComponentbuilderModelJoomla_modules extends JModelList } } + // Filter by Target. + if ($target = $this->getState('filter.target')) + { + $query->where('a.target = ' . $db->quote($db->escape($target))); + } // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); @@ -202,7 +245,8 @@ class ComponentbuilderModelJoomla_modules extends JModelList $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); $id .= ':' . $this->getState('filter.system_name'); - $id .= ':' . $this->getState('filter.description'); + $id .= ':' . $this->getState('filter.description'); + $id .= ':' . $this->getState('filter.target'); return parent::getStoreId($id); } diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index de7fa98d0..fe7db6418 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -183,6 +183,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_module` ( `sql` MEDIUMTEXT NOT NULL, `sql_uninstall` MEDIUMTEXT NOT NULL, `system_name` VARCHAR(255) NOT NULL DEFAULT '', + `target` TINYINT(1) NOT NULL DEFAULT 0, `update_server` INT(11) NOT NULL DEFAULT 0, `update_server_target` TINYINT(1) NOT NULL DEFAULT 0, `update_server_url` VARCHAR(255) NOT NULL DEFAULT '', @@ -200,13 +201,13 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_module` ( `ordering` INT(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `idx_system_name` (`system_name`), + KEY `idx_add_php_method_uninstall` (`add_php_method_uninstall`), + KEY `idx_add_php_postflight_update` (`add_php_postflight_update`), KEY `idx_add_php_postflight_install` (`add_php_postflight_install`), KEY `idx_add_php_preflight_uninstall` (`add_php_preflight_uninstall`), - KEY `idx_update_server_target` (`update_server_target`), KEY `idx_addreadme` (`addreadme`), KEY `idx_add_sql` (`add_sql`), - KEY `idx_add_php_postflight_update` (`add_php_postflight_update`), - KEY `idx_add_php_method_uninstall` (`add_php_method_uninstall`), + KEY `idx_update_server_target` (`update_server_target`), KEY `idx_add_sql_uninstall` (`add_sql_uninstall`), KEY `idx_add_update_server` (`add_update_server`), KEY `idx_add_php_script_construct` (`add_php_script_construct`), @@ -2101,8 +2102,8 @@ INSERT INTO `#__componentbuilder_validation_rule` (`id`, `name`, `php`, `short_d (1, 'inspect', 'CS8qKg0KCSAqIE1ldGhvZCB0byB0ZXN0IHRoZSB2YWx1ZS4NCgkgKg0KCSAqIEBwYXJhbSAgIFxTaW1wbGVYTUxFbGVtZW50ICAkZWxlbWVudCAgVGhlIFNpbXBsZVhNTEVsZW1lbnQgb2JqZWN0IHJlcHJlc2VudGluZyB0aGUgYDxmaWVsZD5gIHRhZyBmb3IgdGhlIGZvcm0gZmllbGQgb2JqZWN0Lg0KCSAqIEBwYXJhbSAgIG1peGVkICAgICAgICAgICAgICAkdmFsdWUgICAgVGhlIGZvcm0gZmllbGQgdmFsdWUgdG8gdmFsaWRhdGUuDQoJICogQHBhcmFtICAgc3RyaW5nICAgICAgICAgICAgICRncm91cCAgICBUaGUgZmllbGQgbmFtZSBncm91cCBjb250cm9sIHZhbHVlLiBUaGlzIGFjdHMgYXMgYW4gYXJyYXkgY29udGFpbmVyIGZvciB0aGUgZmllbGQuDQoJICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGb3IgZXhhbXBsZSBpZiB0aGUgZmllbGQgaGFzIG5hbWU9ImZvbyIgYW5kIHRoZSBncm91cCB2YWx1ZSBpcyBzZXQgdG8gImJhciIgdGhlbiB0aGUNCgkgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bGwgZmllbGQgbmFtZSB3b3VsZCBlbmQgdXAgYmVpbmcgImJhcltmb29dIi4NCgkgKiBAcGFyYW0gICBSZWdpc3RyeSAgICAgICAgICAgJGlucHV0ICAgIEFuIG9wdGlvbmFsIFJlZ2lzdHJ5IG9iamVjdCB3aXRoIHRoZSBlbnRpcmUgZGF0YSBzZXQgdG8gdmFsaWRhdGUgYWdhaW5zdCB0aGUgZW50aXJlIGZvcm0uDQoJICogQHBhcmFtICAgRm9ybSAgICAgICAgICAgICAgICRmb3JtICAgICBUaGUgZm9ybSBvYmplY3QgZm9yIHdoaWNoIHRoZSBmaWVsZCBpcyBiZWluZyB0ZXN0ZWQuDQoJICoNCgkgKiBAcmV0dXJuICBib29sZWFuICBUcnVlIGlmIHRoZSB2YWx1ZSBpcyB2YWxpZCwgZmFsc2Ugb3RoZXJ3aXNlLg0KCSAqDQoJICogQHNpbmNlICAgMTEuMQ0KCSAqLw0KCXB1YmxpYyBmdW5jdGlvbiB0ZXN0KFxTaW1wbGVYTUxFbGVtZW50ICRlbGVtZW50LCAkdmFsdWUsICRncm91cCA9IG51bGwsIFJlZ2lzdHJ5ICRpbnB1dCA9IG51bGwsIEZvcm0gJGZvcm0gPSBudWxsKQ0KCXsNCgkJLy8gbG9vayBpbnRvIHRoZXNlIHZhbHVlcyBvbmUgYXQgYSB0aW1lDQoJCWVjaG8gJ2VsZW1lbnQ8YnIgLz4nOw0KCQl2YXJfZHVtcCgkZWxlbWVudCk7DQoJCWVjaG8gJ3ZhbHVlPGJyIC8+JzsNCgkJdmFyX2R1bXAoJHZhbHVlKTsNCgkJZWNobyAnZ3JvdXA8YnIgLz4nOw0KCQl2YXJfZHVtcCgkZ3JvdXApOw0KCQllY2hvICdpbnB1dDxiciAvPic7DQoJCXZhcl9kdW1wKCRpbnB1dCk7DQoJCWVjaG8gJ2Zvcm08YnIgLz4nOw0KCQl2YXJfZHVtcCgkZm9ybSk7DQoJCWpleGl0KCk7DQoJfQ==', 'simple function to inspect the test values', 1, '2018-03-30 09:22:15'), (2, 'code', 'CS8qKg0KCSAqIE1ldGhvZCB0byB0ZXN0IHRoZSB2YWx1ZS4NCgkgKg0KCSAqIEBwYXJhbSAgIFxTaW1wbGVYTUxFbGVtZW50ICAkZWxlbWVudCAgVGhlIFNpbXBsZVhNTEVsZW1lbnQgb2JqZWN0IHJlcHJlc2VudGluZyB0aGUgYDxmaWVsZD5gIHRhZyBmb3IgdGhlIGZvcm0gZmllbGQgb2JqZWN0Lg0KCSAqIEBwYXJhbSAgIG1peGVkICAgICAgICAgICAgICAkdmFsdWUgICAgVGhlIGZvcm0gZmllbGQgdmFsdWUgdG8gdmFsaWRhdGUuDQoJICogQHBhcmFtICAgc3RyaW5nICAgICAgICAgICAgICRncm91cCAgICBUaGUgZmllbGQgbmFtZSBncm91cCBjb250cm9sIHZhbHVlLiBUaGlzIGFjdHMgYXMgYW4gYXJyYXkgY29udGFpbmVyIGZvciB0aGUgZmllbGQuDQoJICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGb3IgZXhhbXBsZSBpZiB0aGUgZmllbGQgaGFzIG5hbWU9ImZvbyIgYW5kIHRoZSBncm91cCB2YWx1ZSBpcyBzZXQgdG8gImJhciIgdGhlbiB0aGUNCgkgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bGwgZmllbGQgbmFtZSB3b3VsZCBlbmQgdXAgYmVpbmcgImJhcltmb29dIi4NCgkgKiBAcGFyYW0gICBSZWdpc3RyeSAgICAgICAgICAgJGlucHV0ICAgIEFuIG9wdGlvbmFsIFJlZ2lzdHJ5IG9iamVjdCB3aXRoIHRoZSBlbnRpcmUgZGF0YSBzZXQgdG8gdmFsaWRhdGUgYWdhaW5zdCB0aGUgZW50aXJlIGZvcm0uDQoJICogQHBhcmFtICAgRm9ybSAgICAgICAgICAgICAgICRmb3JtICAgICBUaGUgZm9ybSBvYmplY3QgZm9yIHdoaWNoIHRoZSBmaWVsZCBpcyBiZWluZyB0ZXN0ZWQuDQoJICoNCgkgKiBAcmV0dXJuICBib29sZWFuICBUcnVlIGlmIHRoZSB2YWx1ZSBpcyB2YWxpZCwgZmFsc2Ugb3RoZXJ3aXNlLg0KCSAqLw0KCXB1YmxpYyBmdW5jdGlvbiB0ZXN0KFxTaW1wbGVYTUxFbGVtZW50ICRlbGVtZW50LCAkdmFsdWUsICRncm91cCA9IG51bGwsIFJlZ2lzdHJ5ICRpbnB1dCA9IG51bGwsIEZvcm0gJGZvcm0gPSBudWxsKQ0KCXsNCgkJLy8gVGhpcyByZW1vdmVzIGFsbCB2YWxpZGF0aW9uIChpcyBkYW5nZXJvdXMpIGJ1dCBuZWVkZWQgdG8gc3VibWl0IGNvZGUgdmlhIEpDQg0KCQlyZXR1cm4gdHJ1ZTsNCg0KCQkvKioNCgkJICogTXkgaWRlYSBpcyB0byBhZGQgc29tZSBraW5kIG9mIHZhbGlkYXRpb24gdG8gaW1wcm92ZSBKQ0IgY29kZSAocGVyL2xhbmd1YWdlKQ0KCQkgKg0KCQkgKiBTbyBhdCB0aGlzIHRpbWUgdGhpcyBjb2RlIHZhbGlkYXRpb24gaXMgdXNlZCBmb3IgSmF2YVNjcmlwdCxDU1MsSFRNTCBhbmQgUEhQLg0KCQkgKiBXZSBjYW4gc2VlIHdoYXQgbGFuZ3VhZ2UgaXMgYmVpbmcgd29ya2VkIG9uIHdpdGggdGhlIHN5bnRheCBwcm9wZXJ0eSBpbiB0aGUgJGVsZW1lbnQuIChpbiBKQ0IpDQoJCSAqIFdoYXQgY29tcGxpY2F0ZXMgdGhpbmdzIGlzIHRoZSBwbGFjZWhvbGRlcnMsIG9mIGJvdGggY3VzdG9tIGNvZGUsIGNvbXBvbmVudCwgYW5kIHZpZXcgbmFtZXMuDQoJCSAqIElkZWFsbHkgd2UgY291bGQgc3RyaXAgdGhlbSBhbmQgdGhlbiB2YWxpZGF0ZSB0aGUgY29kZSB0byBiZWluZyBzeW50YWN0aWNhbGx5IGNvcnJlY3QuDQoJCSAqIEJ1dCBzaW5jZSBzb21lIG9mIHRoZSBwbGFjZWhvbGRlcnMgZm9ybSBwYXJ0IG9mIHRoZSBjbGFzcy9mdW5jdGlvbiBuYW1lcyBhbmQgdGhlIG1vcmUsIGl0IHNlZW1zIGxpa2Ugd2UgYXJlIHByZXNzZWQgZm9yIGEgbXVjaCBtb3JlIGFkdmFuY2Ugc29sdXRpb24uDQoJCSAqIElmIHlvdSBoYXZlIGFueSBpZGVhcyB0byBob3cgd2UgY2FuIGdvIGFib3V0IHRvIGRvIHRoaXMsIHRoZW4gcGxlYXNlIG9wZW4gYW4gaXNzdWUgb24gZ2l0aHViIGFuZCBsZXRzIGJlZ2luLiAodGhpcyBpcyBhIG5pY2UgdG8gaGF2ZSwgc28gZG9uJ3QgYnJlYWsgYSBsZWcuLi4pDQoJCSAqLw0KCX0=', 'To validate code', 1, '2018-06-24 19:11:45'), (3, 'uniquefield', 'CS8qKg0KCSAqIE1ldGhvZCB0byB0ZXN0IHRoZSBmaWVsZCB2YWx1ZSBmb3IgdW5pcXVlbmVzcy4NCgkgKg0KCSAqIEBwYXJhbSAgIFxTaW1wbGVYTUxFbGVtZW50ICAkZWxlbWVudCAgVGhlIFNpbXBsZVhNTEVsZW1lbnQgb2JqZWN0IHJlcHJlc2VudGluZyB0aGUgYDxmaWVsZD5gIHRhZyBmb3IgdGhlIGZvcm0gZmllbGQgb2JqZWN0Lg0KCSAqIEBwYXJhbSAgIG1peGVkICAgICAgICAgICAgICAkdmFsdWUgICAgVGhlIGZvcm0gZmllbGQgdmFsdWUgdG8gdmFsaWRhdGUuDQoJICogQHBhcmFtICAgc3RyaW5nICAgICAgICAgICAgICRncm91cCAgICBUaGUgZmllbGQgbmFtZSBncm91cCBjb250cm9sIHZhbHVlLiBUaGlzIGFjdHMgYXMgYW4gYXJyYXkgY29udGFpbmVyIGZvciB0aGUgZmllbGQuDQoJICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGb3IgZXhhbXBsZSBpZiB0aGUgZmllbGQgaGFzIG5hbWU9ImZvbyIgYW5kIHRoZSBncm91cCB2YWx1ZSBpcyBzZXQgdG8gImJhciIgdGhlbiB0aGUNCgkgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bGwgZmllbGQgbmFtZSB3b3VsZCBlbmQgdXAgYmVpbmcgImJhcltmb29dIi4NCgkgKiBAcGFyYW0gICBSZWdpc3RyeSAgICAgICAgICAgJGlucHV0ICAgIEFuIG9wdGlvbmFsIFJlZ2lzdHJ5IG9iamVjdCB3aXRoIHRoZSBlbnRpcmUgZGF0YSBzZXQgdG8gdmFsaWRhdGUgYWdhaW5zdCB0aGUgZW50aXJlIGZvcm0uDQoJICogQHBhcmFtICAgRm9ybSAgICAgICAgICAgICAgICRmb3JtICAgICBUaGUgZm9ybSBvYmplY3QgZm9yIHdoaWNoIHRoZSBmaWVsZCBpcyBiZWluZyB0ZXN0ZWQuDQoJICoNCgkgKiBAcmV0dXJuICBib29sZWFuICBUcnVlIGlmIHRoZSB2YWx1ZSBpcyB2YWxpZCwgZmFsc2Ugb3RoZXJ3aXNlLg0KCSAqDQoJICogQHNpbmNlICAgMTEuMQ0KCSAqLw0KCXB1YmxpYyBmdW5jdGlvbiB0ZXN0KFxTaW1wbGVYTUxFbGVtZW50ICRlbGVtZW50LCAkdmFsdWUsICRncm91cCA9IG51bGwsIFJlZ2lzdHJ5ICRpbnB1dCA9IG51bGwsIEZvcm0gJGZvcm0gPSBudWxsKQ0KCXsNCgkJLy8gR2V0IHRoZSBkYXRhYmFzZSBvYmplY3QgYW5kIGEgbmV3IHF1ZXJ5IG9iamVjdC4NCgkJJGRiID0gXEpGYWN0b3J5OjpnZXREYm8oKTsNCgkJJHF1ZXJ5ID0gJGRiLT5nZXRRdWVyeSh0cnVlKTsNCg0KCQkvLyBHZXQgdGhlIGV4dHJhIGZpZWxkIGNoZWNrIGF0dHJpYnV0ZS4NCgkJJGlkID0gKCRpbnB1dCBpbnN0YW5jZW9mIFJlZ2lzdHJ5KSA/ICRpbnB1dC0+Z2V0KCdpZCcsIG51bGwpIDogbnVsbDsNCg0KCQkvLyBnZXQgdGhlIGNvbXBvbmVudCAmIHRhYmxlIG5hbWUNCgkJJHRhYmxlID0gKCRmb3JtIGluc3RhbmNlb2YgRm9ybSkgPyAkZm9ybS0+Z2V0TmFtZSgpIDogJyc7DQoNCgkJLy8gZ2V0IHRoZSBjb2x1bW4gbmFtZQ0KCQkkbmFtZSA9IChhcnJheSkgJGVsZW1lbnQtPmF0dHJpYnV0ZXMoKS0+eyduYW1lJ307DQoJCSRjb2x1bW4gPSAoc3RyaW5nKSB0cmltKCRuYW1lWzBdKTsNCgkJDQoJCS8vIGNoZWNrIHRoYXQgd2UgaGF2ZSBhIHZhbHVlDQoJCWlmIChzdHJsZW4oJHRhYmxlKSA+IDMgJiYgc3RycG9zKCR0YWJsZSwgJ1tbW2NvbXBvbmVudF1dXS4nKSAhPT0gZmFsc2UpDQoJCXsNCgkJCS8vIG5vdyBnZXQgdGhlIHRhYmxlIG5hbWUNCgkJCSR0YWJsZUFycmF5ID0gZXhwbG9kZSgnLicsICR0YWJsZSk7DQoJCQkvLyBkbyB3ZSBoYXZlIHR3byB2YWx1ZXMNCgkJCWlmIChjb3VudCggKGFycmF5KSAkdGFibGVBcnJheSkgPT0gMikNCgkJCXsNCgkJCQkvLyBCdWlsZCB0aGUgcXVlcnkuDQoJCQkJJHF1ZXJ5LT5zZWxlY3QoJ0NPVU5UKCopJykNCgkJCQkJLT5mcm9tKCcjX19bW1tjb21wb25lbnRdXV1fJyAuIChzdHJpbmcpICR0YWJsZUFycmF5WzFdKQ0KCQkJCQktPndoZXJlKCRkYi0+cXVvdGVOYW1lKCRjb2x1bW4pIC4gJyA9ICcgLiAkZGItPnF1b3RlKCR2YWx1ZSkpOw0KDQoJCQkJLy8gcmVtb3ZlIHRoaXMgaXRlbSBmcm9tIHRoZSBsaXN0DQoJCQkJaWYgKCRpZCA+IDApDQoJCQkJew0KCQkJCQkkcXVlcnktPndoZXJlKCRkYi0+cXVvdGVOYW1lKCdpZCcpIC4gJyA8PiAnIC4gKGludCkgJGlkKTsNCgkJCQl9DQoNCgkJCQkvLyBTZXQgYW5kIHF1ZXJ5IHRoZSBkYXRhYmFzZS4NCgkJCQkkZGItPnNldFF1ZXJ5KCRxdWVyeSk7DQoJCQkJJGR1cGxpY2F0ZSA9IChib29sKSAkZGItPmxvYWRSZXN1bHQoKTsNCg0KCQkJCWlmICgkZHVwbGljYXRlKQ0KCQkJCXsNCgkJCQkJcmV0dXJuIGZhbHNlOw0KCQkJCX0NCgkJCX0NCgkJfQ0KDQoJCXJldHVybiB0cnVlOw0KCX0=', 'unique field value', 1, '2018-07-21 06:06:42'), -(4, 'memberloginname', 'CS8qKg0KCSAqIE1ldGhvZCB0byB0ZXN0IHRoZSB1c2VybmFtZSBmb3IgdW5pcXVlbmVzcy4NCgkgKg0KCSAqIEBwYXJhbSAgIFxTaW1wbGVYTUxFbGVtZW50ICAkZWxlbWVudCAgVGhlIFNpbXBsZVhNTEVsZW1lbnQgb2JqZWN0IHJlcHJlc2VudGluZyB0aGUgYDxmaWVsZD5gIHRhZyBmb3IgdGhlIGZvcm0gZmllbGQgb2JqZWN0Lg0KCSAqIEBwYXJhbSAgIG1peGVkICAgICAgICAgICAgICAkdmFsdWUgICAgVGhlIGZvcm0gZmllbGQgdmFsdWUgdG8gdmFsaWRhdGUuDQoJICogQHBhcmFtICAgc3RyaW5nICAgICAgICAgICAgICRncm91cCAgICBUaGUgZmllbGQgbmFtZSBncm91cCBjb250cm9sIHZhbHVlLiBUaGlzIGFjdHMgYXMgYW4gYXJyYXkgY29udGFpbmVyIGZvciB0aGUgZmllbGQuDQoJICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGb3IgZXhhbXBsZSBpZiB0aGUgZmllbGQgaGFzIG5hbWU9ImZvbyIgYW5kIHRoZSBncm91cCB2YWx1ZSBpcyBzZXQgdG8gImJhciIgdGhlbiB0aGUNCgkgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bGwgZmllbGQgbmFtZSB3b3VsZCBlbmQgdXAgYmVpbmcgImJhcltmb29dIi4NCgkgKiBAcGFyYW0gICBSZWdpc3RyeSAgICAgICAgICAgJGlucHV0ICAgIEFuIG9wdGlvbmFsIFJlZ2lzdHJ5IG9iamVjdCB3aXRoIHRoZSBlbnRpcmUgZGF0YSBzZXQgdG8gdmFsaWRhdGUgYWdhaW5zdCB0aGUgZW50aXJlIGZvcm0uDQoJICogQHBhcmFtICAgRm9ybSAgICAgICAgICAgICAgICRmb3JtICAgICBUaGUgZm9ybSBvYmplY3QgZm9yIHdoaWNoIHRoZSBmaWVsZCBpcyBiZWluZyB0ZXN0ZWQuDQoJICoNCgkgKiBAcmV0dXJuICBib29sZWFuICBUcnVlIGlmIHRoZSB2YWx1ZSBpcyB2YWxpZCwgZmFsc2Ugb3RoZXJ3aXNlLg0KCSAqDQoJICogQHNpbmNlICAgMTEuMQ0KCSAqLw0KCXB1YmxpYyBmdW5jdGlvbiB0ZXN0KFxTaW1wbGVYTUxFbGVtZW50ICRlbGVtZW50LCAkdmFsdWUsICRncm91cCA9IG51bGwsIFJlZ2lzdHJ5ICRpbnB1dCA9IG51bGwsIEZvcm0gJGZvcm0gPSBudWxsKQ0KCXsNCgkJLy8gR2V0IHRoZSBkYXRhYmFzZSBvYmplY3QgYW5kIGEgbmV3IHF1ZXJ5IG9iamVjdC4NCgkJJGRiID0gXEpGYWN0b3J5OjpnZXREYm8oKTsNCgkJJHF1ZXJ5ID0gJGRiLT5nZXRRdWVyeSh0cnVlKTsNCg0KCQkvLyBCdWlsZCB0aGUgcXVlcnkuDQoJCSRxdWVyeS0+c2VsZWN0KCdDT1VOVCgqKScpDQoJCQktPmZyb20oJyNfX3VzZXJzJykNCgkJCS0+d2hlcmUoJ3VzZXJuYW1lID0gJyAuICRkYi0+cXVvdGUoJHZhbHVlKSk7DQoNCgkJLy8gR2V0IHRoZSB1c2VyIElEIGlmIHNldC4NCgkJJHVzZXJJZCA9ICgkZm9ybSBpbnN0YW5jZW9mIEZvcm0gJiYgKCR1c2VySWQgPSAkZm9ybS0+Z2V0VmFsdWUoJ3VzZXInKSkpID8gJHVzZXJJZCA6ICgoJGlucHV0IGluc3RhbmNlb2YgUmVnaXN0cnkgJiYgKCR1c2VySWQgPSAkaW5wdXQtPmdldCgndXNlcicpKSkgPyAkdXNlcklkIDogJycpOw0KCQkkcXVlcnktPndoZXJlKCRkYi0+cXVvdGVOYW1lKCdpZCcpIC4gJyA8PiAnIC4gKGludCkgJHVzZXJJZCk7DQoNCgkJLy8gU2V0IGFuZCBxdWVyeSB0aGUgZGF0YWJhc2UuDQoJCSRkYi0+c2V0UXVlcnkoJHF1ZXJ5KTsNCgkJJGR1cGxpY2F0ZSA9IChib29sKSAkZGItPmxvYWRSZXN1bHQoKTsNCg0KCQlpZiAoJGR1cGxpY2F0ZSkNCgkJew0KCQkJcmV0dXJuIGZhbHNlOw0KCQl9DQoNCgkJcmV0dXJuIHRydWU7DQoJfQ==', 'Validate the member username', 1, '2018-09-16 00:42:59'), -(5, 'memberuseremail', 'CS8qKg0KCSAqIFRoZSByZWd1bGFyIGV4cHJlc3Npb24gdG8gdXNlIGluIHRlc3RpbmcgYSBmb3JtIGZpZWxkIHZhbHVlLg0KCSAqDQoJICogQHZhciAgICBzdHJpbmcNCgkgKiBAc2luY2UgIDExLjENCgkgKiBAbGluayAgIGh0dHA6Ly93d3cudzMub3JnL1RSL2h0bWwtbWFya3VwL2lucHV0LmVtYWlsLmh0bWwNCgkgKi8NCglwcm90ZWN0ZWQgJHJlZ2V4ID0gIl5bYS16QS1aMC05LiEjJCUmJyorLz0/Xl9ge3x9fi1dK0BbYS16QS1aMC05LV0rKD86XC5bYS16QS1aMC05LV0rKSokIjsNCg0KCS8qKg0KCSAqIE1ldGhvZCB0byB0ZXN0IHRoZSBlbWFpbCBhZGRyZXNzIGFuZCBvcHRpb25hbGx5IGNoZWNrIGZvciB1bmlxdWVuZXNzLg0KCSAqDQoJICogQHBhcmFtICAgXFNpbXBsZVhNTEVsZW1lbnQgICRlbGVtZW50ICBUaGUgU2ltcGxlWE1MRWxlbWVudCBvYmplY3QgcmVwcmVzZW50aW5nIHRoZSBgPGZpZWxkPmAgdGFnIGZvciB0aGUgZm9ybSBmaWVsZCBvYmplY3QuDQoJICogQHBhcmFtICAgbWl4ZWQgICAgICAgICAgICAgICR2YWx1ZSAgICBUaGUgZm9ybSBmaWVsZCB2YWx1ZSB0byB2YWxpZGF0ZS4NCgkgKiBAcGFyYW0gICBzdHJpbmcgICAgICAgICAgICAgJGdyb3VwICAgIFRoZSBmaWVsZCBuYW1lIGdyb3VwIGNvbnRyb2wgdmFsdWUuIFRoaXMgYWN0cyBhcyBhbiBhcnJheSBjb250YWluZXIgZm9yIHRoZSBmaWVsZC4NCgkgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZvciBleGFtcGxlIGlmIHRoZSBmaWVsZCBoYXMgbmFtZT0iZm9vIiBhbmQgdGhlIGdyb3VwIHZhbHVlIGlzIHNldCB0byAiYmFyIiB0aGVuIHRoZQ0KCSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVsbCBmaWVsZCBuYW1lIHdvdWxkIGVuZCB1cCBiZWluZyAiYmFyW2Zvb10iLg0KCSAqIEBwYXJhbSAgIFJlZ2lzdHJ5ICAgICAgICAgICAkaW5wdXQgICAgQW4gb3B0aW9uYWwgUmVnaXN0cnkgb2JqZWN0IHdpdGggdGhlIGVudGlyZSBkYXRhIHNldCB0byB2YWxpZGF0ZSBhZ2FpbnN0IHRoZSBlbnRpcmUgZm9ybS4NCgkgKiBAcGFyYW0gICBGb3JtICAgICAgICAgICAgICAgJGZvcm0gICAgIFRoZSBmb3JtIG9iamVjdCBmb3Igd2hpY2ggdGhlIGZpZWxkIGlzIGJlaW5nIHRlc3RlZC4NCgkgKg0KCSAqIEByZXR1cm4gIGJvb2xlYW4gIFRydWUgaWYgdGhlIHZhbHVlIGlzIHZhbGlkLCBmYWxzZSBvdGhlcndpc2UuDQoJICoNCgkgKiBAc2luY2UgICAxMS4xDQoJICovDQoJcHVibGljIGZ1bmN0aW9uIHRlc3QoXFNpbXBsZVhNTEVsZW1lbnQgJGVsZW1lbnQsICR2YWx1ZSwgJGdyb3VwID0gbnVsbCwgUmVnaXN0cnkgJGlucHV0ID0gbnVsbCwgRm9ybSAkZm9ybSA9IG51bGwpDQoJew0KCQkvLyBJZiB0aGUgZmllbGQgaXMgZW1wdHkgYW5kIG5vdCByZXF1aXJlZCwgdGhlIGZpZWxkIGlzIHZhbGlkLg0KCQkkcmVxdWlyZWQgPSAoKHN0cmluZykgJGVsZW1lbnRbJ3JlcXVpcmVkJ10gPT0gJ3RydWUnIHx8IChzdHJpbmcpICRlbGVtZW50WydyZXF1aXJlZCddID09ICdyZXF1aXJlZCcpOw0KDQoJCWlmICghJHJlcXVpcmVkICYmIGVtcHR5KCR2YWx1ZSkpDQoJCXsNCgkJCXJldHVybiB0cnVlOw0KCQl9DQoNCgkJLy8gSWYgdGhlIHRsZCBhdHRyaWJ1dGUgaXMgcHJlc2VudCwgY2hhbmdlIHRoZSByZWd1bGFyIGV4cHJlc3Npb24gdG8gcmVxdWlyZSBhdCBsZWFzdCAyIGNoYXJhY3RlcnMgZm9yIGl0Lg0KCQkkdGxkID0gKChzdHJpbmcpICRlbGVtZW50Wyd0bGQnXSA9PSAndGxkJyB8fCAoc3RyaW5nKSAkZWxlbWVudFsndGxkJ10gPT0gJ3JlcXVpcmVkJyk7DQoNCgkJaWYgKCR0bGQpDQoJCXsNCgkJCSR0aGlzLT5yZWdleCA9ICJeW2EtekEtWjAtOS4hIyQlJicqKy89P15fYHt8fX4tXStAW2EtekEtWjAtOV0oPzpbYS16QS1aMC05LV17MCw2MX1bYS16QS1aMC05XSkiDQoJCQkJLiAnPyg/OlwuW2EtekEtWjAtOV0oPzpbYS16QS1aMC05LV17MCw2MX1bYS16QS1aMC05XSk/KSskJzsNCgkJfQ0KDQoJCS8vIERldGVybWluZSBpZiB0aGUgbXVsdGlwbGUgYXR0cmlidXRlIGlzIHByZXNlbnQNCgkJJG11bHRpcGxlID0gKChzdHJpbmcpICRlbGVtZW50WydtdWx0aXBsZSddID09ICd0cnVlJyB8fCAoc3RyaW5nKSAkZWxlbWVudFsnbXVsdGlwbGUnXSA9PSAnbXVsdGlwbGUnKTsNCg0KCQlpZiAoISRtdWx0aXBsZSkNCgkJew0KCQkJLy8gSGFuZGxlIGlkbiBlbWFpbCBhZGRyZXNzZXMgYnkgY29udmVydGluZyB0byBwdW55Y29kZS4NCgkJCSR2YWx1ZSA9IFxKU3RyaW5nUHVueWNvZGU6OmVtYWlsVG9QdW55Y29kZSgkdmFsdWUpOw0KDQoJCQkvLyBUZXN0IHRoZSB2YWx1ZSBhZ2FpbnN0IHRoZSByZWd1bGFyIGV4cHJlc3Npb24uDQoJCQlpZiAoIXBhcmVudDo6dGVzdCgkZWxlbWVudCwgJHZhbHVlLCAkZ3JvdXAsICRpbnB1dCwgJGZvcm0pKQ0KCQkJew0KCQkJCXJldHVybiBmYWxzZTsNCgkJCX0NCgkJfQ0KCQllbHNlDQoJCXsNCgkJCSR2YWx1ZXMgPSBleHBsb2RlKCcsJywgJHZhbHVlKTsNCg0KCQkJZm9yZWFjaCAoJHZhbHVlcyBhcyAkdmFsdWUpDQoJCQl7DQoJCQkJLy8gSGFuZGxlIGlkbiBlbWFpbCBhZGRyZXNzZXMgYnkgY29udmVydGluZyB0byBwdW55Y29kZS4NCgkJCQkkdmFsdWUgPSBcSlN0cmluZ1B1bnljb2RlOjplbWFpbFRvUHVueWNvZGUoJHZhbHVlKTsNCg0KCQkJCS8vIFRlc3QgdGhlIHZhbHVlIGFnYWluc3QgdGhlIHJlZ3VsYXIgZXhwcmVzc2lvbi4NCgkJCQlpZiAoIXBhcmVudDo6dGVzdCgkZWxlbWVudCwgJHZhbHVlLCAkZ3JvdXAsICRpbnB1dCwgJGZvcm0pKQ0KCQkJCXsNCgkJCQkJcmV0dXJuIGZhbHNlOw0KCQkJCX0NCgkJCX0NCgkJfQ0KDQoJCS8vIENoZWNrIGlmIHdlIHNob3VsZCB0ZXN0IGZvciB1bmlxdWVuZXNzLiBUaGlzIG9ubHkgY2FuIGJlIHVzZWQgaWYgbXVsdGlwbGUgaXMgbm90IHRydWUNCgkJJHVuaXF1ZSA9ICgoc3RyaW5nKSAkZWxlbWVudFsndW5pcXVlJ10gPT0gJ3RydWUnIHx8IChzdHJpbmcpICRlbGVtZW50Wyd1bmlxdWUnXSA9PSAndW5pcXVlJyk7DQoNCgkJaWYgKCR1bmlxdWUgJiYgISRtdWx0aXBsZSkNCgkJew0KCQkJLy8gR2V0IHRoZSBkYXRhYmFzZSBvYmplY3QgYW5kIGEgbmV3IHF1ZXJ5IG9iamVjdC4NCgkJCSRkYiA9IFxKRmFjdG9yeTo6Z2V0RGJvKCk7DQoJCQkkcXVlcnkgPSAkZGItPmdldFF1ZXJ5KHRydWUpOw0KDQoJCQkvLyBCdWlsZCB0aGUgcXVlcnkuDQoJCQkkcXVlcnktPnNlbGVjdCgnQ09VTlQoKiknKQ0KCQkJCS0+ZnJvbSgnI19fdXNlcnMnKQ0KCQkJCS0+d2hlcmUoJ2VtYWlsID0gJyAuICRkYi0+cXVvdGUoJHZhbHVlKSk7DQoNCgkJCS8vIEdldCB0aGUgZXh0cmEgZmllbGQgY2hlY2sgYXR0cmlidXRlLg0KCQkJJHVzZXJJZCA9ICgkZm9ybSBpbnN0YW5jZW9mIEZvcm0gJiYgKCR1c2VySWQgPSAkZm9ybS0+Z2V0VmFsdWUoJ3VzZXInKSkpID8gJHVzZXJJZCA6ICgoJGlucHV0IGluc3RhbmNlb2YgUmVnaXN0cnkgJiYgKCR1c2VySWQgPSAkaW5wdXQtPmdldCgndXNlcicpKSkgPyAkdXNlcklkIDogJycpOw0KCQkJJHF1ZXJ5LT53aGVyZSgkZGItPnF1b3RlTmFtZSgnaWQnKSAuICcgPD4gJyAuIChpbnQpICR1c2VySWQpOw0KDQoJCQkvLyBTZXQgYW5kIHF1ZXJ5IHRoZSBkYXRhYmFzZS4NCgkJCSRkYi0+c2V0UXVlcnkoJHF1ZXJ5KTsNCgkJCSRkdXBsaWNhdGUgPSAoYm9vbCkgJGRiLT5sb2FkUmVzdWx0KCk7DQoNCgkJCWlmICgkZHVwbGljYXRlKQ0KCQkJew0KCQkJCXJldHVybiBmYWxzZTsNCgkJCX0NCgkJfQ0KDQoJCXJldHVybiB0cnVlOw0KCX0=', 'Validate the member useremail', 1, '2018-09-16 00:43:44'), +(4, 'memberloginname', 'CS8qKg0KCSAqIE1ldGhvZCB0byB0ZXN0IHRoZSB1c2VybmFtZSBmb3IgdW5pcXVlbmVzcy4NCgkgKg0KCSAqIEBwYXJhbSAgIFxTaW1wbGVYTUxFbGVtZW50ICAkZWxlbWVudCAgVGhlIFNpbXBsZVhNTEVsZW1lbnQgb2JqZWN0IHJlcHJlc2VudGluZyB0aGUgYDxmaWVsZD5gIHRhZyBmb3IgdGhlIGZvcm0gZmllbGQgb2JqZWN0Lg0KCSAqIEBwYXJhbSAgIG1peGVkICAgICAgICAgICAgICAkdmFsdWUgICAgVGhlIGZvcm0gZmllbGQgdmFsdWUgdG8gdmFsaWRhdGUuDQoJICogQHBhcmFtICAgc3RyaW5nICAgICAgICAgICAgICRncm91cCAgICBUaGUgZmllbGQgbmFtZSBncm91cCBjb250cm9sIHZhbHVlLiBUaGlzIGFjdHMgYXMgYW4gYXJyYXkgY29udGFpbmVyIGZvciB0aGUgZmllbGQuDQoJICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGb3IgZXhhbXBsZSBpZiB0aGUgZmllbGQgaGFzIG5hbWU9ImZvbyIgYW5kIHRoZSBncm91cCB2YWx1ZSBpcyBzZXQgdG8gImJhciIgdGhlbiB0aGUNCgkgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bGwgZmllbGQgbmFtZSB3b3VsZCBlbmQgdXAgYmVpbmcgImJhcltmb29dIi4NCgkgKiBAcGFyYW0gICBSZWdpc3RyeSAgICAgICAgICAgJGlucHV0ICAgIEFuIG9wdGlvbmFsIFJlZ2lzdHJ5IG9iamVjdCB3aXRoIHRoZSBlbnRpcmUgZGF0YSBzZXQgdG8gdmFsaWRhdGUgYWdhaW5zdCB0aGUgZW50aXJlIGZvcm0uDQoJICogQHBhcmFtICAgRm9ybSAgICAgICAgICAgICAgICRmb3JtICAgICBUaGUgZm9ybSBvYmplY3QgZm9yIHdoaWNoIHRoZSBmaWVsZCBpcyBiZWluZyB0ZXN0ZWQuDQoJICoNCgkgKiBAcmV0dXJuICBib29sZWFuICBUcnVlIGlmIHRoZSB2YWx1ZSBpcyB2YWxpZCwgZmFsc2Ugb3RoZXJ3aXNlLg0KCSAqDQoJICogQHNpbmNlICAgMTEuMQ0KCSAqLw0KCXB1YmxpYyBmdW5jdGlvbiB0ZXN0KFxTaW1wbGVYTUxFbGVtZW50ICRlbGVtZW50LCAkdmFsdWUsICRncm91cCA9IG51bGwsIFJlZ2lzdHJ5ICRpbnB1dCA9IG51bGwsIEZvcm0gJGZvcm0gPSBudWxsKQ0KCXsNCgkJLy8gR2V0IHRoZSBkYXRhYmFzZSBvYmplY3QgYW5kIGEgbmV3IHF1ZXJ5IG9iamVjdC4NCgkJJGRiID0gXEpGYWN0b3J5OjpnZXREYm8oKTsNCgkJJHF1ZXJ5ID0gJGRiLT5nZXRRdWVyeSh0cnVlKTsNCg0KCQkvLyBCdWlsZCB0aGUgcXVlcnkuDQoJCSRxdWVyeS0+c2VsZWN0KCdDT1VOVCgqKScpDQoJCQktPmZyb20oJyNfX3VzZXJzJykNCgkJCS0+d2hlcmUoJ3VzZXJuYW1lID0gJyAuICRkYi0+cXVvdGUoJHZhbHVlKSk7DQoNCgkJLy8gR2V0IHRoZSB1c2VyIElEIGlmIHNldC4NCgkJJHVzZXJJZCA9ICgkZm9ybSBpbnN0YW5jZW9mIEZvcm0gJiYgKCR1c2VySWQgPSAkZm9ybS0+Z2V0VmFsdWUoJ3VzZXInKSkpID8gJHVzZXJJZCA6ICgoJGlucHV0IGluc3RhbmNlb2YgUmVnaXN0cnkgJiYgKCR1c2VySWQgPSAkaW5wdXQtPmdldCgndXNlcicpKSkgPyAkdXNlcklkIDogMCk7DQoJCS8vIGlmIHN0aWxsIG5vdCB1c2VyIGlzIGZvdW5kIGdldCBtZW1iZXIgaWQNCgkJaWYgKCR1c2VySWQgPT0gMCkNCgkJew0KCQkJJG1lbWJlcklkID0gKCRmb3JtIGluc3RhbmNlb2YgRm9ybSAmJiAoJG1lbWJlcklkID0gJGZvcm0tPmdldFZhbHVlKCdpZCcpKSkgPyAkbWVtYmVySWQgOiAoKCRpbnB1dCBpbnN0YW5jZW9mIFJlZ2lzdHJ5ICYmICgkbWVtYmVySWQgPSAkaW5wdXQtPmdldCgnaWQnKSkpID8gJG1lbWJlcklkIDogMCk7DQoJCX0NCgkJLy8gZ2V0IGFjY291bnQgdHlwZSBpZiBuZWVkZWQNCgkJaWYgKCR1c2VySWQgPT0gMCAmJiAkbWVtYmVySWQgPiAwKQ0KCQl7DQoJCQkkYWNjb3VudElkID0gKCRmb3JtIGluc3RhbmNlb2YgRm9ybSAmJiAoJGFjY291bnRJZCA9ICRmb3JtLT5nZXRWYWx1ZSgnYWNjb3VudCcpKSkgPyAkYWNjb3VudElkIDogKCgkaW5wdXQgaW5zdGFuY2VvZiBSZWdpc3RyeSAmJiAoJGFjY291bnRJZCA9ICRpbnB1dC0+Z2V0KCdhY2NvdW50JykpKSA/ICRhY2NvdW50SWQgOiAwKTsNCgkJCS8vIG1ha2Ugc3VyZSB0aGVzZSBhY2NvdW50IGlzIHNldA0KCQkJaWYgKCRhY2NvdW50SWQgPT0gMCkNCgkJCXsNCgkJCQkkYWNjb3VudElkID0gW1tbQ29tcG9uZW50XV1dSGVscGVyOjpnZXRWYXIoJ21lbWJlcicsICRtZW1iZXJJZCwgJ2lkJywgJ2FjY291bnQnKTsNCgkJCX0NCgkJfQ0KCQkvLyBnZXQgdXNlciB2YWx1ZSBpZiBub3Qgc2V0IChkdWUgdG8gcGVybWlzc2lvbnMpDQoJCWlmICgkdXNlcklkID09IDAgJiYgJG1lbWJlcklkID4gMCAmJiAkYWNjb3VudElkID4gMCAmJiAoMSA9PSAkYWNjb3VudElkIHx8IDQgPT0gJGFjY291bnRJZCkpDQoJCXsNCgkJCSR1c2VySWQgPSBbW1tDb21wb25lbnRdXV1IZWxwZXI6OmdldFZhcignbWVtYmVyJywgJG1lbWJlcklkLCAnaWQnLCAndXNlcicpOw0KCQl9DQoJCSRxdWVyeS0+d2hlcmUoJGRiLT5xdW90ZU5hbWUoJ2lkJykgLiAnIDw+ICcgLiAoaW50KSAkdXNlcklkKTsNCg0KCQkvLyBTZXQgYW5kIHF1ZXJ5IHRoZSBkYXRhYmFzZS4NCgkJJGRiLT5zZXRRdWVyeSgkcXVlcnkpOw0KCQkkZHVwbGljYXRlID0gKGJvb2wpICRkYi0+bG9hZFJlc3VsdCgpOw0KDQoJCWlmICgkZHVwbGljYXRlKQ0KCQl7DQoJCQlyZXR1cm4gZmFsc2U7DQoJCX0NCg0KCQlyZXR1cm4gdHJ1ZTsNCgl9', 'Validate the member username', 1, '2018-09-16 00:42:59'), +(5, 'memberuseremail', 'CS8qKg0KCSAqIFRoZSByZWd1bGFyIGV4cHJlc3Npb24gdG8gdXNlIGluIHRlc3RpbmcgYSBmb3JtIGZpZWxkIHZhbHVlLg0KCSAqDQoJICogQHZhciAgICBzdHJpbmcNCgkgKiBAc2luY2UgIDExLjENCgkgKiBAbGluayAgIGh0dHA6Ly93d3cudzMub3JnL1RSL2h0bWwtbWFya3VwL2lucHV0LmVtYWlsLmh0bWwNCgkgKi8NCglwcm90ZWN0ZWQgJHJlZ2V4ID0gIl5bYS16QS1aMC05LiEjJCUmJyorLz0/Xl9ge3x9fi1dK0BbYS16QS1aMC05LV0rKD86XC5bYS16QS1aMC05LV0rKSokIjsNCg0KCS8qKg0KCSAqIE1ldGhvZCB0byB0ZXN0IHRoZSBlbWFpbCBhZGRyZXNzIGFuZCBvcHRpb25hbGx5IGNoZWNrIGZvciB1bmlxdWVuZXNzLg0KCSAqDQoJICogQHBhcmFtICAgXFNpbXBsZVhNTEVsZW1lbnQgICRlbGVtZW50ICBUaGUgU2ltcGxlWE1MRWxlbWVudCBvYmplY3QgcmVwcmVzZW50aW5nIHRoZSBgPGZpZWxkPmAgdGFnIGZvciB0aGUgZm9ybSBmaWVsZCBvYmplY3QuDQoJICogQHBhcmFtICAgbWl4ZWQgICAgICAgICAgICAgICR2YWx1ZSAgICBUaGUgZm9ybSBmaWVsZCB2YWx1ZSB0byB2YWxpZGF0ZS4NCgkgKiBAcGFyYW0gICBzdHJpbmcgICAgICAgICAgICAgJGdyb3VwICAgIFRoZSBmaWVsZCBuYW1lIGdyb3VwIGNvbnRyb2wgdmFsdWUuIFRoaXMgYWN0cyBhcyBhbiBhcnJheSBjb250YWluZXIgZm9yIHRoZSBmaWVsZC4NCgkgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZvciBleGFtcGxlIGlmIHRoZSBmaWVsZCBoYXMgbmFtZT0iZm9vIiBhbmQgdGhlIGdyb3VwIHZhbHVlIGlzIHNldCB0byAiYmFyIiB0aGVuIHRoZQ0KCSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVsbCBmaWVsZCBuYW1lIHdvdWxkIGVuZCB1cCBiZWluZyAiYmFyW2Zvb10iLg0KCSAqIEBwYXJhbSAgIFJlZ2lzdHJ5ICAgICAgICAgICAkaW5wdXQgICAgQW4gb3B0aW9uYWwgUmVnaXN0cnkgb2JqZWN0IHdpdGggdGhlIGVudGlyZSBkYXRhIHNldCB0byB2YWxpZGF0ZSBhZ2FpbnN0IHRoZSBlbnRpcmUgZm9ybS4NCgkgKiBAcGFyYW0gICBGb3JtICAgICAgICAgICAgICAgJGZvcm0gICAgIFRoZSBmb3JtIG9iamVjdCBmb3Igd2hpY2ggdGhlIGZpZWxkIGlzIGJlaW5nIHRlc3RlZC4NCgkgKg0KCSAqIEByZXR1cm4gIGJvb2xlYW4gIFRydWUgaWYgdGhlIHZhbHVlIGlzIHZhbGlkLCBmYWxzZSBvdGhlcndpc2UuDQoJICoNCgkgKiBAc2luY2UgICAxMS4xDQoJICovDQoJcHVibGljIGZ1bmN0aW9uIHRlc3QoXFNpbXBsZVhNTEVsZW1lbnQgJGVsZW1lbnQsICR2YWx1ZSwgJGdyb3VwID0gbnVsbCwgUmVnaXN0cnkgJGlucHV0ID0gbnVsbCwgRm9ybSAkZm9ybSA9IG51bGwpDQoJew0KCQkvLyBJZiB0aGUgZmllbGQgaXMgZW1wdHkgYW5kIG5vdCByZXF1aXJlZCwgdGhlIGZpZWxkIGlzIHZhbGlkLg0KCQkkcmVxdWlyZWQgPSAoKHN0cmluZykgJGVsZW1lbnRbJ3JlcXVpcmVkJ10gPT0gJ3RydWUnIHx8IChzdHJpbmcpICRlbGVtZW50WydyZXF1aXJlZCddID09ICdyZXF1aXJlZCcpOw0KDQoJCWlmICghJHJlcXVpcmVkICYmIGVtcHR5KCR2YWx1ZSkpDQoJCXsNCgkJCXJldHVybiB0cnVlOw0KCQl9DQoNCgkJLy8gSWYgdGhlIHRsZCBhdHRyaWJ1dGUgaXMgcHJlc2VudCwgY2hhbmdlIHRoZSByZWd1bGFyIGV4cHJlc3Npb24gdG8gcmVxdWlyZSBhdCBsZWFzdCAyIGNoYXJhY3RlcnMgZm9yIGl0Lg0KCQkkdGxkID0gKChzdHJpbmcpICRlbGVtZW50Wyd0bGQnXSA9PSAndGxkJyB8fCAoc3RyaW5nKSAkZWxlbWVudFsndGxkJ10gPT0gJ3JlcXVpcmVkJyk7DQoNCgkJaWYgKCR0bGQpDQoJCXsNCgkJCSR0aGlzLT5yZWdleCA9ICJeW2EtekEtWjAtOS4hIyQlJicqKy89P15fYHt8fX4tXStAW2EtekEtWjAtOV0oPzpbYS16QS1aMC05LV17MCw2MX1bYS16QS1aMC05XSkiDQoJCQkJLiAnPyg/OlwuW2EtekEtWjAtOV0oPzpbYS16QS1aMC05LV17MCw2MX1bYS16QS1aMC05XSk/KSskJzsNCgkJfQ0KDQoJCS8vIERldGVybWluZSBpZiB0aGUgbXVsdGlwbGUgYXR0cmlidXRlIGlzIHByZXNlbnQNCgkJJG11bHRpcGxlID0gKChzdHJpbmcpICRlbGVtZW50WydtdWx0aXBsZSddID09ICd0cnVlJyB8fCAoc3RyaW5nKSAkZWxlbWVudFsnbXVsdGlwbGUnXSA9PSAnbXVsdGlwbGUnKTsNCg0KCQlpZiAoISRtdWx0aXBsZSkNCgkJew0KCQkJLy8gSGFuZGxlIGlkbiBlbWFpbCBhZGRyZXNzZXMgYnkgY29udmVydGluZyB0byBwdW55Y29kZS4NCgkJCSR2YWx1ZSA9IFxKU3RyaW5nUHVueWNvZGU6OmVtYWlsVG9QdW55Y29kZSgkdmFsdWUpOw0KDQoJCQkvLyBUZXN0IHRoZSB2YWx1ZSBhZ2FpbnN0IHRoZSByZWd1bGFyIGV4cHJlc3Npb24uDQoJCQlpZiAoIXBhcmVudDo6dGVzdCgkZWxlbWVudCwgJHZhbHVlLCAkZ3JvdXAsICRpbnB1dCwgJGZvcm0pKQ0KCQkJew0KCQkJCXJldHVybiBmYWxzZTsNCgkJCX0NCgkJfQ0KCQllbHNlDQoJCXsNCgkJCSR2YWx1ZXMgPSBleHBsb2RlKCcsJywgJHZhbHVlKTsNCg0KCQkJZm9yZWFjaCAoJHZhbHVlcyBhcyAkdmFsdWUpDQoJCQl7DQoJCQkJLy8gSGFuZGxlIGlkbiBlbWFpbCBhZGRyZXNzZXMgYnkgY29udmVydGluZyB0byBwdW55Y29kZS4NCgkJCQkkdmFsdWUgPSBcSlN0cmluZ1B1bnljb2RlOjplbWFpbFRvUHVueWNvZGUoJHZhbHVlKTsNCg0KCQkJCS8vIFRlc3QgdGhlIHZhbHVlIGFnYWluc3QgdGhlIHJlZ3VsYXIgZXhwcmVzc2lvbi4NCgkJCQlpZiAoIXBhcmVudDo6dGVzdCgkZWxlbWVudCwgJHZhbHVlLCAkZ3JvdXAsICRpbnB1dCwgJGZvcm0pKQ0KCQkJCXsNCgkJCQkJcmV0dXJuIGZhbHNlOw0KCQkJCX0NCgkJCX0NCgkJfQ0KDQoJCS8vIENoZWNrIGlmIHdlIHNob3VsZCB0ZXN0IGZvciB1bmlxdWVuZXNzLiBUaGlzIG9ubHkgY2FuIGJlIHVzZWQgaWYgbXVsdGlwbGUgaXMgbm90IHRydWUNCgkJJHVuaXF1ZSA9ICgoc3RyaW5nKSAkZWxlbWVudFsndW5pcXVlJ10gPT0gJ3RydWUnIHx8IChzdHJpbmcpICRlbGVtZW50Wyd1bmlxdWUnXSA9PSAndW5pcXVlJyk7DQoNCgkJaWYgKCR1bmlxdWUgJiYgISRtdWx0aXBsZSkNCgkJew0KCQkJLy8gR2V0IHRoZSBkYXRhYmFzZSBvYmplY3QgYW5kIGEgbmV3IHF1ZXJ5IG9iamVjdC4NCgkJCSRkYiA9IFxKRmFjdG9yeTo6Z2V0RGJvKCk7DQoJCQkkcXVlcnkgPSAkZGItPmdldFF1ZXJ5KHRydWUpOw0KDQoJCQkvLyBCdWlsZCB0aGUgcXVlcnkuDQoJCQkkcXVlcnktPnNlbGVjdCgnQ09VTlQoKiknKQ0KCQkJCS0+ZnJvbSgnI19fdXNlcnMnKQ0KCQkJCS0+d2hlcmUoJ2VtYWlsID0gJyAuICRkYi0+cXVvdGUoJHZhbHVlKSk7DQoNCgkJCS8vIEdldCB0aGUgdXNlciBJRCBpZiBzZXQuDQoJCQkkdXNlcklkID0gKCRmb3JtIGluc3RhbmNlb2YgRm9ybSAmJiAoJHVzZXJJZCA9ICRmb3JtLT5nZXRWYWx1ZSgndXNlcicpKSkgPyAkdXNlcklkIDogKCgkaW5wdXQgaW5zdGFuY2VvZiBSZWdpc3RyeSAmJiAoJHVzZXJJZCA9ICRpbnB1dC0+Z2V0KCd1c2VyJykpKSA/ICR1c2VySWQgOiAwKTsNCgkJCS8vIGlmIHN0aWxsIG5vdCB1c2VyIGlzIGZvdW5kIGdldCBtZW1iZXIgaWQNCgkJCWlmICgkdXNlcklkID09IDApDQoJCQl7DQoJCQkJJG1lbWJlcklkID0gKCRmb3JtIGluc3RhbmNlb2YgRm9ybSAmJiAoJG1lbWJlcklkID0gJGZvcm0tPmdldFZhbHVlKCdpZCcpKSkgPyAkbWVtYmVySWQgOiAoKCRpbnB1dCBpbnN0YW5jZW9mIFJlZ2lzdHJ5ICYmICgkbWVtYmVySWQgPSAkaW5wdXQtPmdldCgnaWQnKSkpID8gJG1lbWJlcklkIDogMCk7DQoJCQl9DQoJCQkvLyBnZXQgYWNjb3VudCB0eXBlIGlmIG5lZWRlZA0KCQkJaWYgKCR1c2VySWQgPT0gMCAmJiAkbWVtYmVySWQgPiAwKQ0KCQkJew0KCQkJCSRhY2NvdW50SWQgPSAoJGZvcm0gaW5zdGFuY2VvZiBGb3JtICYmICgkYWNjb3VudElkID0gJGZvcm0tPmdldFZhbHVlKCdhY2NvdW50JykpKSA/ICRhY2NvdW50SWQgOiAoKCRpbnB1dCBpbnN0YW5jZW9mIFJlZ2lzdHJ5ICYmICgkYWNjb3VudElkID0gJGlucHV0LT5nZXQoJ2FjY291bnQnKSkpID8gJGFjY291bnRJZCA6IDApOw0KCQkJCS8vIG1ha2Ugc3VyZSB0aGVzZSBhY2NvdW50IGlzIHNldA0KCQkJCWlmICgkYWNjb3VudElkID09IDApDQoJCQkJew0KCQkJCQkkYWNjb3VudElkID0gW1tbQ29tcG9uZW50XV1dSGVscGVyOjpnZXRWYXIoJ21lbWJlcicsICRtZW1iZXJJZCwgJ2lkJywgJ2FjY291bnQnKTsNCgkJCQl9DQoJCQl9DQoJCQkvLyBnZXQgdXNlciB2YWx1ZSBpZiBub3Qgc2V0IChkdWUgdG8gcGVybWlzc2lvbnMpDQoJCQlpZiAoJHVzZXJJZCA9PSAwICYmICRtZW1iZXJJZCA+IDAgJiYgJGFjY291bnRJZCA+IDAgJiYgKDEgPT0gJGFjY291bnRJZCB8fCA0ID09ICRhY2NvdW50SWQpKQ0KCQkJew0KCQkJCSR1c2VySWQgPSBbW1tDb21wb25lbnRdXV1IZWxwZXI6OmdldFZhcignbWVtYmVyJywgJG1lbWJlcklkLCAnaWQnLCAndXNlcicpOw0KCQkJfQ0KCQkJJHF1ZXJ5LT53aGVyZSgkZGItPnF1b3RlTmFtZSgnaWQnKSAuICcgPD4gJyAuIChpbnQpICR1c2VySWQpOw0KDQoJCQkvLyBTZXQgYW5kIHF1ZXJ5IHRoZSBkYXRhYmFzZS4NCgkJCSRkYi0+c2V0UXVlcnkoJHF1ZXJ5KTsNCgkJCSRkdXBsaWNhdGUgPSAoYm9vbCkgJGRiLT5sb2FkUmVzdWx0KCk7DQoNCgkJCWlmICgkZHVwbGljYXRlKQ0KCQkJew0KCQkJCXJldHVybiBmYWxzZTsNCgkJCX0NCgkJfQ0KDQoJCXJldHVybiB0cnVlOw0KCX0=', 'Validate the member useremail', 1, '2018-09-16 00:43:44'), (6, 'iban', 'CS8qKg0KCSogTWV0aG9kIHRvIGNoZWNrIGlmIElCQU4gaXMgdmFsaWQuDQoJKg0KCSogQHBhcmFtICAgXFNpbXBsZVhNTEVsZW1lbnQgICRlbGVtZW50ICBUaGUgU2ltcGxlWE1MRWxlbWVudCBvYmplY3QgcmVwcmVzZW50aW5nIHRoZSBgPGZpZWxkPmAgdGFnIGZvciB0aGUgZm9ybSBmaWVsZCBvYmplY3QuDQoJKiBAcGFyYW0gICBtaXhlZCAgICAgICAgICAgICAgJHZhbHVlICAgIFRoZSBmb3JtIGZpZWxkIHZhbHVlIHRvIHZhbGlkYXRlLg0KCSogQHBhcmFtICAgc3RyaW5nICAgICAgICAgICAgICRncm91cCAgICBUaGUgZmllbGQgbmFtZSBncm91cCBjb250cm9sIHZhbHVlLiBUaGlzIGFjdHMgYXMgYW4gYXJyYXkgY29udGFpbmVyIGZvciB0aGUgZmllbGQuDQoJKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZvciBleGFtcGxlIGlmIHRoZSBmaWVsZCBoYXMgbmFtZT0iZm9vIiBhbmQgdGhlIGdyb3VwIHZhbHVlIGlzIHNldCB0byAiYmFyIiB0aGVuIHRoZQ0KCSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdWxsIGZpZWxkIG5hbWUgd291bGQgZW5kIHVwIGJlaW5nICJiYXJbZm9vXSIuDQoJKiBAcGFyYW0gICBSZWdpc3RyeSAgICAgICAgICAgJGlucHV0ICAgIEFuIG9wdGlvbmFsIFJlZ2lzdHJ5IG9iamVjdCB3aXRoIHRoZSBlbnRpcmUgZGF0YSBzZXQgdG8gdmFsaWRhdGUgYWdhaW5zdCB0aGUgZW50aXJlIGZvcm0uDQoJKiBAcGFyYW0gICBGb3JtICAgICAgICAgICAgICAgJGZvcm0gICAgIFRoZSBmb3JtIG9iamVjdCBmb3Igd2hpY2ggdGhlIGZpZWxkIGlzIGJlaW5nIHRlc3RlZC4NCgkqDQoJKiBAcmV0dXJuICBib29sZWFuICBUcnVlIGlmIHRoZSB2YWx1ZSBpcyB2YWxpZCwgZmFsc2Ugb3RoZXJ3aXNlLg0KCSoNCgkqIEBzaW5jZSAgIDMuOS4wDQoJKi8NCglwdWJsaWMgZnVuY3Rpb24gdGVzdChcU2ltcGxlWE1MRWxlbWVudCAkZWxlbWVudCwgJHZhbHVlLCAkZ3JvdXAgPSBudWxsLCBSZWdpc3RyeSAkaW5wdXQgPSBudWxsLCBGb3JtICRmb3JtID0gbnVsbCkNCgl7DQoJCSRjb3VudHJ5Q29kZU9mZnNldCA9IDA7IC8vIENPVU5UUllfQ09ERV9PRkZTRVQNCgkJJGNvdW50cnlDb2RlTGVuZ3RoID0gMjsgLy9DT1VOVFJZX0NPREVfTEVOR1RIDQoJCSRjaGVja3N1bU9mZnNldCA9IDI7IC8vQ0hFQ0tTVU1fT0ZGU0VUDQoJCSRjaGVja3N1bUxlbmd0aCA9IDI7IC8vQ0hFQ0tTVU1fTEVOR1RIDQoJCSRpbnN0aXR1dGVJZGVudGlmaWNhdGlvbk9mZnNldCA9IDQ7IC8vSU5TVElUVVRFX0lERU5USUZJQ0FUSU9OX09GRlNFVA0KDQoJCS8qKg0KCQkqIEB2YXIgYXJyYXkgQ291bnRyeSBjb2RlIHRvIHNpemUsIHJlZ2V4IGZvcm1hdCBmb3IgZWFjaCBjb3VudHJ5IHRoYXQgc3VwcG9ydHMgSUJBTg0KCQkqLw0KCQkkaWJhbkZvcm1hdE1hcCA9IGFycmF5KA0KCQkJJ0FBJyA9PiBhcnJheSgxMiwgJ15bQS1aMC05XXsxMn0kJyksDQoJCQknQUQnID0+IGFycmF5KDIwLCAnXlswLTldezR9WzAtOV17NH1bQS1aMC05XXsxMn0kJyksDQoJCQknQUUnID0+IGFycmF5KDE5LCAnXlswLTldezN9WzAtOV17MTZ9JCcpLA0KCQkJJ0FMJyA9PiBhcnJheSgyNCwgJ15bMC05XXs4fVtBLVowLTldezE2fSQnKSwNCgkJCSdBTycgPT4gYXJyYXkoMjEsICdeWzAtOV17MjF9JCcpLA0KCQkJJ0FUJyA9PiBhcnJheSgxNiwgJ15bMC05XXs1fVswLTldezExfSQnKSwNCgkJCSdBWCcgPT4gYXJyYXkoMTQsICdeWzAtOV17Nn1bMC05XXs3fVswLTldezF9JCcpLA0KCQkJJ0FaJyA9PiBhcnJheSgyNCwgJ15bQS1aXXs0fVtBLVowLTldezIwfSQnKSwNCgkJCSdCQScgPT4gYXJyYXkoMTYsICdeWzAtOV17M31bMC05XXszfVswLTldezh9WzAtOV17Mn0kJyksDQoJCQknQkUnID0+IGFycmF5KDEyLCAnXlswLTldezN9WzAtOV17N31bMC05XXsyfSQnKSwNCgkJCSdCRicgPT4gYXJyYXkoMjMsICdeWzAtOV17MjN9JCcpLA0KCQkJJ0JHJyA9PiBhcnJheSgxOCwgJ15bQS1aXXs0fVswLTldezR9WzAtOV17Mn1bQS1aMC05XXs4fSQnKSwNCgkJCSdCSCcgPT4gYXJyYXkoMTgsICdeW0EtWl17NH1bQS1aMC05XXsxNH0kJyksDQoJCQknQkknID0+IGFycmF5KDEyLCAnXlswLTldezEyfSQnKSwNCgkJCSdCSicgPT4gYXJyYXkoMjQsICdeW0EtWl17MX1bMC05XXsyM30kJyksDQoJCQknQkwnID0+IGFycmF5KDIzLCAnXlswLTldezV9WzAtOV17NX1bQS1aMC05XXsxMX1bMC05XXsyfSQnKSwNCgkJCSdCUicgPT4gYXJyYXkoMjUsICdeWzAtOV17OH1bMC05XXs1fVswLTldezEwfVtBLVpdezF9W0EtWjAtOV17MX0kJyksDQoJCQknQ0gnID0+IGFycmF5KDE3LCAnXlswLTldezV9W0EtWjAtOV17MTJ9JCcpLA0KCQkJJ0NJJyA9PiBhcnJheSgyNCwgJ15bQS1aXXsxfVswLTldezIzfSQnKSwNCgkJCSdDTScgPT4gYXJyYXkoMjMsICdeWzAtOV17MjN9JCcpLA0KCQkJJ0NSJyA9PiBhcnJheSgxNywgJ15bMC05XXs0fVswLTldezEzfSQnKSwNCgkJCSdDVicgPT4gYXJyYXkoMjEsICdeWzAtOV17MjF9JCcpLA0KCQkJJ0NZJyA9PiBhcnJheSgyNCwgJ15bMC05XXszfVswLTldezV9W0EtWjAtOV17MTZ9JCcpLA0KCQkJJ0NaJyA9PiBhcnJheSgyMCwgJ15bMC05XXs0fVswLTldezZ9WzAtOV17MTB9JCcpLA0KCQkJJ0RFJyA9PiBhcnJheSgxOCwgJ15bMC05XXs4fVswLTldezEwfSQnKSwNCgkJCSdESycgPT4gYXJyYXkoMTQsICdeWzAtOV17NH1bMC05XXs5fVswLTldezF9JCcpLA0KCQkJJ0RPJyA9PiBhcnJheSgyNCwgJ15bQS1aMC05XXs0fVswLTldezIwfSQnKSwNCgkJCSdEWicgPT4gYXJyYXkoMjAsICdeWzAtOV17MjB9JCcpLA0KCQkJJ0VFJyA9PiBhcnJheSgxNiwgJ15bMC05XXsyfVswLTldezJ9WzAtOV17MTF9WzAtOV17MX0kJyksDQoJCQknRVMnID0+IGFycmF5KDIwLCAnXlswLTldezR9WzAtOV17NH1bMC05XXsxfVswLTldezF9WzAtOV17MTB9JCcpLA0KCQkJJ0ZJJyA9PiBhcnJheSgxNCwgJ15bMC05XXs2fVswLTldezd9WzAtOV17MX0kJyksDQoJCQknRk8nID0+IGFycmF5KDE0LCAnXlswLTldezR9WzAtOV17OX1bMC05XXsxfSQnKSwNCgkJCSdGUicgPT4gYXJyYXkoMjMsICdeWzAtOV17NX1bMC05XXs1fVtBLVowLTldezExfVswLTldezJ9JCcpLA0KCQkJJ0dCJyA9PiBhcnJheSgxOCwgJ15bQS1aXXs0fVswLTldezZ9WzAtOV17OH0kJyksDQoJCQknR0UnID0+IGFycmF5KDE4LCAnXltBLVpdezJ9WzAtOV17MTZ9JCcpLA0KCQkJJ0dGJyA9PiBhcnJheSgyMywgJ15bMC05XXs1fVswLTldezV9W0EtWjAtOV17MTF9WzAtOV17Mn0kJyksDQoJCQknR0knID0+IGFycmF5KDE5LCAnXltBLVpdezR9W0EtWjAtOV17MTV9JCcpLA0KCQkJJ0dMJyA9PiBhcnJheSgxNCwgJ15bMC05XXs0fVswLTldezl9WzAtOV17MX0kJyksDQoJCQknR1AnID0+IGFycmF5KDIzLCAnXlswLTldezV9WzAtOV17NX1bQS1aMC05XXsxMX1bMC05XXsyfSQnKSwNCgkJCSdHUicgPT4gYXJyYXkoMjMsICdeWzAtOV17M31bMC05XXs0fVtBLVowLTldezE2fSQnKSwNCgkJCSdHVCcgPT4gYXJyYXkoMjQsICdeW0EtWjAtOV17NH1bQS1aMC05XXsyMH0kJyksDQoJCQknSFInID0+IGFycmF5KDE3LCAnXlswLTldezd9WzAtOV17MTB9JCcpLA0KCQkJJ0hVJyA9PiBhcnJheSgyNCwgJ15bMC05XXszfVswLTldezR9WzAtOV17MX1bMC05XXsxNX1bMC05XXsxfSQnKSwNCgkJCSdJRScgPT4gYXJyYXkoMTgsICdeW0EtWl17NH1bMC05XXs2fVswLTldezh9JCcpLA0KCQkJJ0lMJyA9PiBhcnJheSgxOSwgJ15bMC05XXszfVswLTldezN9WzAtOV17MTN9JCcpLA0KCQkJJ0lSJyA9PiBhcnJheSgyMiwgJ15bMC05XXsyMn0kJyksDQoJCQknSVMnID0+IGFycmF5KDIyLCAnXlswLTldezR9WzAtOV17Mn1bMC05XXs2fVswLTldezEwfSQnKSwNCgkJCSdJVCcgPT4gYXJyYXkoMjMsICdeW0EtWl17MX1bMC05XXs1fVswLTldezV9W0EtWjAtOV17MTJ9JCcpLA0KCQkJJ0pPJyA9PiBhcnJheSgyNiwgJ15bQS1aXXs0fVswLTldezR9W0EtWjAtOV17MTh9JCcpLA0KCQkJJ0tXJyA9PiBhcnJheSgyNiwgJ15bQS1aXXs0fVtBLVowLTldezIyfSQnKSwNCgkJCSdLWicgPT4gYXJyYXkoMTYsICdeWzAtOV17M31bQS1aMC05XXsxM30kJyksDQoJCQknTEInID0+IGFycmF5KDI0LCAnXlswLTldezR9W0EtWjAtOV17MjB9JCcpLA0KCQkJJ0xDJyA9PiBhcnJheSgyOCwgJ15bQS1aXXs0fVtBLVowLTldezI0fSQnKSwNCgkJCSdMSScgPT4gYXJyYXkoMTcsICdeWzAtOV17NX1bQS1aMC05XXsxMn0kJyksDQoJCQknTFQnID0+IGFycmF5KDE2LCAnXlswLTldezV9WzAtOV17MTF9JCcpLA0KCQkJJ0xVJyA9PiBhcnJheSgxNiwgJ15bMC05XXszfVtBLVowLTldezEzfSQnKSwNCgkJCSdMVicgPT4gYXJyYXkoMTcsICdeW0EtWl17NH1bQS1aMC05XXsxM30kJyksDQoJCQknTUMnID0+IGFycmF5KDIzLCAnXlswLTldezV9WzAtOV17NX1bQS1aMC05XXsxMX1bMC05XXsyfSQnKSwNCgkJCSdNRCcgPT4gYXJyYXkoMjAsICdeW0EtWjAtOV17Mn1bQS1aMC05XXsxOH0kJyksDQoJCQknTUUnID0+IGFycmF5KDE4LCAnXlswLTldezN9WzAtOV17MTN9WzAtOV17Mn0kJyksDQoJCQknTUYnID0+IGFycmF5KDIzLCAnXlswLTldezV9WzAtOV17NX1bQS1aMC05XXsxMX1bMC05XXsyfSQnKSwNCgkJCSdNRycgPT4gYXJyYXkoMjMsICdeWzAtOV17MjN9JCcpLA0KCQkJJ01LJyA9PiBhcnJheSgxNSwgJ15bMC05XXszfVtBLVowLTldezEwfVswLTldezJ9JCcpLA0KCQkJJ01MJyA9PiBhcnJheSgyNCwgJ15bQS1aXXsxfVswLTldezIzfSQnKSwNCgkJCSdNUScgPT4gYXJyYXkoMjMsICdeWzAtOV17NX1bMC05XXs1fVtBLVowLTldezExfVswLTldezJ9JCcpLA0KCQkJJ01SJyA9PiBhcnJheSgyMywgJ15bMC05XXs1fVswLTldezV9WzAtOV17MTF9WzAtOV17Mn0kJyksDQoJCQknTVQnID0+IGFycmF5KDI3LCAnXltBLVpdezR9WzAtOV17NX1bQS1aMC05XXsxOH0kJyksDQoJCQknTVUnID0+IGFycmF5KDI2LCAnXltBLVpdezR9WzAtOV17Mn1bMC05XXsyfVswLTldezEyfVswLTldezN9W0EtWl17M30kJyksDQoJCQknTVonID0+IGFycmF5KDIxLCAnXlswLTldezIxfSQnKSwNCgkJCSdOQycgPT4gYXJyYXkoMjMsICdeWzAtOV17NX1bMC05XXs1fVtBLVowLTldezExfVswLTldezJ9JCcpLA0KCQkJJ05MJyA9PiBhcnJheSgxNCwgJ15bQS1aXXs0fVswLTldezEwfSQnKSwNCgkJCSdOTycgPT4gYXJyYXkoMTEsICdeWzAtOV17NH1bMC05XXs2fVswLTldezF9JCcpLA0KCQkJJ1BGJyA9PiBhcnJheSgyMywgJ15bMC05XXs1fVswLTldezV9W0EtWjAtOV17MTF9WzAtOV17Mn0kJyksDQoJCQknUEsnID0+IGFycmF5KDIwLCAnXltBLVpdezR9W0EtWjAtOV17MTZ9JCcpLA0KCQkJJ1BMJyA9PiBhcnJheSgyNCwgJ15bMC05XXs4fVswLTldezE2fSQnKSwNCgkJCSdQTScgPT4gYXJyYXkoMjMsICdeWzAtOV17NX1bMC05XXs1fVtBLVowLTldezExfVswLTldezJ9JCcpLA0KCQkJJ1BTJyA9PiBhcnJheSgyNSwgJ15bQS1aXXs0fVtBLVowLTldezIxfSQnKSwNCgkJCSdQVCcgPT4gYXJyYXkoMjEsICdeWzAtOV17NH1bMC05XXs0fVswLTldezExfVswLTldezJ9JCcpLA0KCQkJJ1FBJyA9PiBhcnJheSgyNSwgJ15bQS1aXXs0fVswLTldezR9W0EtWjAtOV17MTd9JCcpLA0KCQkJJ1JFJyA9PiBhcnJheSgyMywgJ15bMC05XXs1fVswLTldezV9W0EtWjAtOV17MTF9WzAtOV17Mn0kJyksDQoJCQknUk8nID0+IGFycmF5KDIwLCAnXltBLVpdezR9W0EtWjAtOV17MTZ9JCcpLA0KCQkJJ1JTJyA9PiBhcnJheSgxOCwgJ15bMC05XXszfVswLTldezEzfVswLTldezJ9JCcpLA0KCQkJJ1NBJyA9PiBhcnJheSgyMCwgJ15bMC05XXsyfVtBLVowLTldezE4fSQnKSwNCgkJCSdTQycgPT4gYXJyYXkoMjcsICdeW0EtWl17NH1bMC05XXs0fVswLTldezE2fVtBLVpdezN9JCcpLA0KCQkJJ1NFJyA9PiBhcnJheSgyMCwgJ15bMC05XXszfVswLTldezE2fVswLTldezF9JCcpLA0KCQkJJ1NJJyA9PiBhcnJheSgxNSwgJ15bMC05XXs1fVswLTldezh9WzAtOV17Mn0kJyksDQoJCQknU0snID0+IGFycmF5KDIwLCAnXlswLTldezR9WzAtOV17Nn1bMC05XXsxMH0kJyksDQoJCQknU00nID0+IGFycmF5KDIzLCAnXltBLVpdezF9WzAtOV17NX1bMC05XXs1fVtBLVowLTldezEyfSQnKSwNCgkJCSdTTicgPT4gYXJyYXkoMjQsICdeW0EtWl17MX1bMC05XXsyM30kJyksDQoJCQknU1QnID0+IGFycmF5KDIxLCAnXlswLTldezh9WzAtOV17MTF9WzAtOV17Mn0kJyksDQoJCQknVEYnID0+IGFycmF5KDIzLCAnXlswLTldezV9WzAtOV17NX1bQS1aMC05XXsxMX1bMC05XXsyfSQnKSwNCgkJCSdUTCcgPT4gYXJyYXkoMTksICdeWzAtOV17M31bMC05XXsxNH1bMC05XXsyfSQnKSwNCgkJCSdUTicgPT4gYXJyYXkoMjAsICdeWzAtOV17Mn1bMC05XXszfVswLTldezEzfVswLTldezJ9JCcpLA0KCQkJJ1RSJyA9PiBhcnJheSgyMiwgJ15bMC05XXs1fVswLTldezF9W0EtWjAtOV17MTZ9JCcpLA0KCQkJJ1VBJyA9PiBhcnJheSgyNSwgJ15bMC05XXs2fVtBLVowLTldezE5fSQnKSwNCgkJCSdWRycgPT4gYXJyYXkoMjAsICdeW0EtWl17NH1bMC05XXsxNn0kJyksDQoJCQknV0YnID0+IGFycmF5KDIzLCAnXlswLTldezV9WzAtOV17NX1bQS1aMC05XXsxMX1bMC05XXsyfSQnKSwNCgkJCSdYSycgPT4gYXJyYXkoMTYsICdeWzAtOV17NH1bMC05XXsxMH1bMC05XXsyfSQnKSwNCgkJCSdZVCcgPT4gYXJyYXkoMjMsICdeWzAtOV17NX1bMC05XXs1fVtBLVowLTldezExfVswLTldezJ9JCcpDQoJCSk7DQoNCgkJLy8gQ0xFQU4gVVAgSUJBTg0KCQkkaWJhbiA9IHByZWdfcmVwbGFjZSgnL1teYS16MC05XSsvaScsICcnLCB0cmltKHN0cnRvdXBwZXIoJHZhbHVlKSkpOw0KDQoJCS8vIENIRUNLIENvdW50cnkgQ29kZQ0KCQkkY291bnRyeUNvZGUgPSBzdWJzdHIoJGliYW4sICRjb3VudHJ5Q29kZU9mZnNldCwgJGNvdW50cnlDb2RlTGVuZ3RoKTsNCgkJJGlzQ291bnRyeUNvZGVWYWxpZCA9ICEoaXNzZXQoJGliYW5Gb3JtYXRNYXBbJGNvdW50cnlDb2RlXSkgPT09IGZhbHNlKTsNCg0KCQkkdmFsaWRMZW5ndGggPSAkY291bnRyeUNvZGVMZW5ndGggKyAkY2hlY2tzdW1MZW5ndGggKyAkaWJhbkZvcm1hdE1hcFskY291bnRyeUNvZGVdWzBdOw0KCQkkaXNMZW5ndGhWYWxpZCA9IHN0cmxlbigkaWJhbikgPT09ICR2YWxpZExlbmd0aDsNCg0KCQkkYWNjb3VudElkZW50aWZpY2F0aW9uID0gc3Vic3RyKCRpYmFuLCAkaW5zdGl0dXRlSWRlbnRpZmljYXRpb25PZmZzZXQpOw0KCQkkaXNGb3JtYXRWYWxpZCA9ICEocHJlZ19tYXRjaCgnLycgLiAkaWJhbkZvcm1hdE1hcFskY291bnRyeUNvZGVdWzFdIC4gJy8nLCAkYWNjb3VudElkZW50aWZpY2F0aW9uKSAhPT0gMSk7DQoNCgkJJGNoZWNrc3VtID0gc3Vic3RyKCRpYmFuLCAkY2hlY2tzdW1PZmZzZXQsICRjaGVja3N1bUxlbmd0aCk7DQoJCSRhY2NvdW50SWRlbnRpZmljYXRpb24gPSBzdWJzdHIoJGliYW4sICRpbnN0aXR1dGVJZGVudGlmaWNhdGlvbk9mZnNldCk7DQoNCgkJLy8gR0VUIE5VTUVSSUMgQ09VTlRSWSBDT0RFDQoJCSRudW1lcmljUmVwcmVzZW50YXRpb24gPSAnJzsNCgkJJGxldHRlclJlcHJlc2VudGF0aW9uID0gJGNvdW50cnlDb2RlOw0KCQlmb3JlYWNoIChzdHJfc3BsaXQoJGxldHRlclJlcHJlc2VudGF0aW9uKSBhcyAkY2hhcikNCgkJew0KCQkJJG9yZCA9IG9yZCgkY2hhcik7DQoJCQlpZiAoJG9yZCA+PSA2NSAmJiAkb3JkIDw9IDkwKQ0KCQkJew0KCQkJCSRudW1lcmljUmVwcmVzZW50YXRpb24gLj0gKHN0cmluZykgKCRvcmQgLSA1NSk7DQoJCQl9DQoJCQllbHNlaWYgKCRvcmQgPj0gNDggJiYgJG9yZCA8PSA1NykNCgkJCXsNCgkJCQkkbnVtZXJpY1JlcHJlc2VudGF0aW9uIC49IChzdHJpbmcpICgkb3JkIC0gNDgpOw0KCQkJfQ0KCQl9DQoJCSRudW1lcmljQ291bnRyeUNvZGUgPSAkbnVtZXJpY1JlcHJlc2VudGF0aW9uOw0KDQoJCSRudW1lcmljUmVwcmVzZW50YXRpb24gPSAnJzsNCgkJJGxldHRlclJlcHJlc2VudGF0aW9uID0gJGFjY291bnRJZGVudGlmaWNhdGlvbjsNCgkJZm9yZWFjaCAoc3RyX3NwbGl0KCRsZXR0ZXJSZXByZXNlbnRhdGlvbikgYXMgJGNoYXIpDQoJCXsNCgkJCSRvcmQgPSBvcmQoJGNoYXIpOw0KCQkJaWYgKCRvcmQgPj0gNjUgJiYgJG9yZCA8PSA5MCkNCgkJCXsNCgkJCQkkbnVtZXJpY1JlcHJlc2VudGF0aW9uIC49IChzdHJpbmcpICgkb3JkIC0gNTUpOw0KCQkJfQ0KCQkJZWxzZWlmICgkb3JkID49IDQ4ICYmICRvcmQgPD0gNTcpDQoJCQl7DQoJCQkJJG51bWVyaWNSZXByZXNlbnRhdGlvbiAuPSAoc3RyaW5nKSAoJG9yZCAtIDQ4KTsNCgkJCX0NCgkJfQ0KCQkkbnVtZXJpY0FjY291bnRJZGVudGlmaWNhdGlvbiA9ICRudW1lcmljUmVwcmVzZW50YXRpb247DQoJCSRpbnZlcnRlZEliYW4gPSAkbnVtZXJpY0FjY291bnRJZGVudGlmaWNhdGlvbiAuICRudW1lcmljQ291bnRyeUNvZGUgLiAkY2hlY2tzdW07DQoNCgkJLy8gQ0hFQ0tTVU0gQkNNT0QNCgkJJHggPSAkaW52ZXJ0ZWRJYmFuOw0KCQkkeSA9IDk3Ow0KCQlpZiAoIWZ1bmN0aW9uX2V4aXN0cygnYmNtb2QnKSkNCgkJew0KCQkJJHRha2UgPSA1Ow0KCQkJJG1vZCA9ICcnOw0KCQkJZG8gew0KCQkJCSRhID0gKGludCkkbW9kIC4gc3Vic3RyKCR4LCAwLCAkdGFrZSk7DQoJCQkJJHggPSBzdWJzdHIoJHgsICR0YWtlKTsNCgkJCQkkbW9kID0gJGEgJSAkeTsNCgkJCX0gd2hpbGUgKHN0cmxlbigkeCkpOw0KCQkJJGJjbW9kID0gKHN0cmluZykkbW9kOw0KCQl9DQoJCWVsc2UNCgkJew0KCQkJJGJjbW9kID0gYmNtb2QoJHgsICR5KTsNCgkJfQ0KDQoJCSRpc0NoZWNrc3VtVmFsaWQgPSAkYmNtb2QgPT09ICcxJzsNCg0KCQlpZiAoISRpc0NvdW50cnlDb2RlVmFsaWQgfHwgISRpc0xlbmd0aFZhbGlkIHx8ICEkaXNGb3JtYXRWYWxpZCB8fCAhJGlzQ2hlY2tzdW1WYWxpZCkNCgkJew0KCQkJcmV0dXJuIGZhbHNlOw0KCQl9DQoJCWVsc2UNCgkJew0KCQkgICAgcmV0dXJuIHRydWU7DQoJCX0NCgl9', 'IBAN validation', 1, '2019-02-12 23:14:43'); -- @@ -2294,7 +2295,7 @@ INSERT INTO `#__componentbuilder_component_admin_views` (`id`, `addadmin_views`, -- INSERT INTO `#__componentbuilder_component_site_views` (`id`, `addsite_views`, `joomla_component`, `published`, `created`, `modified`, `version`, `hits`, `ordering`) VALUES -(27, '{\"addsite_views0\":{\"siteview\":\"23\",\"menu\":\"1\",\"metadata\":\"1\",\"default_view\":\"1\",\"access\":\"1\",\"public_access\":\"1\"},\"addsite_views1\":{\"siteview\":\"25\",\"metadata\":\"1\",\"access\":\"1\",\"public_access\":\"1\"}}', 25, 1, '2017-10-28 03:56:26', '2018-04-15 16:22:24', 3, '', ''); +(27, '{\"addsite_views0\":{\"siteview\":\"23\",\"menu\":\"1\",\"metadata\":\"1\",\"default_view\":\"1\",\"access\":\"1\",\"public_access\":\"1\"},\"addsite_views1\":{\"siteview\":\"25\",\"metadata\":\"1\",\"access\":\"1\"}}', 25, 1, '2017-10-28 03:56:26', '2020-02-27 21:32:04', 4, '', ''); -- -- Dumping data for table `#__componentbuilder_component_custom_admin_views` diff --git a/admin/views/joomla_modules/tmpl/default_body.php b/admin/views/joomla_modules/tmpl/default_body.php index e941feef8..168f2ecfe 100644 --- a/admin/views/joomla_modules/tmpl/default_body.php +++ b/admin/views/joomla_modules/tmpl/default_body.php @@ -101,6 +101,9 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_modules&task=joomla_m + + target); ?> + escape($item->description); ?> diff --git a/admin/views/joomla_modules/tmpl/default_foot.php b/admin/views/joomla_modules/tmpl/default_foot.php index d2ec5dd2a..e2b7f794d 100644 --- a/admin/views/joomla_modules/tmpl/default_foot.php +++ b/admin/views/joomla_modules/tmpl/default_foot.php @@ -14,5 +14,5 @@ defined('_JEXEC') or die('Restricted access'); ?> - pagination->getListFooter(); ?> + pagination->getListFooter(); ?> \ No newline at end of file diff --git a/admin/views/joomla_modules/tmpl/default_head.php b/admin/views/joomla_modules/tmpl/default_head.php index e05683d52..0ca94b9c1 100644 --- a/admin/views/joomla_modules/tmpl/default_head.php +++ b/admin/views/joomla_modules/tmpl/default_head.php @@ -32,6 +32,9 @@ defined('_JEXEC') or die('Restricted access'); listDirn, $this->listOrder); ?> + + + listDirn, $this->listOrder); ?> diff --git a/admin/views/joomla_modules/view.html.php b/admin/views/joomla_modules/view.html.php index 498da050b..41b4dfee9 100644 --- a/admin/views/joomla_modules/view.html.php +++ b/admin/views/joomla_modules/view.html.php @@ -184,6 +184,36 @@ class ComponentbuilderViewJoomla_modules extends JViewLegacy 'batch[access]', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') ); + } + + // Set Target Selection + $this->targetOptions = $this->getTheTargetSelections(); + // We do some sanitation for Target filter + if (ComponentbuilderHelper::checkArray($this->targetOptions) && + isset($this->targetOptions[0]->value) && + !ComponentbuilderHelper::checkString($this->targetOptions[0]->value)) + { + unset($this->targetOptions[0]); + } + // Only load Target filter if it has values + if (ComponentbuilderHelper::checkArray($this->targetOptions)) + { + // Target Filter + JHtmlSidebar::addFilter( + '- Select '.JText::_('COM_COMPONENTBUILDER_JOOMLA_MODULE_TARGET_LABEL').' -', + 'filter_target', + JHtml::_('select.options', $this->targetOptions, 'value', 'text', $this->state->get('filter.target')) + ); + + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Target Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_JOOMLA_MODULE_TARGET_LABEL').' -', + 'batch[target]', + JHtml::_('select.options', $this->targetOptions, 'value', 'text') + ); + } } } @@ -234,5 +264,41 @@ class ComponentbuilderViewJoomla_modules extends JViewLegacy 'a.description' => JText::_('COM_COMPONENTBUILDER_JOOMLA_MODULE_DESCRIPTION_LABEL'), 'a.id' => JText::_('JGRID_HEADING_ID') ); + } + + protected function getTheTargetSelections() + { + // Get a db connection. + $db = JFactory::getDbo(); + + // Create a new query object. + $query = $db->getQuery(true); + + // Select the text. + $query->select($db->quoteName('target')); + $query->from($db->quoteName('#__componentbuilder_joomla_module')); + $query->order($db->quoteName('target') . ' 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 $target) + { + // Translate the target selection + $text = $model->selectionTranslation($target,'target'); + // Now add the target and its text to the options array + $_filter[] = JHtml::_('select.option', $target, JText::_($text)); + } + return $_filter; + } + return false; } } diff --git a/componentbuilder.xml b/componentbuilder.xml index eb0c3abdf..7f5327984 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,15 +1,15 @@ COM_COMPONENTBUILDER - 27th February, 2020 + 13th March, 2020 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - 2.10.11 + 2.10.12 Component Builder (v.2.10.11) +

Component Builder (v.2.10.12)

The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is 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 976efb168..f72ddbb73 100644 --- a/componentbuilder_update_server.xml +++ b/componentbuilder_update_server.xml @@ -934,4 +934,21 @@ http://www.joomlacomponentbuilder.com + + Component Builder + Builds Complex Joomla Components + com_componentbuilder + component + 2.10.12 + http://www.joomlacomponentbuilder.com + + http://domain.com/demo.zip + + + stable + + Llewellyn van der Merwe + http://www.joomlacomponentbuilder.com + + \ No newline at end of file diff --git a/script.php b/script.php index a6e132946..ff5c32189 100644 --- a/script.php +++ b/script.php @@ -5938,9 +5938,9 @@ class com_componentbuilderInstallerScript $joomla_module->type_title = 'Componentbuilder Joomla_module'; $joomla_module->type_alias = 'com_componentbuilder.joomla_module'; $joomla_module->table = '{"special": {"dbtable": "#__componentbuilder_joomla_module","key": "id","type": "Joomla_module","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $joomla_module->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "default","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": {"system_name":"system_name","description":"description","add_php_postflight_install":"add_php_postflight_install","add_php_preflight_uninstall":"add_php_preflight_uninstall","update_server":"update_server","update_server_target":"update_server_target","addreadme":"addreadme","add_sql":"add_sql","snippet":"snippet","libraries":"libraries","add_php_postflight_update":"add_php_postflight_update","add_php_method_uninstall":"add_php_method_uninstall","default":"default","add_sql_uninstall":"add_sql_uninstall","add_update_server":"add_update_server","not_required":"not_required","module_version":"module_version","sales_server":"sales_server","custom_get":"custom_get","php_preflight_update":"php_preflight_update","php_preflight_uninstall":"php_preflight_uninstall","mod_code":"mod_code","php_postflight_install":"php_postflight_install","add_class_helper":"add_class_helper","php_postflight_update":"php_postflight_update","add_class_helper_header":"add_class_helper_header","php_method_uninstall":"php_method_uninstall","class_helper_header":"class_helper_header","sql":"sql","class_helper_code":"class_helper_code","sql_uninstall":"sql_uninstall","readme":"readme","add_php_script_construct":"add_php_script_construct","update_server_url":"update_server_url","php_script_construct":"php_script_construct","add_php_preflight_install":"add_php_preflight_install","php_preflight_install":"php_preflight_install","add_sales_server":"add_sales_server","add_php_preflight_update":"add_php_preflight_update","guid":"guid","name":"name"}}'; + $joomla_module->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "default","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": {"system_name":"system_name","target":"target","description":"description","add_php_method_uninstall":"add_php_method_uninstall","add_php_postflight_update":"add_php_postflight_update","add_php_postflight_install":"add_php_postflight_install","add_php_preflight_uninstall":"add_php_preflight_uninstall","addreadme":"addreadme","not_required":"not_required","default":"default","snippet":"snippet","add_sql":"add_sql","update_server_target":"update_server_target","add_sql_uninstall":"add_sql_uninstall","update_server":"update_server","add_update_server":"add_update_server","libraries":"libraries","module_version":"module_version","sales_server":"sales_server","custom_get":"custom_get","php_preflight_update":"php_preflight_update","php_preflight_uninstall":"php_preflight_uninstall","mod_code":"mod_code","php_postflight_install":"php_postflight_install","add_class_helper":"add_class_helper","php_postflight_update":"php_postflight_update","add_class_helper_header":"add_class_helper_header","php_method_uninstall":"php_method_uninstall","class_helper_header":"class_helper_header","sql":"sql","class_helper_code":"class_helper_code","sql_uninstall":"sql_uninstall","readme":"readme","add_php_script_construct":"add_php_script_construct","update_server_url":"update_server_url","php_script_construct":"php_script_construct","add_php_preflight_install":"add_php_preflight_install","php_preflight_install":"php_preflight_install","add_sales_server":"add_sales_server","add_php_preflight_update":"add_php_preflight_update","guid":"guid","name":"name"}}'; $joomla_module->router = 'ComponentbuilderHelperRoute::getJoomla_moduleRoute'; - $joomla_module->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module.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","add_php_postflight_install","add_php_preflight_uninstall","update_server","update_server_target","addreadme","add_sql","snippet","add_php_postflight_update","add_php_method_uninstall","add_sql_uninstall","add_update_server","sales_server","add_class_helper","add_class_helper_header","add_php_script_construct","add_php_preflight_install","add_sales_server","add_php_preflight_update"],"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": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; + $joomla_module->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module.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","target","add_php_method_uninstall","add_php_postflight_update","add_php_postflight_install","add_php_preflight_uninstall","addreadme","snippet","add_sql","update_server_target","add_sql_uninstall","update_server","add_update_server","sales_server","add_class_helper","add_class_helper_header","add_php_script_construct","add_php_preflight_install","add_sales_server","add_php_preflight_update"],"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": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $joomla_module_Inserted = $db->insertObject('#__content_types', $joomla_module); @@ -7380,9 +7380,9 @@ class com_componentbuilderInstallerScript $joomla_module->type_title = 'Componentbuilder Joomla_module'; $joomla_module->type_alias = 'com_componentbuilder.joomla_module'; $joomla_module->table = '{"special": {"dbtable": "#__componentbuilder_joomla_module","key": "id","type": "Joomla_module","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $joomla_module->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "default","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": {"system_name":"system_name","description":"description","add_php_postflight_install":"add_php_postflight_install","add_php_preflight_uninstall":"add_php_preflight_uninstall","update_server":"update_server","update_server_target":"update_server_target","addreadme":"addreadme","add_sql":"add_sql","snippet":"snippet","libraries":"libraries","add_php_postflight_update":"add_php_postflight_update","add_php_method_uninstall":"add_php_method_uninstall","default":"default","add_sql_uninstall":"add_sql_uninstall","add_update_server":"add_update_server","not_required":"not_required","module_version":"module_version","sales_server":"sales_server","custom_get":"custom_get","php_preflight_update":"php_preflight_update","php_preflight_uninstall":"php_preflight_uninstall","mod_code":"mod_code","php_postflight_install":"php_postflight_install","add_class_helper":"add_class_helper","php_postflight_update":"php_postflight_update","add_class_helper_header":"add_class_helper_header","php_method_uninstall":"php_method_uninstall","class_helper_header":"class_helper_header","sql":"sql","class_helper_code":"class_helper_code","sql_uninstall":"sql_uninstall","readme":"readme","add_php_script_construct":"add_php_script_construct","update_server_url":"update_server_url","php_script_construct":"php_script_construct","add_php_preflight_install":"add_php_preflight_install","php_preflight_install":"php_preflight_install","add_sales_server":"add_sales_server","add_php_preflight_update":"add_php_preflight_update","guid":"guid","name":"name"}}'; + $joomla_module->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "default","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": {"system_name":"system_name","target":"target","description":"description","add_php_method_uninstall":"add_php_method_uninstall","add_php_postflight_update":"add_php_postflight_update","add_php_postflight_install":"add_php_postflight_install","add_php_preflight_uninstall":"add_php_preflight_uninstall","addreadme":"addreadme","not_required":"not_required","default":"default","snippet":"snippet","add_sql":"add_sql","update_server_target":"update_server_target","add_sql_uninstall":"add_sql_uninstall","update_server":"update_server","add_update_server":"add_update_server","libraries":"libraries","module_version":"module_version","sales_server":"sales_server","custom_get":"custom_get","php_preflight_update":"php_preflight_update","php_preflight_uninstall":"php_preflight_uninstall","mod_code":"mod_code","php_postflight_install":"php_postflight_install","add_class_helper":"add_class_helper","php_postflight_update":"php_postflight_update","add_class_helper_header":"add_class_helper_header","php_method_uninstall":"php_method_uninstall","class_helper_header":"class_helper_header","sql":"sql","class_helper_code":"class_helper_code","sql_uninstall":"sql_uninstall","readme":"readme","add_php_script_construct":"add_php_script_construct","update_server_url":"update_server_url","php_script_construct":"php_script_construct","add_php_preflight_install":"add_php_preflight_install","php_preflight_install":"php_preflight_install","add_sales_server":"add_sales_server","add_php_preflight_update":"add_php_preflight_update","guid":"guid","name":"name"}}'; $joomla_module->router = 'ComponentbuilderHelperRoute::getJoomla_moduleRoute'; - $joomla_module->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module.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","add_php_postflight_install","add_php_preflight_uninstall","update_server","update_server_target","addreadme","add_sql","snippet","add_php_postflight_update","add_php_method_uninstall","add_sql_uninstall","add_update_server","sales_server","add_class_helper","add_class_helper_header","add_php_script_construct","add_php_preflight_install","add_sales_server","add_php_preflight_update"],"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": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; + $joomla_module->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module.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","target","add_php_method_uninstall","add_php_postflight_update","add_php_postflight_install","add_php_preflight_uninstall","addreadme","snippet","add_sql","update_server_target","add_sql_uninstall","update_server","add_update_server","sales_server","add_class_helper","add_class_helper_header","add_php_script_construct","add_php_preflight_install","add_sales_server","add_php_preflight_update"],"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": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; // Check if joomla_module type is already in content_type DB. $joomla_module_id = null; @@ -9115,7 +9115,7 @@ class com_componentbuilderInstallerScript echo ' -

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

'; +

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

'; // Set db if not set already. if (!isset($db)) -- 2.40.1 From e051134a791d845e234f65d8d9483a8f6cb30996 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Tue, 24 Mar 2020 03:11:43 +0200 Subject: [PATCH 6/8] Fixed gh-534 so that the correct comment is made in the module area with the GUI placeholders. First steps towards adding multi languages for both modules and plugins gh-503 gh-493 in JCB. Other small improvments to the date helper methods. Add the otpion to target the admin area with modules. --- README.md | 14 +- admin/README.txt | 14 +- admin/config.xml | 2 +- admin/helpers/compiler/a_Get.php | 164 +++++++++------- admin/helpers/compiler/e_Interpretation.php | 7 +- admin/helpers/compiler/f_Infusion.php | 8 +- admin/helpers/componentbuilder.php | 82 ++++++-- .../en-GB/en-GB.com_componentbuilder.ini | 14 +- .../details_fullwidth.php | 4 +- admin/models/fields/excludedlanguages.php | 176 ++++++++++++++++++ admin/models/fields/lang.php | 62 +++--- admin/models/forms/language_translation.xml | 25 ++- admin/models/language_translation.php | 16 +- admin/models/language_translations.php | 100 ++-------- admin/sql/install.mysql.utf8.sql | 157 ++++++++-------- admin/sql/updates/mysql/2.10.11.sql | 1 + admin/sql/updates/mysql/2.10.12.sql | 3 + .../tmpl/default_body.php | 99 +++++++++- componentbuilder.xml | 6 +- componentbuilder_update_server.xml | 17 ++ script.php | 10 +- site/helpers/componentbuilder.php | 82 ++++++-- 22 files changed, 739 insertions(+), 324 deletions(-) create mode 100644 admin/models/fields/excludedlanguages.php create mode 100644 admin/sql/updates/mysql/2.10.11.sql create mode 100644 admin/sql/updates/mysql/2.10.12.sql diff --git a/README.md b/README.md index 40f307e44..734b6a429 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have! -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.10.12) 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.10.13) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -144,14 +144,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 13th March, 2020 -+ *Version*: 2.10.12 ++ *Last Build*: 24th March, 2020 ++ *Version*: 2.10.13 + *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **278824** -+ *Field count*: **1506** -+ *File count*: **1757** -+ *Folder count*: **278** ++ *Line count*: **280169** ++ *Field count*: **1512** ++ *File count*: **1771** ++ *Folder count*: **287** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/README.txt b/admin/README.txt index 40f307e44..734b6a429 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have! -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.10.12) 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.10.13) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -144,14 +144,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 13th March, 2020 -+ *Version*: 2.10.12 ++ *Last Build*: 24th March, 2020 ++ *Version*: 2.10.13 + *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **278824** -+ *Field count*: **1506** -+ *File count*: **1757** -+ *Folder count*: **278** ++ *Line count*: **280169** ++ *Field count*: **1512** ++ *File count*: **1771** ++ *Folder count*: **287** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/config.xml b/admin/config.xml index ab8e9d975..7cc153967 100644 --- a/admin/config.xml +++ b/admin/config.xml @@ -229,7 +229,7 @@ label="COM_COMPONENTBUILDER_CONFIG_LANGUAGE_LABEL" class="list_class" multiple="false" - default="0" + default="en-GB" required="true" button="true" /> diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index 14a6bacac..8e5b9322f 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -794,7 +794,7 @@ class Get { foreach ($plugins as $plugin) { - // get posible plugins + // get possible plugins if (\JPluginHelper::isEnabled('extension', $plugin)) { // Import the appropriate plugin group. @@ -937,7 +937,7 @@ class Get * @param string $event The event to trigger * @param mix $data The values to pass to the event/plugin * - * @return string + * @return void * */ public function triggerEvent($event, $data) @@ -3880,7 +3880,7 @@ class Get { $script = $this->setDynamicValues($script); } - // check if we still hava a string + // check if we still have a string if (ComponentbuilderHelper::checkString($script)) { // now load the placeholder snippet if needed @@ -5855,7 +5855,7 @@ class Get $query->from($this->db->quoteName('#__componentbuilder_language_translation', 'a')); if (ComponentbuilderHelper::checkArray($values)) { - $query->select($this->db->quoteName(array('a.id', 'a.translation', 'a.source', 'a.components', 'a.published'))); + $query->select($this->db->quoteName(array('a.id', 'a.translation', 'a.source', 'a.components', 'a.modules', 'a.plugins', 'a.published'))); $query->where($this->db->quoteName('a.source') . ' IN (' . implode(',', array_map(function($a) { return $this->db->quote($a); @@ -5872,12 +5872,12 @@ class Get /** * Set the Current language values to DB - * + * * * @return void - * + * */ - public function setLangPlaceholders($strings) + public function setLangPlaceholders($strings, $target_id, $target = 'components') { $counterInsert = 0; $counterUpdate = 0; @@ -5888,7 +5888,7 @@ class Get { // to keep or remove $remove = false; - // build the tranlations + // build the translations if (ComponentbuilderHelper::checkString($string) && isset($this->multiLangString[$string])) { // make sure we have converted the string to array @@ -5923,18 +5923,18 @@ class Get $remove = true; } } - // do the database managment + // do the database management if (ComponentbuilderHelper::checkString($string) && ($key = array_search($string, $strings)) !== false) { if (isset($this->multiLangString[$string])) { // update the existing placeholder in db $id = $this->multiLangString[$string]['id']; - if (ComponentbuilderHelper::checkJson($this->multiLangString[$string]['components'])) + if (ComponentbuilderHelper::checkJson($this->multiLangString[$string][$target])) { - $components = (array) json_decode($this->multiLangString[$string]['components'], true); - // check if we should add the component ID - if (in_array($this->componentID, $components)) + $targets = (array) json_decode($this->multiLangString[$string][$target], true); + // check if we should add the target ID + if (in_array($target_id, $targets)) { // only skip the update if the string is published and has the component ID if ($this->multiLangString[$string]['published'] == 1) @@ -5944,19 +5944,19 @@ class Get } else { - $components[] = $this->componentID; + $targets[] = $target_id; } } else { - $components = array($this->componentID); + $targets = array($target_id); } // start the bucket for this lang - $this->setUpdateExistingLangStrings($id, $components, 1, $today, $counterUpdate); + $this->setUpdateExistingLangStrings($id, $target, $targets, 1, $today, $counterUpdate); $counterUpdate++; - // load to db + // load to db $this->setExistingLangStrings(50); // remove string if needed if ($remove) @@ -5967,19 +5967,23 @@ class Get else { // add the new lang placeholder to the db - $this->newLangStrings[$counterInsert] = array(); - $this->newLangStrings[$counterInsert][] = $this->db->quote(json_encode(array($this->componentID))); // 'components' - $this->newLangStrings[$counterInsert][] = $this->db->quote($string); // 'source' - $this->newLangStrings[$counterInsert][] = $this->db->quote(1); // 'published' - $this->newLangStrings[$counterInsert][] = $this->db->quote($today); // 'created' - $this->newLangStrings[$counterInsert][] = $this->db->quote((int) $this->user->id); // 'created_by' - $this->newLangStrings[$counterInsert][] = $this->db->quote(1); // 'version' - $this->newLangStrings[$counterInsert][] = $this->db->quote(1); // 'access' + if (!isset($this->newLangStrings[$target])) + { + $this->newLangStrings[$target] = array(); + } + $this->newLangStrings[$target][$counterInsert] = array(); + $this->newLangStrings[$target][$counterInsert][] = $this->db->quote(json_encode(array([$target_id]))); // 'target' + $this->newLangStrings[$target][$counterInsert][] = $this->db->quote($string); // 'source' + $this->newLangStrings[$target][$counterInsert][] = $this->db->quote(1); // 'published' + $this->newLangStrings[$target][$counterInsert][] = $this->db->quote($today); // 'created' + $this->newLangStrings[$target][$counterInsert][] = $this->db->quote((int) $this->user->id); // 'created_by' + $this->newLangStrings[$target][$counterInsert][] = $this->db->quote(1); // 'version' + $this->newLangStrings[$target][$counterInsert][] = $this->db->quote(1); // 'access' $counterInsert++; - // load to db - $this->setNewLangStrings(100); + // load to db + $this->setNewLangStrings($target, 100); } // only set the string once unset($strings[$key]); @@ -5988,20 +5992,21 @@ class Get } // just to make sure all is done $this->setExistingLangStrings(); - $this->setNewLangStrings(); + $this->setNewLangStrings($target); } /** * store the language placeholders - * - * @param int $when To set when to update + * + * @param string $target The target extention type + * @param int $when To set when to update * * @return void * */ - protected function setNewLangStrings($when = 1) + protected function setNewLangStrings($target, $when = 1) { - if (count((array) $this->newLangStrings) >= $when) + if (isset($this->newLangStrings[$target]) && count((array) $this->newLangStrings[$target]) >= $when) { // Create a new query object. $query = $this->db->getQuery(true); @@ -6011,7 +6016,7 @@ class Get // Prepare the insert query. $query->insert($this->db->quoteName('#__componentbuilder_language_translation')); $query->columns($this->db->quoteName($columns)); - foreach ($this->newLangStrings as $values) + foreach ($this->newLangStrings[$target] as $values) { if (count((array) $values) == 7) { @@ -6024,7 +6029,7 @@ class Get } } // clear the values array - $this->newLangStrings = array(); + $this->newLangStrings[$target] = array(); if (!$continue) { return false; // insure we dont continue if no values were loaded @@ -6095,12 +6100,16 @@ class Get * @return void * */ - public function purgeLanuageStrings($values) + public function purgeLanuageStrings($values, $target_id, $target = 'components') { + // the target types are + $target_types = array('components' => 'components', 'modules' => 'modules', 'plugins' => 'plugins'); + // remove the current target + unset($target_types[$target]); // Create a new query object. $query = $this->db->getQuery(true); $query->from($this->db->quoteName('#__componentbuilder_language_translation', 'a')); - $query->select($this->db->quoteName(array('a.id', 'a.translation', 'a.components'))); + $query->select($this->db->quoteName(array('a.id', 'a.translation', 'a.components', 'a.modules', 'a.plugins'))); // get all string that are not linked to this component $query->where($this->db->quoteName('a.source') . ' NOT IN (' . implode(',', array_map(function($a) { @@ -6116,54 +6125,71 @@ class Get $today = JFactory::getDate()->toSql(); foreach ($otherStrings as $item) { - if (ComponentbuilderHelper::checkJson($item['components'])) + if (ComponentbuilderHelper::checkJson($item[$target])) { - $components = (array) json_decode($item['components'], true); + $targets = (array) json_decode($item[$target], true); // if component is not found ignore this string, and do nothing - if (($key = array_search($this->componentID, $components)) !== false) + if (($key = array_search($target_id, $targets)) !== false) { // first remove the component from the string - unset($components[$key]); + unset($targets[$key]); // check if there are more components - if (ComponentbuilderHelper::checkArray($components)) + if (ComponentbuilderHelper::checkArray($targets)) { // just update the string to unlink the current component - $this->setUpdateExistingLangStrings($item['id'], $components, 1, $today, $counterUpdate); + $this->setUpdateExistingLangStrings($item['id'], $target, $targets, 1, $today, $counterUpdate); $counterUpdate++; // load to db $this->setExistingLangStrings(50); } - // check if this string has been worked on - elseif (ComponentbuilderHelper::checkJson($item['translation'])) - { - $translation = json_decode($item['translation'], true); - if (ComponentbuilderHelper::checkArray($translation)) - { - // only archive the item and update the string to unlink the current component - $this->setUpdateExistingLangStrings($item['id'], $components, 2, $today, $counterUpdate); - - $counterUpdate++; - - // load to db - $this->setExistingLangStrings(50); - } - else - { - // remove the string since no translation found and not linked to any other component - $this->removeExitingLangString($item['id']); - } - } + // check if this string has been worked on or is linked to other extensions else { - // remove the string since no translation found and not linked to any other component - $this->removeExitingLangString($item['id']); + // the action (1 = remove, 2 = archive, 0 = do nothing) + $action_with_string = 1; + // now check if it is linked to other extensions + foreach($target_types as $other_target) + { + // just one linked extension type is enough to stop the search + if ($action_with_string && ComponentbuilderHelper::checkJson($item[$other_target])) + { + $other_targets = (array)json_decode($item[$other_target], true); + // check if linked to other extensions + if (ComponentbuilderHelper::checkArray($other_targets)) + { + $action_with_string = 0; // do nothing + } + } + } + // check we should just archive or remove string + if ($action_with_string && ComponentbuilderHelper::checkJson($item['translation'])) + { + $translation = json_decode($item['translation'], true); + if (ComponentbuilderHelper::checkArray($translation)) + { + // only archive the item and update the string to unlink the current component + $this->setUpdateExistingLangStrings($item['id'], $target, $targets, 2, $today, $counterUpdate); + + $counterUpdate++; + + // load to db + $this->setExistingLangStrings(50); + + $action_with_string = 2; // we archived it + } + } + // remove the string since no translation found and not linked to any other extensions + if ($action_with_string == 1) + { + $this->removeExitingLangString($item['id']); + } } } } } - // load to db + // load to db $this->setExistingLangStrings(); } } @@ -6174,7 +6200,7 @@ class Get * @return void * */ - protected function setUpdateExistingLangStrings($id, $components, $published, $today, $counterUpdate) + protected function setUpdateExistingLangStrings($id, $target, $targets, $published, $today, $counterUpdate) { // start the bucket for this lang $this->existingLangStrings[$counterUpdate] = array(); @@ -6182,7 +6208,7 @@ class Get $this->existingLangStrings[$counterUpdate]['conditions'] = array(); $this->existingLangStrings[$counterUpdate]['conditions'][] = $this->db->quoteName('id') . ' = ' . $this->db->quote($id); $this->existingLangStrings[$counterUpdate]['fields'] = array(); - $this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName('components') . ' = ' . $this->db->quote(json_encode($components)); + $this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName($target) . ' = ' . $this->db->quote(json_encode($targets)); $this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName('published') . ' = ' . $this->db->quote($published); $this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName('modified') . ' = ' . $this->db->quote($today); $this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName('modified_by') . ' = ' . $this->db->quote((int) $this->user->id); @@ -6590,6 +6616,7 @@ class Get { // set GUI mapper field $guiMapper['field'] = 'default'; + $guiMapper['type'] = 'html'; $module->default = $this->setGuiCodePlaceholder( $this->setPlaceholders($this->setDynamicValues(base64_decode($module->default)), $this->placeholders), $guiMapper @@ -8451,8 +8478,9 @@ class Get $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 + // media path $localPaths['media'] = JPATH_ROOT . '/media/com_' . $this->componentCodeName; + // lets also go over the REPOS (TODO) // Painfull but we need to folder paths for the linked modules if (($module_ids = $this->getModuleIDs()) !== false) { diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 0bee15833..aaea20390 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -16806,8 +16806,7 @@ function vdm_dkim() { // now build the language files if (isset($this->langContent[$module->key])) { - $lang = array_map(function ($langstring, $placeholder) - { + $lang = array_map(function ($langstring, $placeholder){ return $placeholder . '="' . $langstring . '"'; }, $this->langContent[$module->key], array_keys($this->langContent[$module->key])); // add to language file @@ -17064,8 +17063,8 @@ function vdm_dkim() { { $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(2) . '' . $this->langTag . '/' . $this->langTag . '.plg_' . strtolower($plugin->group) . '_' . strtolower($plugin->code_name) . '.ini'; - $xml .= PHP_EOL . $this->_t(2) . '' . $this->langTag . '/' . $this->langTag . '.plg_' . strtolower($plugin->group) . '_' . strtolower($plugin->code_name) . '.sys.ini'; + $xml .= PHP_EOL . $this->_t(2) . '' . $this->langTag . '/' . $this->langTag . '.plg_' . strtolower($plugin->group) . '_' . strtolower($plugin->code_name) . '.ini'; + $xml .= PHP_EOL . $this->_t(2) . '' . $this->langTag . '/' . $this->langTag . '.plg_' . strtolower($plugin->group) . '_' . strtolower($plugin->code_name) . '.sys.ini'; $xml .= PHP_EOL . $this->_t(1) . ''; } // add the plugin files diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index 27529d3e4..d819967a6 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -1253,16 +1253,16 @@ class Infusion extends Interpretation // get the other lang strings if there is any $this->multiLangString = $this->getMultiLangStrings($values); // update insert the current lang in to DB - $this->setLangPlaceholders($values); + $this->setLangPlaceholders($values, $this->componentID); // remove old unused language strings - $this->purgeLanuageStrings($values); + $this->purgeLanuageStrings($values, $this->componentID); // path to INI file $getPAth = $this->templatePath . '/en-GB.com_admin.ini'; + // Trigger Event: jcb_ce_onBeforeBuildAllLangFiles + $this->triggerEvent('jcb_ce_onBeforeBuildAllLangFiles', array(&$this->componentContext, &$this->languages, &$this->langTag)); // now we insert the values into the files if (ComponentbuilderHelper::checkArray($this->languages)) { - // Trigger Event: jcb_ce_onBeforeBuildAllLangFiles - $this->triggerEvent('jcb_ce_onBeforeBuildAllLangFiles', array(&$this->componentContext, &$this->languages, &$this->langTag)); // rest xml array $langXML = array(); foreach ($this->languages as $tag => $areas) diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index ed5d3d72e..09094fc76 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -5603,7 +5603,7 @@ abstract class ComponentbuilderHelper /** - * Change to nice fancy date + * Change to nice fancy date */ public static function fancyDate($date) { @@ -5615,7 +5615,7 @@ abstract class ComponentbuilderHelper } /** - * get date based in period past + * get date based in period past */ public static function fancyDynamicDate($date) { @@ -5641,7 +5641,7 @@ abstract class ComponentbuilderHelper } /** - * Change to nice fancy day time and date + * Change to nice fancy day time and date */ public static function fancyDayTimeDate($time) { @@ -5653,7 +5653,7 @@ abstract class ComponentbuilderHelper } /** - * Change to nice fancy time and date + * Change to nice fancy time and date */ public static function fancyDateTime($time) { @@ -5665,7 +5665,7 @@ abstract class ComponentbuilderHelper } /** - * Change to nice hour:minutes time + * Change to nice hour:minutes time */ public static function fancyTime($time) { @@ -5677,31 +5677,91 @@ abstract class ComponentbuilderHelper } /** - * set the date as 2004/05 (for charts) + * set the date day as Sunday through Saturday */ - public static function setYearMonth($date) + public static function setDayName($date) { if (!self::isValidTimeStamp($date)) { $date = strtotime($date); } - return date('Y/m', $date); + return date('l', $date); + } + + /** + * set the date month as January through December + */ + public static function setMonthName($date) + { + if (!self::isValidTimeStamp($date)) + { + $date = strtotime($date); + } + return date('F', $date); + } + + /** + * set the date day as 1st + */ + public static function setDay($date) + { + if (!self::isValidTimeStamp($date)) + { + $date = strtotime($date); + } + return date('jS', $date); + } + + /** + * set the date month as 5 + */ + public static function setMonth($date) + { + if (!self::isValidTimeStamp($date)) + { + $date = strtotime($date); + } + return date('n', $date); + } + + /** + * set the date year as 2004 (for charts) + */ + public static function setYear($date) + { + if (!self::isValidTimeStamp($date)) + { + $date = strtotime($date); + } + return date('Y', $date); + } + + /** + * set the date as 2004/05 (for charts) + */ + public static function setYearMonth($date, $spacer = '/') + { + if (!self::isValidTimeStamp($date)) + { + $date = strtotime($date); + } + return date('Y' . $spacer . 'm', $date); } /** * set the date as 2004/05/03 (for charts) */ - public static function setYearMonthDay($date) + public static function setYearMonthDay($date, $spacer = '/') { if (!self::isValidTimeStamp($date)) { $date = strtotime($date); } - return date('Y/m/d', $date); + return date('Y' . $spacer . 'm' . $spacer . 'd', $date); } /** - * Check if string is a valid time stamp + * Check if string is a valid time stamp */ public static function isValidTimeStamp($timestamp) { diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 6f813bd96..2bcfbc886 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -1375,6 +1375,7 @@ COM_COMPONENTBUILDER_ALL_OF_THESE_PACKAGES_ARE_A_FULLY_DEVELOPEDMAPPED_COMPONENT COM_COMPONENTBUILDER_ALL_THE_LANGUAGES_FOUND_IN_JOOMLA_WERE_SUCCESSFULLY_IMPORTED="All the languages found in Joomla were successfully imported." COM_COMPONENTBUILDER_ALL_UNSAVED_WORK_ON_THIS_PAGE_WILL_BE_LOST_ARE_YOU_SURE_YOU_WANT_TO_CONTINUE="All unsaved work on this page will be lost, are you sure you want to continue?" COM_COMPONENTBUILDER_ALREADY_SELECTED_TRY_ANOTHER="Already selected, try another." +COM_COMPONENTBUILDER_ALREADY_TRANSLATED_INTO="Already translated into" COM_COMPONENTBUILDER_ALWAYS_ADD="Always Add" COM_COMPONENTBUILDER_ALWAYS_INSURE_THAT_YOU_HAVE_YOUR_LOCAL_COMPONENTS_BACKED_UP_BY_MAKING_AN_EXPORT_OF_ALL_YOUR_LOCAL_COMPONENTS_BEFORE_IMPORTING_ANY_NEW_COMPONENTS_SMALLMAKE_BSUREB_TO_MOVE_THIS_ZIPPED_BACKUP_PACKAGE_OUT_OF_THE_TMP_FOLDER_BEFORE_DOING_AN_IMPORTSMALLBR_IF_YOU_ARE_IMPORTING_A_PACKAGE_OF_A_THREERD_PARTY_JCB_PACKAGE_DEVELOPER_BMAKE_SURE_IT_IS_A_REPUTABLE_JCB_PACKAGE_DEVELOPERSB_A_SFIND_OUT_WHYA="Always insure that you have your local components backed up, by making an export of all your local components before importing any new components. (Make SURE to move this zipped backup package out of the tmp folder before doing an import)
If you are importing a package of a 3rd party JCB package developer, make sure it is a reputable JCB package developers! Find out why!" COM_COMPONENTBUILDER_ANY_SELECTION_ONLY_FOUR_LISTRADIOCHECKBOXESDYNAMIC_LIST="Any Selection (only 4 list/radio/checkboxes/dynamic_list)" @@ -1752,6 +1753,7 @@ COM_COMPONENTBUILDER_COMPILER_SUBMENU_DESC="Allows the users in this group to su COM_COMPONENTBUILDER_COMPILER_TRANSLATE_BUTTON_ACCESS="Compiler Translate Button Access" COM_COMPONENTBUILDER_COMPILER_TRANSLATE_BUTTON_ACCESS_DESC="Allows the users in this group to access the translate button." COM_COMPONENTBUILDER_COMPILE_COMPONENT="Compile Component" +COM_COMPONENTBUILDER_COMPONENT="Component" COM_COMPONENTBUILDER_COMPONENTS="Components" COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS="Components Admin Views" COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_ACCESS="Components Admin Views Access" @@ -7146,7 +7148,7 @@ COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_N_ITEMS_UNPUBLISHED_1="%s Language Tr COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_SUBMENU="Language Translations Submenu" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_SUBMENU_DESC="Allows the users in this group to submenu of language translation" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_COMPONENTS="Components" -COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_COMPONENTS_LABEL="Components" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_COMPONENTS_LABEL="Components
source string is used in these components" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_CREATED_BY_DESC="The user that created this Language Translation." COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_CREATED_BY_LABEL="Created By" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_CREATED_DATE_DESC="The date this Language Translation was created." @@ -7161,9 +7163,13 @@ COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_MODIFIED_BY_DESC="The last user that m COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_MODIFIED_BY_LABEL="Modified By" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_MODIFIED_DATE_DESC="The date this Language Translation was modified." COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_MODIFIED_DATE_LABEL="Modified Date" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_MODULES="Modules" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_MODULES_LABEL="Modules
source string is used in these modules" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_NEW="A New Language Translation" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ORDERING_LABEL="Ordering" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_PERMISSION="Permissions" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_PLUGINS="Plugins" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_PLUGINS_LABEL="Plugins
source string is used in these plugins" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_PUBLISHING="Publishing" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Language Translation to customise the alias." COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_SOURCE="Source" @@ -7709,6 +7715,8 @@ COM_COMPONENTBUILDER_MINIFY_JAVASCRIPT="Minify JavaScript" COM_COMPONENTBUILDER_MIN_LENGTH_ONLY_FOUR_TEXT_FIELD="Min Length (only 4 text_field)" COM_COMPONENTBUILDER_MODEL_AFTER_MODELLING="Model (after modelling)" COM_COMPONENTBUILDER_MODEL_BEFORE_MODELLING="Model (before modelling)" +COM_COMPONENTBUILDER_MODULE="Module" +COM_COMPONENTBUILDER_MODULES="Modules" COM_COMPONENTBUILDER_NAME="Name" COM_COMPONENTBUILDER_NAME_ASC="Name (Asc)" COM_COMPONENTBUILDER_NAME_DESC="Name (Desc)" @@ -7891,6 +7899,8 @@ COM_COMPONENTBUILDER_PLEASE_SELECT_A_COMPONENT_THAT_YOU_WOULD_LIKE_TO_COMPILE="P COM_COMPONENTBUILDER_PLEASE_TRY_AGAIN_LATER="Please try again later" COM_COMPONENTBUILDER_PLEASE_WAIT_CLEARING_THE_TMP_FOLDER="Please wait! Clearing the tmp folder" COM_COMPONENTBUILDER_PLEASE_WAIT_LOADING="Please wait, loading" +COM_COMPONENTBUILDER_PLUGIN="Plugin" +COM_COMPONENTBUILDER_PLUGINS="Plugins" COM_COMPONENTBUILDER_PROPERTIES="Properties" COM_COMPONENTBUILDER_PROPERTIESBR_SMALLHERE_YOU_CAN_SET_THE_PROPERTIES_FOR_THIS_FIELDSMALL="Properties
Here you can set the properties for this field." COM_COMPONENTBUILDER_PROPERTY="Property" @@ -9054,7 +9064,7 @@ COM_COMPONENTBUILDER_UPDATE_ALL_DIVERGED_SNIPPETS="Update All Diverged Snippets" COM_COMPONENTBUILDER_UPDATE_ALL_OUT_DATED_SNIPPETS="Update All Out Dated Snippets" COM_COMPONENTBUILDER_UP_TO_DATE="Up to date" COM_COMPONENTBUILDER_USAGE="Usage" -COM_COMPONENTBUILDER_USED_IN="used in" +COM_COMPONENTBUILDER_USED_IN="Used in" COM_COMPONENTBUILDER_USE_BATCH="Use Batch" COM_COMPONENTBUILDER_USE_BATCH_DESC="Allows users in this group to use batch copy/update method." COM_COMPONENTBUILDER_USE_KEY="Use Key" diff --git a/admin/layouts/language_translation/details_fullwidth.php b/admin/layouts/language_translation/details_fullwidth.php index ac4984f68..7f548d4b1 100644 --- a/admin/layouts/language_translation/details_fullwidth.php +++ b/admin/layouts/language_translation/details_fullwidth.php @@ -28,7 +28,9 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; $fields = $displayData->get($fields_tab_layout) ?: array( 'source', 'translation', - 'components' + 'components', + 'modules', + 'plugins' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); diff --git a/admin/models/fields/excludedlanguages.php b/admin/models/fields/excludedlanguages.php new file mode 100644 index 000000000..b7200b61e --- /dev/null +++ b/admin/models/fields/excludedlanguages.php @@ -0,0 +1,176 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// import the list field type +jimport('joomla.form.helper'); +JFormHelper::loadFieldClass('list'); + +/** + * Excludedlanguages Form Field class for the Componentbuilder component + */ +class JFormFieldExcludedlanguages extends JFormFieldList +{ + /** + * The excludedlanguages field type. + * + * @var string + */ + public $type = 'excludedlanguages'; + + /** + * Override to add new button + * + * @return string The field input markup. + * + * @since 3.2 + */ + protected function getInput() + { + // see if we should add buttons + $set_button = $this->getAttribute('button'); + // get html + $html = parent::getInput(); + // if true set button + if ($set_button === 'true') + { + $button = array(); + $script = array(); + $button_code_name = $this->getAttribute('name'); + // get the input from url + $app = JFactory::getApplication(); + $jinput = $app->input; + // get the view name & id + $values = $jinput->getArray(array( + 'id' => 'int', + 'view' => 'word' + )); + // check if new item + $ref = ''; + $refJ = ''; + if (!is_null($values['id']) && strlen($values['view'])) + { + // only load referral if not new item. + $ref = '&ref=' . $values['view'] . '&refid=' . $values['id']; + $refJ = '&ref=' . $values['view'] . '&refid=' . $values['id']; + // get the return value. + $_uri = (string) JUri::getInstance(); + $_return = urlencode(base64_encode($_uri)); + // load return value. + $ref .= '&return=' . $_return; + $refJ .= '&return=' . $_return; + } + // get button label + $button_label = trim($button_code_name); + $button_label = preg_replace('/_+/', ' ', $button_label); + $button_label = preg_replace('/\s+/', ' ', $button_label); + $button_label = preg_replace("/[^A-Za-z ]/", '', $button_label); + $button_label = ucfirst(strtolower($button_label)); + // get user object + $user = JFactory::getUser(); + // only add if user allowed to create language + if ($user->authorise('language.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area. + { + // build Create button + $button[] = ' + '; + } + // only add if user allowed to edit language + if ($user->authorise('language.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area. + { + // build edit button + $button[] = ''; + // build script + $script[] = " + jQuery(document).ready(function() { + jQuery('#adminForm').on('change', '#jform_".$button_code_name."',function (e) { + e.preventDefault(); + var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val(); + ".$button_code_name."Button(".$button_code_name."Value); + }); + var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val(); + ".$button_code_name."Button(".$button_code_name."Value); + }); + function ".$button_code_name."Button(value) { + if (value > 0) { + // hide the create button + jQuery('#".$button_code_name."Create').hide(); + // show edit button + jQuery('#".$button_code_name."Edit').show(); + var url = 'index.php?option=com_componentbuilder&view=languages&task=language.edit&id='+value+'".$refJ."'; + jQuery('#".$button_code_name."Edit').attr('href', url); + } else { + // show the create button + jQuery('#".$button_code_name."Create').show(); + // hide edit button + jQuery('#".$button_code_name."Edit').hide(); + } + }"; + } + // check if button was created for language field. + if (is_array($button) && count($button) > 0) + { + // Load the needed script. + $document = JFactory::getDocument(); + $document->addScriptDeclaration(implode(' ',$script)); + // return the button attached to input field. + return '
' .$html . implode('',$button).'
'; + } + } + return $html; + } + + /** + * Method to get a list of options for a list input. + * + * @return array An array of JHtml options. + */ + protected function getOptions() + { + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + $query->select($db->quoteName(array('a.langtag','a.name'),array('langtag','languages_name'))); + $query->from($db->quoteName('#__componentbuilder_language', 'a')); + $query->where($db->quoteName('a.published') . ' >= 1'); + $query->order('a.langtag ASC'); + $db->setQuery((string)$query); + $items = $db->loadObjectList(); + // add the main language + $main_lang = trim(JComponentHelper::getParams('com_componentbuilder')->get('language', 'en-GB')); + // check if any language was added + $wasAdded = false; + $options = array(); + if ($items) + { + $options[] = JHtml::_('select.option', '', 'Select an option'); + foreach($items as $item) + { + $item->langtag = trim($item->langtag); + // do not add main language + if ($main_lang !== $item->langtag) + { + $options[] = JHtml::_('select.option', $item->langtag, $item->languages_name . ' (' .$item->langtag.')'); + $wasAdded = true; + } + } + } + // now if none was added give notice + if (!$wasAdded) + { + $options[] = JHtml::_('select.option', '', 'Add languages to select'); + } + return $options; + } +} diff --git a/admin/models/fields/lang.php b/admin/models/fields/lang.php index f893411fa..e683fa747 100644 --- a/admin/models/fields/lang.php +++ b/admin/models/fields/lang.php @@ -36,33 +36,43 @@ class JFormFieldLang extends JFormFieldList protected function getOptions() { $db = JFactory::getDBO(); -$query = $db->getQuery(true); -$query->select($db->quoteName(array('a.langtag','a.name'),array('langtag','language_name'))); -$query->from($db->quoteName('#__componentbuilder_language', 'a')); -$query->where($db->quoteName('a.published') . ' >= 1'); -$query->order('a.langtag ASC'); -$db->setQuery((string)$query); -$items = $db->loadObjectList(); -// make sure the English GB is added -$wasAdded = false; -$options = array(); -if ($items) -{ - $options[] = JHtml::_('select.option', '', 'Select an option'); - foreach($items as $item) - { - $options[] = JHtml::_('select.option', trim($item->langtag), $item->language_name . ' (' .$item->langtag.')'); - if ('en-GB' === trim($item->langtag)) + $query = $db->getQuery(true); + $query->select($db->quoteName(array('a.langtag','a.name'),array('langtag','language_name'))); + $query->from($db->quoteName('#__componentbuilder_language', 'a')); + $query->where($db->quoteName('a.published') . ' >= 1'); + $query->order('a.langtag ASC'); + $db->setQuery((string)$query); + $items = $db->loadObjectList(); + // add the main language + $main_lang = trim(JComponentHelper::getParams('com_componentbuilder')->get('language', 'en-GB')); + // make sure the main language is added + $wasAdded = false; + $options = array(); + if ($items) { - $wasAdded = true; + $options[] = JHtml::_('select.option', '', 'Select an option'); + foreach($items as $item) + { + $item->langtag = trim($item->langtag); + $options[] = JHtml::_('select.option', $item->langtag, $item->language_name . ' (' .$item->langtag.')'); + if ($main_lang === $item->langtag) + { + $wasAdded = true; + } + } } - } -} -// now add it if not already added -if (!$wasAdded) -{ - $options[] = JHtml::_('select.option', 'en-GB', 'English GB (en-GB)'); -} -return $options; + // now add it if not already added (it must default to $main_lang) + if (!$wasAdded) + { + if ('en-GB' === $main_lang) + { + $options[] = JHtml::_('select.option', $main_lang, 'English GB (' . $main_lang . ')'); + } + else + { + $options[] = JHtml::_('select.option', $main_lang, 'Main Language (' . $main_lang . ')'); + } + } + return $options; } } diff --git a/admin/models/forms/language_translation.xml b/admin/models/forms/language_translation.xml index 9a4f34015..fdd2632cd 100644 --- a/admin/models/forms/language_translation.xml +++ b/admin/models/forms/language_translation.xml @@ -100,15 +100,34 @@ readonly="true" disabled="true" /> + + + + @@ -141,7 +160,7 @@ label="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_LANGUAGE_LABEL" class="list_class" multiple="false" - default="0" + default="en-GB" required="true" button="false" /> diff --git a/admin/models/language_translation.php b/admin/models/language_translation.php index 38eb49a98..350d3cbf4 100644 --- a/admin/models/language_translation.php +++ b/admin/models/language_translation.php @@ -29,7 +29,9 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin 'fullwidth' => array( 'source', 'translation', - 'components' + 'components', + 'modules', + 'plugins' ) ) ); @@ -905,6 +907,18 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin $data['translation'] = ''; } + // Set the plugins string to JSON string. + if (isset($data['plugins'])) + { + $data['plugins'] = (string) json_encode($data['plugins']); + } + + // Set the modules string to JSON string. + if (isset($data['modules'])) + { + $data['modules'] = (string) json_encode($data['modules']); + } + // Set the components string to JSON string. if (isset($data['components'])) { diff --git a/admin/models/language_translations.php b/admin/models/language_translations.php index a650d4095..090f3f478 100644 --- a/admin/models/language_translations.php +++ b/admin/models/language_translations.php @@ -104,50 +104,13 @@ class ComponentbuilderModelLanguage_translations extends JModelList continue; } + // escape all strings if not being exported + if (!isset($_export)) + { + $item->source = ComponentbuilderHelper::htmlEscape($item->source, 'UTF-8', true, 150); + } } } - // show all languages that are already set for this string - if (!isset($_export) && ComponentbuilderHelper::checkArray($items)) - { - foreach ($items as $nr => &$item) - { - $langBucket = array(); - if (ComponentbuilderHelper::checkJson($item->translation)) - { - $translations = json_decode($item->translation, true); - if (ComponentbuilderHelper::checkArray($translations)) - { - foreach ($translations as $language) - { - if (isset($language['translation']) && ComponentbuilderHelper::checkString($language['translation']) - && isset($language['language']) && ComponentbuilderHelper::checkString($language['language'])) - { - $langBucket[$language['language']] = $language['language']; - } - } - } - } - // set how many component use this string - $componentCounter = ''; - if (ComponentbuilderHelper::checkJson($item->components)) - { - $item->components = json_decode($item->components, true); - } - if (ComponentbuilderHelper::checkArray($item->components)) - { - $componentCounter = ' - ' . JText::_('COM_COMPONENTBUILDER_USED_IN') . ' ' . count($item->components) . ''; - } - // load the languages to the string - if (ComponentbuilderHelper::checkArray($langBucket)) - { - $item->source = '(' . implode(', ', $langBucket) . ') ' . ComponentbuilderHelper::htmlEscape($item->source, 'UTF-8', true, 150) . $componentCounter; - } - else - { - $item->source = '(' . JText::_('COM_COMPONENTBUILDER_NOTRANSLATION') . ') ' . ComponentbuilderHelper::htmlEscape($item->source, 'UTF-8', true, 150) . $componentCounter; - } - } - } // prep the lang strings for export if (isset($_export) && $_export && ComponentbuilderHelper::checkArray($items)) { @@ -157,6 +120,8 @@ class ComponentbuilderModelLanguage_translations extends JModelList { // remove some values completely unset($item->components); + unset($item->modules); + unset($item->plugins); unset($item->params); unset($item->published); unset($item->created_by); @@ -331,6 +296,11 @@ class ComponentbuilderModelLanguage_translations extends JModelList continue; } + // escape all strings if not being exported + if (!isset($_export)) + { + $item->source = ComponentbuilderHelper::htmlEscape($item->source, 'UTF-8', true, 150); + } // unset the values we don't want exported. unset($item->asset_id); unset($item->checked_out); @@ -344,49 +314,7 @@ class ComponentbuilderModelLanguage_translations extends JModelList array_unshift($items,$headers); } - // show all languages that are already set for this string - if (!isset($_export) && ComponentbuilderHelper::checkArray($items)) - { - foreach ($items as $nr => &$item) - { - $langBucket = array(); - if (ComponentbuilderHelper::checkJson($item->translation)) - { - $translations = json_decode($item->translation, true); - if (ComponentbuilderHelper::checkArray($translations)) - { - foreach ($translations as $language) - { - if (isset($language['translation']) && ComponentbuilderHelper::checkString($language['translation']) - && isset($language['language']) && ComponentbuilderHelper::checkString($language['language'])) - { - $langBucket[$language['language']] = $language['language']; - } - } - } - } - // set how many component use this string - $componentCounter = ''; - if (ComponentbuilderHelper::checkJson($item->components)) - { - $item->components = json_decode($item->components, true); - } - if (ComponentbuilderHelper::checkArray($item->components)) - { - $componentCounter = ' - ' . JText::_('COM_COMPONENTBUILDER_USED_IN') . ' ' . count($item->components) . ''; - } - // load the languages to the string - if (ComponentbuilderHelper::checkArray($langBucket)) - { - $item->source = '(' . implode(', ', $langBucket) . ') ' . ComponentbuilderHelper::htmlEscape($item->source, 'UTF-8', true, 150) . $componentCounter; - } - else - { - $item->source = '(' . JText::_('COM_COMPONENTBUILDER_NOTRANSLATION') . ') ' . ComponentbuilderHelper::htmlEscape($item->source, 'UTF-8', true, 150) . $componentCounter; - } - } - } - // prep the lang strings for export + // prep the lang strings for export if (isset($_export) && $_export && ComponentbuilderHelper::checkArray($items)) { // insure we have the same order in the languages @@ -395,6 +323,8 @@ class ComponentbuilderModelLanguage_translations extends JModelList { // remove some values completely unset($item->components); + unset($item->modules); + unset($item->plugins); unset($item->params); unset($item->published); unset($item->created_by); diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index fe7db6418..1c24e2442 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -1104,6 +1104,8 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_language_translation` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `components` TEXT NOT NULL, + `modules` TEXT NOT NULL, + `plugins` TEXT NOT NULL, `source` MEDIUMTEXT NOT NULL, `translation` TEXT NOT NULL, `params` text NOT NULL, @@ -2172,83 +2174,84 @@ INSERT INTO `#__componentbuilder_fieldtype` (`id`, `catid`, `description`, `name -- INSERT INTO `#__componentbuilder_language` (`id`, `langtag`, `name`, `params`, `published`, `created`, `modified`, `version`, `hits`, `ordering`) VALUES -(1, 'af-ZA', 'Afrikaans', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(2, 'sq-AL', 'Albanian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(3, 'ar-AA', 'Arabic Unitag', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(4, 'hy-AM', 'Armenian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(5, 'id-ID', 'Bahasa Indonesia', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(6, 'eu-ES', 'Basque', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(7, 'be-BY', 'Belarusian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(8, 'bn-BD', 'Bengali', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(9, 'bs-BA', 'Bosnian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(10, 'bg-BG', 'Bulgarian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(11, 'ca-ES', 'Catalan', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(12, 'zh-CN', 'Chinese Simplified', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(13, 'zh-TW', 'Chinese Traditional', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(14, 'hr-HR', 'Croatian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(15, 'cs-CZ', 'Czech', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(16, 'da-DK', 'Danish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(17, 'prs-AF', 'Dari Persian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(18, 'nl-NL', 'Dutch', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(19, 'dz-BT', 'Dzongkha', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(20, 'en-AU', 'English AU', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(21, 'en-CA', 'English CA', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(22, 'en-GB', 'English GB', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(23, 'en-NZ', 'English NZ', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(24, 'en-US', 'English US', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(25, 'eo-XX', 'Esperanto', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(26, 'et-EE', 'Estonian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(27, 'fi-FI', 'Finnish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(28, 'nl-BE', 'Flemish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(29, 'fr-FR', 'French', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(30, 'fr-CA', 'French CA', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(31, 'gl-ES', 'Galician', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(32, 'ka-GE', 'Georgian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(33, 'de-AT', 'German AT', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(34, 'de-CH', 'German CH', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(35, 'de-DE', 'German DE', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(36, 'de-LI', 'German LI', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(37, 'de-LU', 'German LU', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(38, 'el-GR', 'Greek', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(39, 'he-IL', 'Hebrew', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(40, 'hi-IN', 'Hindi', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(41, 'hu-HU', 'Hungarian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(42, 'ga-IE', 'Irish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(43, 'it-IT', 'Italian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(44, 'ja-JP', 'Japanese', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(45, 'km-KH', 'Khmer', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(46, 'ko-KR', 'Korean', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(47, 'lv-LV', 'Latvian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(48, 'mk-MK', 'Macedonian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(49, 'ms-MY', 'Malay', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(50, 'srp-ME', 'Montenegrin', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(51, 'nb-NO', 'Norwegian Bokmal', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(52, 'nn-NO', 'Norwegian Nynorsk', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(53, 'fa-IR', 'Persian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(54, 'pl-PL', 'Polish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(55, 'pt-PT', 'Portuguese', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(56, 'pt-BR', 'Portuguese Brazil', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(57, 'ro-RO', 'Romanian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(58, 'ru-RU', 'Russian', '', 1, '2018-04-19 13:43:44', '2019-10-11 11:55:13', 3, '', 1), -(59, 'sr-RS', 'Serbian Cyrillic', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(60, 'sr-YU', 'Serbian Latin', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(61, 'si-LK', 'Sinhala', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(62, 'sk-SK', 'Slovak', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(63, 'sl-SI', 'Slovenian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(64, 'es-ES', 'Spanish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(65, 'es-CO', 'Spanish CO', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(66, 'sw-KE', 'Swahili', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(67, 'sv-SE', 'Swedish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(68, 'sy-IQ', 'Syriac', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(69, 'ta-IN', 'Tamil', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(70, 'th-TH', 'Thai', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(71, 'tr-TR', 'Turkish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(72, 'tk-TM', 'Turkmen', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(73, 'uk-UA', 'Ukrainian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(74, 'ug-CN', 'Uyghur', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(75, 'vi-VN', 'Vietnamese', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(76, 'cy-GB', 'Welsh', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), -(77, 'lt-LT', 'Lithuanian', '', 1, '2018-09-14 10:39:11', '0000-00-00 00:00:00', 1, '', 2); +(1, 'af-ZA', 'Afrikaans', '', 1, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(2, 'sq-AL', 'Albanian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(3, 'ar-AA', 'Arabic Unitag', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(4, 'hy-AM', 'Armenian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(5, 'id-ID', 'Bahasa Indonesia', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(6, 'eu-ES', 'Basque', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(7, 'be-BY', 'Belarusian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(8, 'bn-BD', 'Bengali', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(9, 'bs-BA', 'Bosnian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(10, 'bg-BG', 'Bulgarian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(11, 'ca-ES', 'Catalan', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(12, 'zh-CN', 'Chinese Simplified', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(13, 'zh-TW', 'Chinese Traditional', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(14, 'hr-HR', 'Croatian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(15, 'cs-CZ', 'Czech', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(16, 'da-DK', 'Danish', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(17, 'prs-AF', 'Dari Persian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(18, 'nl-NL', 'Dutch', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(19, 'dz-BT', 'Dzongkha', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(20, 'en-AU', 'English AU', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(21, 'en-CA', 'English CA', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(22, 'en-GB', 'English GB', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(23, 'en-NZ', 'English NZ', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(24, 'en-US', 'English US', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(25, 'eo-XX', 'Esperanto', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(26, 'et-EE', 'Estonian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(27, 'fi-FI', 'Finnish', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(28, 'nl-BE', 'Flemish', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(29, 'fr-FR', 'French', '', 1, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(30, 'fr-CA', 'French CA', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(31, 'gl-ES', 'Galician', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(32, 'ka-GE', 'Georgian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(33, 'de-AT', 'German AT', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(34, 'de-CH', 'German CH', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(35, 'de-DE', 'German DE', '', 1, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(36, 'de-LI', 'German LI', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(37, 'de-LU', 'German LU', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(38, 'el-GR', 'Greek', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(39, 'he-IL', 'Hebrew', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(40, 'hi-IN', 'Hindi', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(41, 'hu-HU', 'Hungarian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(42, 'ga-IE', 'Irish', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(43, 'it-IT', 'Italian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(44, 'ja-JP', 'Japanese', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(45, 'km-KH', 'Khmer', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(46, 'ko-KR', 'Korean', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(47, 'lv-LV', 'Latvian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(48, 'mk-MK', 'Macedonian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(49, 'ms-MY', 'Malay', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(50, 'srp-ME', 'Montenegrin', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(51, 'nb-NO', 'Norwegian Bokmal', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(52, 'nn-NO', 'Norwegian Nynorsk', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(53, 'fa-IR', 'Persian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(54, 'pl-PL', 'Polish', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(55, 'pt-PT', 'Portuguese', '', 1, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(56, 'pt-BR', 'Portuguese Brazil', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(57, 'ro-RO', 'Romanian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(58, 'ru-RU', 'Russian', '', 1, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 4, '', 1), +(59, 'sr-RS', 'Serbian Cyrillic', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(60, 'sr-YU', 'Serbian Latin', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(61, 'si-LK', 'Sinhala', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(62, 'sk-SK', 'Slovak', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(63, 'sl-SI', 'Slovenian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(64, 'es-ES', 'Spanish', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(65, 'es-CO', 'Spanish CO', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(66, 'sw-KE', 'Swahili', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(67, 'sv-SE', 'Swedish', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(68, 'sy-IQ', 'Syriac', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(69, 'ta-IN', 'Tamil', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(70, 'th-TH', 'Thai', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(71, 'tr-TR', 'Turkish', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(72, 'tk-TM', 'Turkmen', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(73, 'uk-UA', 'Ukrainian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(74, 'ug-CN', 'Uyghur', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(75, 'vi-VN', 'Vietnamese', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(76, 'cy-GB', 'Welsh', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1), +(77, 'lt-LT', 'Lithuanian', '', 2, '2018-09-14 10:39:11', '2020-03-19 13:41:00', 2, '', 2), +(78, 'kk-KZ', 'Kazakh', '', 2, '2020-03-19 13:41:00', '0000-00-00 00:00:00', 1, '', 3); -- -- Dumping data for table `#__componentbuilder_help_document` diff --git a/admin/sql/updates/mysql/2.10.11.sql b/admin/sql/updates/mysql/2.10.11.sql new file mode 100644 index 000000000..7bc76eb0a --- /dev/null +++ b/admin/sql/updates/mysql/2.10.11.sql @@ -0,0 +1 @@ +ALTER TABLE `#__componentbuilder_joomla_module` ADD `target` TINYINT(1) NOT NULL DEFAULT 0 AFTER `system_name`; diff --git a/admin/sql/updates/mysql/2.10.12.sql b/admin/sql/updates/mysql/2.10.12.sql new file mode 100644 index 000000000..d1138bb0f --- /dev/null +++ b/admin/sql/updates/mysql/2.10.12.sql @@ -0,0 +1,3 @@ +ALTER TABLE `#__componentbuilder_language_translation` ADD `modules` TEXT NOT NULL AFTER `components`; + +ALTER TABLE `#__componentbuilder_language_translation` ADD `plugins` TEXT NOT NULL AFTER `modules`; diff --git a/admin/views/language_translations/tmpl/default_body.php b/admin/views/language_translations/tmpl/default_body.php index 30d94839b..b6e538f32 100644 --- a/admin/views/language_translations/tmpl/default_body.php +++ b/admin/views/language_translations/tmpl/default_body.php @@ -61,15 +61,98 @@ $edit = "index.php?option=com_componentbuilder&view=language_translations&task=l -
- get('language_translation.edit')): ?> - source; ?> - checked_out): ?> - name, $item->checked_out_time, 'language_translations.', $canCheckin); ?> - - - source; ?> +
+ get('language_translation.edit')): ?> + source; ?> + checked_out): ?> + name, $item->checked_out_time, 'language_translations.', $canCheckin); ?> + + source; ?> + + translation)) + { + $translations = json_decode($item->translation, true); + if (ComponentbuilderHelper::checkArray($translations)) + { + foreach ($translations as $language) + { + if (isset($language['translation']) && ComponentbuilderHelper::checkString($language['translation']) + && isset($language['language']) && ComponentbuilderHelper::checkString($language['language'])) + { + $langBucket[$language['language']] = $language['language']; + } + } + } + } + // start how many usedin's + $counterUsedin = array(); + // set how many components use this string + if (ComponentbuilderHelper::checkJson($item->components)) + { + $item->components = json_decode($item->components, true); + } + if (($number = ComponentbuilderHelper::checkArray($item->components)) !== false) + { + if ($number == 1) + { + $counterUsedin[] = $number . ' ' . JText::_('COM_COMPONENTBUILDER_COMPONENT'); + } + else + { + $counterUsedin[] = $number . ' ' . JText::_('COM_COMPONENTBUILDER_COMPONENTS'); + } + } + // set how many modules use this string + if (ComponentbuilderHelper::checkJson($item->modules)) + { + $item->modules = json_decode($item->modules, true); + } + if (($number = ComponentbuilderHelper::checkArray($item->modules)) !== false) + { + if ($number == 1) + { + $counterUsedin[] = $number . ' ' . JText::_('COM_COMPONENTBUILDER_MODULE'); + } + else + { + $counterUsedin[] = $number . ' ' . JText::_('COM_COMPONENTBUILDER_MODULES'); + } + } + // set how many plugins use this string + if (ComponentbuilderHelper::checkJson($item->plugins)) + { + $item->plugins = json_decode($item->plugins, true); + } + if (($number = ComponentbuilderHelper::checkArray($item->plugins)) !== false) + { + if ($number == 1) + { + $counterUsedin[] = $number . ' ' . JText::_('COM_COMPONENTBUILDER_PLUGIN'); + } + else + { + $counterUsedin[] = $number . ' ' . JText::_('COM_COMPONENTBUILDER_PLUGINS'); + } + } + // build the numbers + $numbersUsedin = ''; + if (ComponentbuilderHelper::checkArray($counterUsedin)) + { + $numbersUsedin = '
' . JText::_('COM_COMPONENTBUILDER_USED_IN') . ' ' . implode('
', $counterUsedin); + } + // load the languages to the string + if (ComponentbuilderHelper::checkArray($langBucket)) + { + echo '
' . JText::_('COM_COMPONENTBUILDER_ALREADY_TRANSLATED_INTO') . ' (' . implode(', ', $langBucket) . ')' . $numbersUsedin . ''; + } + else + { + echo '
(' . JText::_('COM_COMPONENTBUILDER_NOTRANSLATION') . ')' . $numbersUsedin . ''; + } + ?>
diff --git a/componentbuilder.xml b/componentbuilder.xml index 7f5327984..4a54c3ebc 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,15 +1,15 @@ COM_COMPONENTBUILDER - 13th March, 2020 + 24th March, 2020 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - 2.10.12 + 2.10.13 Component Builder (v.2.10.12) +

Component Builder (v.2.10.13)

The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is 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 f72ddbb73..237904a04 100644 --- a/componentbuilder_update_server.xml +++ b/componentbuilder_update_server.xml @@ -951,4 +951,21 @@ http://www.joomlacomponentbuilder.com + + Component Builder + Builds Complex Joomla Components + com_componentbuilder + component + 2.10.13 + http://www.joomlacomponentbuilder.com + + http://domain.com/demo.zip + + + stable + + Llewellyn van der Merwe + http://www.joomlacomponentbuilder.com + + \ No newline at end of file diff --git a/script.php b/script.php index ff5c32189..72f8fab3f 100644 --- a/script.php +++ b/script.php @@ -6166,9 +6166,9 @@ class com_componentbuilderInstallerScript $language_translation->type_title = 'Componentbuilder Language_translation'; $language_translation->type_alias = 'com_componentbuilder.language_translation'; $language_translation->table = '{"special": {"dbtable": "#__componentbuilder_language_translation","key": "id","type": "Language_translation","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $language_translation->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "source","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": {"source":"source","components":"components"}}'; + $language_translation->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "source","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": {"source":"source","plugins":"plugins","modules":"modules","components":"components"}}'; $language_translation->router = 'ComponentbuilderHelperRoute::getLanguage_translationRoute'; - $language_translation->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language_translation.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"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": "components","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $language_translation->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language_translation.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"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": "plugins","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "modules","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "components","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $language_translation_Inserted = $db->insertObject('#__content_types', $language_translation); @@ -7931,9 +7931,9 @@ class com_componentbuilderInstallerScript $language_translation->type_title = 'Componentbuilder Language_translation'; $language_translation->type_alias = 'com_componentbuilder.language_translation'; $language_translation->table = '{"special": {"dbtable": "#__componentbuilder_language_translation","key": "id","type": "Language_translation","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $language_translation->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "source","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": {"source":"source","components":"components"}}'; + $language_translation->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "source","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": {"source":"source","plugins":"plugins","modules":"modules","components":"components"}}'; $language_translation->router = 'ComponentbuilderHelperRoute::getLanguage_translationRoute'; - $language_translation->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language_translation.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"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": "components","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $language_translation->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language_translation.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"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": "plugins","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "modules","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "components","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if language_translation type is already in content_type DB. $language_translation_id = null; @@ -9115,7 +9115,7 @@ class com_componentbuilderInstallerScript echo ' -

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

'; +

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

'; // Set db if not set already. if (!isset($db)) diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php index dfbae3ce2..2fdc0d030 100644 --- a/site/helpers/componentbuilder.php +++ b/site/helpers/componentbuilder.php @@ -5603,7 +5603,7 @@ abstract class ComponentbuilderHelper /** - * Change to nice fancy date + * Change to nice fancy date */ public static function fancyDate($date) { @@ -5615,7 +5615,7 @@ abstract class ComponentbuilderHelper } /** - * get date based in period past + * get date based in period past */ public static function fancyDynamicDate($date) { @@ -5641,7 +5641,7 @@ abstract class ComponentbuilderHelper } /** - * Change to nice fancy day time and date + * Change to nice fancy day time and date */ public static function fancyDayTimeDate($time) { @@ -5653,7 +5653,7 @@ abstract class ComponentbuilderHelper } /** - * Change to nice fancy time and date + * Change to nice fancy time and date */ public static function fancyDateTime($time) { @@ -5665,7 +5665,7 @@ abstract class ComponentbuilderHelper } /** - * Change to nice hour:minutes time + * Change to nice hour:minutes time */ public static function fancyTime($time) { @@ -5677,31 +5677,91 @@ abstract class ComponentbuilderHelper } /** - * set the date as 2004/05 (for charts) + * set the date day as Sunday through Saturday */ - public static function setYearMonth($date) + public static function setDayName($date) { if (!self::isValidTimeStamp($date)) { $date = strtotime($date); } - return date('Y/m', $date); + return date('l', $date); + } + + /** + * set the date month as January through December + */ + public static function setMonthName($date) + { + if (!self::isValidTimeStamp($date)) + { + $date = strtotime($date); + } + return date('F', $date); + } + + /** + * set the date day as 1st + */ + public static function setDay($date) + { + if (!self::isValidTimeStamp($date)) + { + $date = strtotime($date); + } + return date('jS', $date); + } + + /** + * set the date month as 5 + */ + public static function setMonth($date) + { + if (!self::isValidTimeStamp($date)) + { + $date = strtotime($date); + } + return date('n', $date); + } + + /** + * set the date year as 2004 (for charts) + */ + public static function setYear($date) + { + if (!self::isValidTimeStamp($date)) + { + $date = strtotime($date); + } + return date('Y', $date); + } + + /** + * set the date as 2004/05 (for charts) + */ + public static function setYearMonth($date, $spacer = '/') + { + if (!self::isValidTimeStamp($date)) + { + $date = strtotime($date); + } + return date('Y' . $spacer . 'm', $date); } /** * set the date as 2004/05/03 (for charts) */ - public static function setYearMonthDay($date) + public static function setYearMonthDay($date, $spacer = '/') { if (!self::isValidTimeStamp($date)) { $date = strtotime($date); } - return date('Y/m/d', $date); + return date('Y' . $spacer . 'm' . $spacer . 'd', $date); } /** - * Check if string is a valid time stamp + * Check if string is a valid time stamp */ public static function isValidTimeStamp($timestamp) { -- 2.40.1 From 230834057ab5fef3410312fec9029e7e5df59ddb Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Sat, 28 Mar 2020 15:34:14 +0200 Subject: [PATCH 7/8] Formatted compiler classes with the Joomla standards in PHPstorm. Added translation for plugin and module areas. Resolve gh-503 gh-493 --- README.md | 6 +- admin/README.txt | 6 +- admin/helpers/compiler.php | 909 +- admin/helpers/compiler/a_Get.php | 6399 ++++-- admin/helpers/compiler/b_Structure.php | 1825 +- admin/helpers/compiler/c_Fields.php | 3240 ++- admin/helpers/compiler/e_Interpretation.php | 19660 +++++++++++++----- admin/helpers/compiler/f_Infusion.php | 1786 +- componentbuilder.xml | 2 +- 9 files changed, 24722 insertions(+), 9111 deletions(-) diff --git a/README.md b/README.md index 734b6a429..b321ef0f6 100644 --- a/README.md +++ b/README.md @@ -144,14 +144,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 24th March, 2020 ++ *Last Build*: 28th March, 2020 + *Version*: 2.10.13 + *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **280169** ++ *Line count*: **280177** + *Field count*: **1512** + *File count*: **1771** -+ *Folder count*: **287** ++ *Folder count*: **296** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/README.txt b/admin/README.txt index 734b6a429..b321ef0f6 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -144,14 +144,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 24th March, 2020 ++ *Last Build*: 28th March, 2020 + *Version*: 2.10.13 + *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **280169** ++ *Line count*: **280177** + *Field count*: **1512** + *File count*: **1771** -+ *Folder count*: **287** ++ *Folder count*: **296** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/helpers/compiler.php b/admin/helpers/compiler.php index 7928f0e45..f9e1389f7 100644 --- a/admin/helpers/compiler.php +++ b/admin/helpers/compiler.php @@ -5,7 +5,7 @@ * @created 30th April, 2015 * @author Llewellyn van der Merwe * @github Joomla Component Builder - * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @copyright Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -41,13 +41,14 @@ class Compiler extends Infusion * * @var string */ - public $filepath = array( - 'component' => '', - 'component-folder' => '', - 'package' => '', - 'plugins' => array(), - 'plugins-folders' => array(), - 'modules' => array() + public $filepath + = array( + 'component' => '', + 'component-folder' => '', + 'package' => '', + 'plugins' => array(), + 'plugins-folders' => array(), + 'modules' => array() ); // fixed pathes @@ -67,12 +68,14 @@ class Compiler extends Infusion if (parent::__construct($config)) { // set temp directory - $comConfig = JFactory::getConfig(); + $comConfig = JFactory::getConfig(); $this->tempPath = $comConfig->get('tmp_path'); // set some folder paths in relation to distribution if ($config['backup']) { - $this->backupPath = $this->params->get('backup_folder_path', $this->tempPath); + $this->backupPath = $this->params->get( + 'backup_folder_path', $this->tempPath + ); $this->dynamicIntegration = true; } // set local repos switch @@ -86,60 +89,111 @@ class Compiler extends Infusion // first remove the files and folders $this->removeFolder($this->componentPath . '/site'); // clear form component xml - $xmlPath = $this->componentPath . '/' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '.xml'; - $componentXML = ComponentbuilderHelper::getFileContents($xmlPath); - $textToSite = ComponentbuilderHelper::getBetween($componentXML, '', ''); - $textToSiteLang = ComponentbuilderHelper::getBetween($componentXML, '', ''); - $componentXML = str_replace(array('' . $textToSite . "", '' . $textToSiteLang . ""), array('', ''), $componentXML); + $xmlPath = $this->componentPath . '/' + . $this->fileContentStatic[$this->hhh . 'component' + . $this->hhh] . '.xml'; + $componentXML = ComponentbuilderHelper::getFileContents( + $xmlPath + ); + $textToSite = ComponentbuilderHelper::getBetween( + $componentXML, '', '' + ); + $textToSiteLang = ComponentbuilderHelper::getBetween( + $componentXML, '', '' + ); + $componentXML = str_replace( + array('' . $textToSite . "", + '' . $textToSiteLang + . ""), array('', ''), $componentXML + ); $this->writeFile($xmlPath, $componentXML); } // Trigger Event: jcb_ce_onBeforeUpdateFiles - $this->triggerEvent('jcb_ce_onBeforeUpdateFiles', array(&$this->componentContext, $this)); + $this->triggerEvent( + 'jcb_ce_onBeforeUpdateFiles', + array(&$this->componentContext, $this) + ); // now update the files if (!$this->updateFiles()) { return false; } // Trigger Event: jcb_ce_onBeforeGetCustomCode - $this->triggerEvent('jcb_ce_onBeforeGetCustomCode', array(&$this->componentContext, $this)); + $this->triggerEvent( + 'jcb_ce_onBeforeGetCustomCode', + array(&$this->componentContext, $this) + ); // now insert into the new files if ($this->getCustomCode()) { // Trigger Event: jcb_ce_onBeforeAddCustomCode - $this->triggerEvent('jcb_ce_onBeforeAddCustomCode', array(&$this->componentContext, $this)); + $this->triggerEvent( + 'jcb_ce_onBeforeAddCustomCode', + array(&$this->componentContext, $this) + ); $this->addCustomCode(); } // Trigger Event: jcb_ce_onBeforeSetLangFileData - $this->triggerEvent('jcb_ce_onBeforeSetLangFileData', array(&$this->componentContext, $this)); + $this->triggerEvent( + 'jcb_ce_onBeforeSetLangFileData', + array(&$this->componentContext, $this) + ); // set the lang data now $this->setLangFileData(); // set the language notice if it was set - if (ComponentbuilderHelper::checkArray($this->langNot) || ComponentbuilderHelper::checkArray($this->langSet)) + if (ComponentbuilderHelper::checkArray($this->langNot) + || ComponentbuilderHelper::checkArray($this->langSet)) { if (ComponentbuilderHelper::checkArray($this->langNot)) { - $this->app->enqueueMessage(JText::_('

Language Warning

'), 'Warning'); + $this->app->enqueueMessage( + JText::_('

Language Warning

'), 'Warning' + ); foreach ($this->langNot as $tag => $percentage) { - $this->app->enqueueMessage(JText::sprintf('The %s language has %s% translated, you will need to translate %s% of the language strings before it will be added.', $tag, $percentage, $this->percentageLanguageAdd), 'Warning'); + $this->app->enqueueMessage( + JText::sprintf( + 'The %s language has %s% translated, you will need to translate %s% of the language strings before it will be added.', + $tag, $percentage, $this->percentageLanguageAdd + ), 'Warning' + ); } - $this->app->enqueueMessage(JText::_('

Language Notice

'), 'Notice'); - $this->app->enqueueMessage(JText::sprintf('You can change this percentage of translated strings required in the global options of JCB.
Please watch this tutorial for more help surrounding the JCB translations manager.', '"https://youtu.be/zzAcVkn_cWU?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE" target="_blank" title="JCB Tutorial surrounding Translation Manager"'), 'Notice'); + $this->app->enqueueMessage( + JText::_('

Language Notice

'), 'Notice' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'You can change this percentage of translated strings required in the global options of JCB.
Please watch this tutorial for more help surrounding the JCB translations manager.', + '"https://youtu.be/zzAcVkn_cWU?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE" target="_blank" title="JCB Tutorial surrounding Translation Manager"' + ), 'Notice' + ); } // set why the strings were added - $whyAddedLang = JText::sprintf('because more then %s% of the strings have been translated.', $this->percentageLanguageAdd); + $whyAddedLang = JText::sprintf( + 'because more then %s% of the strings have been translated.', + $this->percentageLanguageAdd + ); if ($this->debugLinenr) { - $whyAddedLang = JText::_('because the debugging mode is on. (debug line numbers)'); + $whyAddedLang = JText::_( + 'because the debugging mode is on. (debug line numbers)' + ); } // show languages that were added if (ComponentbuilderHelper::checkArray($this->langSet)) { - $this->app->enqueueMessage(JText::_('

Language Notice

'), 'Notice'); + $this->app->enqueueMessage( + JText::_('

Language Notice

'), 'Notice' + ); foreach ($this->langSet as $tag => $percentage) { - $this->app->enqueueMessage(JText::sprintf('The %s language has %s% translated. Was addeded %s', $tag, $percentage, $whyAddedLang), 'Notice'); + $this->app->enqueueMessage( + JText::sprintf( + 'The %s language has %s% translated. Was addeded %s', + $tag, $percentage, $whyAddedLang + ), 'Notice' + ); } } } @@ -166,29 +220,51 @@ class Compiler extends Infusion { if (ComponentbuilderHelper::checkArray($this->langMatch)) { - $mismatch = array_diff(array_unique($this->langMismatch), array_unique($this->langMatch)); + $mismatch = array_diff( + array_unique($this->langMismatch), + array_unique($this->langMatch) + ); } else { $mismatch = array_unique($this->langMismatch); } // set a notice if we have a mismatch - if (isset($mismatch) && ComponentbuilderHelper::checkArray($mismatch)) + if (isset($mismatch) + && ComponentbuilderHelper::checkArray( + $mismatch + )) { - $this->app->enqueueMessage(JText::_('

Language Warning

'), 'Warning'); + $this->app->enqueueMessage( + JText::_('

Language Warning

'), 'Warning' + ); if (count((array) $mismatch) > 1) { - $this->app->enqueueMessage(JText::_('

Please check the following mismatching Joomla.JText language constants.

'), 'Warning'); + $this->app->enqueueMessage( + JText::_( + '

Please check the following mismatching Joomla.JText language constants.

' + ), 'Warning' + ); } else { - $this->app->enqueueMessage(JText::_('

Please check the following mismatch Joomla.JText language constant.

'), 'Warning'); + $this->app->enqueueMessage( + JText::_( + '

Please check the following mismatch Joomla.JText language constant.

' + ), 'Warning' + ); } // add the mismatching issues foreach ($mismatch as $string) { - $constant = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($string, 'U'); - $this->app->enqueueMessage(JText::sprintf('The Joomla.JText._('%s') language constant for %s does not have a corresponding JText::script('%s') decalaration, please add it.', $constant, $string, $string), 'Warning'); + $constant = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString($string, 'U'); + $this->app->enqueueMessage( + JText::sprintf( + 'The Joomla.JText._('%s') language constant for %s does not have a corresponding JText::script('%s') decalaration, please add it.', + $constant, $string, $string + ), 'Warning' + ); } } } @@ -198,24 +274,35 @@ class Compiler extends Infusion // number of external code strings $externalCount = count($this->externalCodeString); // the correct string - $externalCodeString = ($externalCount == 1) ? JText::_('code/string') : JText::_('code/strings'); + $externalCodeString = ($externalCount == 1) ? JText::_( + 'code/string' + ) : JText::_('code/strings'); // the notice - $this->app->enqueueMessage(JText::_('

External Code Notice

'), 'Notice'); - $this->app->enqueueMessage(JText::sprintf('There has been %s - %s added to this component as EXTERNALCODE. To avoid shipping your component with malicious %s always make sure that the correct code/string values were used.', $externalCount, $externalCodeString, $externalCodeString), 'Notice'); + $this->app->enqueueMessage( + JText::_('

External Code Notice

'), 'Notice' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'There has been %s - %s added to this component as EXTERNALCODE. To avoid shipping your component with malicious %s always make sure that the correct code/string values were used.', + $externalCount, $externalCodeString, $externalCodeString + ), 'Notice' + ); } // end the timer here - $this->time_end = microtime(true); + $this->time_end = microtime(true); $this->secondsCompiled = $this->time_end - $this->time_start; + // completed the compilation return true; } + return false; } /** * Set the line number in comments * - * @param int $nr The line number + * @param int $nr The line number * * @return void * @@ -226,6 +313,7 @@ class Compiler extends Infusion { return ' [Compiler ' . $nr . ']'; } + return ''; } @@ -237,7 +325,10 @@ 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'])) + if (isset($this->newFiles['static']) + && ComponentbuilderHelper::checkArray($this->newFiles['static']) + && isset($this->newFiles['dynamic']) + && ComponentbuilderHelper::checkArray($this->newFiles['dynamic'])) { // get the bom file $bom = ComponentbuilderHelper::getFileContents($this->bomPath); @@ -246,13 +337,18 @@ class Compiler extends Infusion { if (JFile::exists($static['path'])) { - $this->setFileContent($static['name'], $static['path'], $bom); + $this->setFileContent( + $static['name'], $static['path'], $bom + ); } } // now we do the dynamic files foreach ($this->newFiles['dynamic'] as $view => $files) { - if (isset($this->fileContentDynamic[$view]) && ComponentbuilderHelper::checkArray($this->fileContentDynamic[$view])) + if (isset($this->fileContentDynamic[$view]) + && ComponentbuilderHelper::checkArray( + $this->fileContentDynamic[$view] + )) { foreach ($files as $file) { @@ -260,7 +356,10 @@ class Compiler extends Infusion { if (JFile::exists($file['path'])) { - $this->setFileContent($file['name'], $file['path'], $bom, $file['view']); + $this->setFileContent( + $file['name'], $file['path'], $bom, + $file['view'] + ); } } } @@ -275,37 +374,59 @@ class Compiler extends Infusion { foreach ($this->joomlaModules as $module) { - if (ComponentbuilderHelper::checkObject($module) && isset($this->newFiles[$module->key]) && ComponentbuilderHelper::checkArray($this->newFiles[$module->key])) + if (ComponentbuilderHelper::checkObject($module) + && isset($this->newFiles[$module->key]) + && ComponentbuilderHelper::checkArray( + $this->newFiles[$module->key] + )) { // move field or rule if needed - if (isset($module->fields_rules_paths) && $module->fields_rules_paths == 2) + if (isset($module->fields_rules_paths) + && $module->fields_rules_paths == 2) { // check the config fields - if (isset($module->config_fields) && ComponentbuilderHelper::checkArray($module->config_fields)) + if (isset($module->config_fields) + && ComponentbuilderHelper::checkArray( + $module->config_fields + )) { - foreach ($module->config_fields as $field_name => $fieldsets) + foreach ( + $module->config_fields as $field_name => + $fieldsets + ) { foreach ($fieldsets as $fieldset => $fields) { foreach ($fields as $field) { - $this->moveFieldsRules($field, $module->folder_path); + $this->moveFieldsRules( + $field, $module->folder_path + ); } } } } // check the fieldsets - if (isset($module->form_files) && ComponentbuilderHelper::checkArray($module->form_files)) + if (isset($module->form_files) + && ComponentbuilderHelper::checkArray( + $module->form_files + )) { - foreach($module->form_files as $file => $files) + foreach ($module->form_files as $file => $files) { - foreach ($files as $field_name => $fieldsets) + foreach ( + $files as $field_name => $fieldsets + ) { - foreach ($fieldsets as $fieldset => $fields) + foreach ( + $fieldsets as $fieldset => $fields + ) { foreach ($fields as $field) { - $this->moveFieldsRules($field, $module->folder_path); + $this->moveFieldsRules( + $field, $module->folder_path + ); } } } @@ -317,7 +438,10 @@ class Compiler extends Infusion { if (JFile::exists($module_file['path'])) { - $this->setFileContent($module_file['name'], $module_file['path'], $bom, $module->key); + $this->setFileContent( + $module_file['name'], $module_file['path'], + $bom, $module->key + ); } } // free up some memory @@ -331,37 +455,59 @@ class Compiler extends Infusion { foreach ($this->joomlaPlugins as $plugin) { - if (ComponentbuilderHelper::checkObject($plugin) && isset($this->newFiles[$plugin->key]) && ComponentbuilderHelper::checkArray($this->newFiles[$plugin->key])) + if (ComponentbuilderHelper::checkObject($plugin) + && isset($this->newFiles[$plugin->key]) + && ComponentbuilderHelper::checkArray( + $this->newFiles[$plugin->key] + )) { // move field or rule if needed - if (isset($plugin->fields_rules_paths) && $plugin->fields_rules_paths == 2) + if (isset($plugin->fields_rules_paths) + && $plugin->fields_rules_paths == 2) { // check the config fields - if (isset($plugin->config_fields) && ComponentbuilderHelper::checkArray($plugin->config_fields)) + if (isset($plugin->config_fields) + && ComponentbuilderHelper::checkArray( + $plugin->config_fields + )) { - foreach ($plugin->config_fields as $field_name => $fieldsets) + foreach ( + $plugin->config_fields as $field_name => + $fieldsets + ) { foreach ($fieldsets as $fieldset => $fields) { foreach ($fields as $field) { - $this->moveFieldsRules($field, $plugin->folder_path); + $this->moveFieldsRules( + $field, $plugin->folder_path + ); } } } } // check the fieldsets - if (isset($plugin->form_files) && ComponentbuilderHelper::checkArray($plugin->form_files)) + if (isset($plugin->form_files) + && ComponentbuilderHelper::checkArray( + $plugin->form_files + )) { - foreach($plugin->form_files as $file => $files) + foreach ($plugin->form_files as $file => $files) { - foreach ($files as $field_name => $fieldsets) + foreach ( + $files as $field_name => $fieldsets + ) { - foreach ($fieldsets as $fieldset => $fields) + foreach ( + $fieldsets as $fieldset => $fields + ) { foreach ($fields as $field) { - $this->moveFieldsRules($field, $plugin->folder_path); + $this->moveFieldsRules( + $field, $plugin->folder_path + ); } } } @@ -373,7 +519,10 @@ class Compiler extends Infusion { if (JFile::exists($plugin_file['path'])) { - $this->setFileContent($plugin_file['name'], $plugin_file['path'], $bom, $plugin->key); + $this->setFileContent( + $plugin_file['name'], $plugin_file['path'], + $bom, $plugin->key + ); } } // free up some memory @@ -382,8 +531,10 @@ class Compiler extends Infusion } } } + return true; } + return false; } @@ -396,7 +547,10 @@ class Compiler extends Infusion protected function setFileContent(&$name, &$path, &$bom, $view = null) { // Trigger Event: jcb_ce_onBeforeSetFileContent - $this->triggerEvent('jcb_ce_onBeforeSetFileContent', array(&$this->componentContext, &$name, &$path, &$bom, &$view)); + $this->triggerEvent( + 'jcb_ce_onBeforeSetFileContent', + array(&$this->componentContext, &$name, &$path, &$bom, &$view) + ); // set the file name $this->fileContentStatic[$this->hhh . 'FILENAME' . $this->hhh] = $name; // check if the file should get PHP opening @@ -408,11 +562,17 @@ class Compiler extends Infusion // get content of the file $string = ComponentbuilderHelper::getFileContents($path); // Trigger Event: jcb_ce_onGetFileContents - $this->triggerEvent('jcb_ce_onGetFileContents', array(&$this->componentContext, &$string, &$name, &$path, &$bom, &$view)); + $this->triggerEvent( + 'jcb_ce_onGetFileContents', + array(&$this->componentContext, &$string, &$name, &$path, &$bom, + &$view) + ); // see if we should add a BOM if (strpos($string, $this->hhh . 'BOM' . $this->hhh) !== false) { - list($wast, $code) = explode($this->hhh . 'BOM' . $this->hhh, $string); + list($wast, $code) = explode( + $this->hhh . 'BOM' . $this->hhh, $string + ); $string = $php . $bom . $code; } // set the answer @@ -420,7 +580,9 @@ class Compiler extends Infusion // set the dynamic answer if ($view) { - $answer = $this->setPlaceholders($answer, $this->fileContentDynamic[$view], 3); + $answer = $this->setPlaceholders( + $answer, $this->fileContentDynamic[$view], 3 + ); } // check if this file needs extra care :) if (isset($this->updateFileContent[$path])) @@ -428,7 +590,11 @@ class Compiler extends Infusion $answer = $this->setDynamicValues($answer); } // Trigger Event: jcb_ce_onBeforeSetFileContent - $this->triggerEvent('jcb_ce_onBeforeWriteFileContent', array(&$this->componentContext, &$answer, &$name, &$path, &$bom, &$view)); + $this->triggerEvent( + 'jcb_ce_onBeforeWriteFileContent', + array(&$this->componentContext, &$answer, &$name, &$path, &$bom, + &$view) + ); // add answer back to file $this->writeFile($path, $answer); // count the file lines @@ -444,15 +610,24 @@ class Compiler extends Infusion protected function setUpdateServer() { // move the component update server to host - if ($this->componentData->add_update_server == 1 && $this->componentData->update_server_target == 1 - && isset($this->updateServerFileName) && $this->dynamicIntegration) + if ($this->componentData->add_update_server == 1 + && $this->componentData->update_server_target == 1 + && isset($this->updateServerFileName) + && $this->dynamicIntegration) { - $update_server_xml_path = $this->componentPath . '/' . $this->updateServerFileName . '.xml'; + $update_server_xml_path = $this->componentPath . '/' + . $this->updateServerFileName . '.xml'; // make sure we have the correct file - if (JFile::exists($update_server_xml_path) && isset($this->componentData->update_server)) + if (JFile::exists($update_server_xml_path) + && isset($this->componentData->update_server)) { // move to server - ComponentbuilderHelper::moveToServer($update_server_xml_path, $this->updateServerFileName . '.xml', (int) $this->componentData->update_server, $this->componentData->update_server_protocol); + ComponentbuilderHelper::moveToServer( + $update_server_xml_path, + $this->updateServerFileName . '.xml', + (int) $this->componentData->update_server, + $this->componentData->update_server_protocol + ); // remove the local file JFile::delete($update_server_xml_path); } @@ -463,14 +638,27 @@ class Compiler extends Infusion foreach ($this->joomlaPlugins as $plugin) { if (ComponentbuilderHelper::checkObject($plugin) - && isset($plugin->add_update_server) && $plugin->add_update_server == 1 - && isset($plugin->update_server_target) && $plugin->update_server_target == 1 - && isset($plugin->update_server) && is_numeric($plugin->update_server) && $plugin->update_server > 0 - && isset($plugin->update_server_xml_path) && JFile::exists($plugin->update_server_xml_path) - && isset($plugin->update_server_xml_file_name) && ComponentbuilderHelper::checkString($plugin->update_server_xml_file_name)) + && isset($plugin->add_update_server) + && $plugin->add_update_server == 1 + && isset($plugin->update_server_target) + && $plugin->update_server_target == 1 + && isset($plugin->update_server) + && is_numeric($plugin->update_server) + && $plugin->update_server > 0 + && isset($plugin->update_server_xml_path) + && JFile::exists($plugin->update_server_xml_path) + && isset($plugin->update_server_xml_file_name) + && ComponentbuilderHelper::checkString( + $plugin->update_server_xml_file_name + )) { // move to server - ComponentbuilderHelper::moveToServer($plugin->update_server_xml_path, $plugin->update_server_xml_file_name, (int) $plugin->update_server, $plugin->update_server_protocol); + ComponentbuilderHelper::moveToServer( + $plugin->update_server_xml_path, + $plugin->update_server_xml_file_name, + (int) $plugin->update_server, + $plugin->update_server_protocol + ); // remove the local file JFile::delete($plugin->update_server_xml_path); } @@ -482,7 +670,11 @@ class Compiler extends Infusion protected function fixLicenseValues($data) { // check if these files have its own config data) - if (isset($data['config']) && ComponentbuilderHelper::checkArray($data['config']) && $this->componentData->mvc_versiondate == 1) + if (isset($data['config']) + && ComponentbuilderHelper::checkArray( + $data['config'] + ) + && $this->componentData->mvc_versiondate == 1) { foreach ($data['config'] as $key => $value) { @@ -502,12 +694,19 @@ class Compiler extends Infusion } $this->fileContentStatic[$key] = $value; } + return true; } // else insure to reset to global - $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh] = $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh . 'GLOBAL']; - $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh] = $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh . 'GLOBAL']; - $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh] = $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh . 'GLOBAL']; + $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh] + = $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh + . 'GLOBAL']; + $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh] + = $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh + . 'GLOBAL']; + $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh] + = $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh + . 'GLOBAL']; } // set all global numbers @@ -517,28 +716,32 @@ class Compiler extends Infusion $this->pageCount = round($this->lineCount / 56); // setup the unrealistic numbers $this->folderSeconds = $this->folderCount * 5; - $this->fileSeconds = $this->fileCount * 5; - $this->lineSeconds = $this->lineCount * 10; - $this->seconds = $this->folderSeconds + $this->fileSeconds + $this->lineSeconds; - $this->totalHours = round($this->seconds / 3600); - $this->totalDays = round($this->totalHours / 8); + $this->fileSeconds = $this->fileCount * 5; + $this->lineSeconds = $this->lineCount * 10; + $this->seconds = $this->folderSeconds + $this->fileSeconds + + $this->lineSeconds; + $this->totalHours = round($this->seconds / 3600); + $this->totalDays = round($this->totalHours / 8); // setup the more realistic numbers $this->secondsDebugging = $this->seconds / 4; - $this->secondsPlanning = $this->seconds / 7; - $this->secondsMapping = $this->seconds / 10; - $this->secondsOffice = $this->seconds / 6; - $this->actualSeconds = $this->folderSeconds + $this->fileSeconds + $this->lineSeconds + $this->secondsDebugging + $this->secondsPlanning + $this->secondsMapping + $this->secondsOffice; + $this->secondsPlanning = $this->seconds / 7; + $this->secondsMapping = $this->seconds / 10; + $this->secondsOffice = $this->seconds / 6; + $this->actualSeconds = $this->folderSeconds + $this->fileSeconds + + $this->lineSeconds + $this->secondsDebugging + + $this->secondsPlanning + $this->secondsMapping + + $this->secondsOffice; $this->actualTotalHours = round($this->actualSeconds / 3600); - $this->actualTotalDays = round($this->actualTotalHours / 8); - $this->debuggingHours = round($this->secondsDebugging / 3600); - $this->planningHours = round($this->secondsPlanning / 3600); - $this->mappingHours = round($this->secondsMapping / 3600); - $this->officeHours = round($this->secondsOffice / 3600); + $this->actualTotalDays = round($this->actualTotalHours / 8); + $this->debuggingHours = round($this->secondsDebugging / 3600); + $this->planningHours = round($this->secondsPlanning / 3600); + $this->mappingHours = round($this->secondsMapping / 3600); + $this->officeHours = round($this->secondsOffice / 3600); // the actual time spent $this->actualHoursSpent = $this->actualTotalHours - $this->totalHours; - $this->actualDaysSpent = $this->actualTotalDays - $this->totalDays; + $this->actualDaysSpent = $this->actualTotalDays - $this->totalDays; // calculate the projects actual time frame of completion - $this->projectWeekTime = round($this->actualTotalDays / 5, 1); + $this->projectWeekTime = round($this->actualTotalDays / 5, 1); $this->projectMonthTime = round($this->actualTotalDays / 24, 1); } @@ -548,7 +751,10 @@ class Compiler extends Infusion $two = 0; foreach ($this->newFiles['static'] as $static) { - if (('README.md' === $static['name'] || 'README.txt' === $static['name']) && $this->componentData->addreadme && JFile::exists($static['path'])) + if (('README.md' === $static['name'] + || 'README.txt' === $static['name']) + && $this->componentData->addreadme + && JFile::exists($static['path'])) { $this->setReadMe($static['path']); $two++; @@ -564,7 +770,11 @@ class Compiler extends Infusion private function setReadMe($path) { // set readme data if not set already - if (!isset($this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh]) || $this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh] != $this->lineCount) + if (!isset( + $this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh] + ) + || $this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh] + != $this->lineCount) { $this->buildReadMeData(); } @@ -579,75 +789,137 @@ class Compiler extends Infusion private function buildReadMeData() { // set some defaults - $this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh] = $this->lineCount; - $this->fileContentStatic[$this->hhh . 'FIELD_COUNT' . $this->hhh] = $this->fieldCount; - $this->fileContentStatic[$this->hhh . 'FILE_COUNT' . $this->hhh] = $this->fileCount; - $this->fileContentStatic[$this->hhh . 'FOLDER_COUNT' . $this->hhh] = $this->folderCount; - $this->fileContentStatic[$this->hhh . 'PAGE_COUNT' . $this->hhh] = $this->pageCount; - $this->fileContentStatic[$this->hhh . 'folders' . $this->hhh] = $this->folderSeconds; - $this->fileContentStatic[$this->hhh . 'foldersSeconds' . $this->hhh] = $this->folderSeconds; - $this->fileContentStatic[$this->hhh . 'files' . $this->hhh] = $this->fileSeconds; - $this->fileContentStatic[$this->hhh . 'filesSeconds' . $this->hhh] = $this->fileSeconds; - $this->fileContentStatic[$this->hhh . 'lines' . $this->hhh] = $this->lineSeconds; - $this->fileContentStatic[$this->hhh . 'linesSeconds' . $this->hhh] = $this->lineSeconds; - $this->fileContentStatic[$this->hhh . 'seconds' . $this->hhh] = $this->actualSeconds; - $this->fileContentStatic[$this->hhh . 'actualSeconds' . $this->hhh] = $this->actualSeconds; - $this->fileContentStatic[$this->hhh . 'totalHours' . $this->hhh] = $this->totalHours; - $this->fileContentStatic[$this->hhh . 'totalDays' . $this->hhh] = $this->totalDays; - $this->fileContentStatic[$this->hhh . 'debugging' . $this->hhh] = $this->secondsDebugging; - $this->fileContentStatic[$this->hhh . 'secondsDebugging' . $this->hhh] = $this->secondsDebugging; - $this->fileContentStatic[$this->hhh . 'planning' . $this->hhh] = $this->secondsPlanning; - $this->fileContentStatic[$this->hhh . 'secondsPlanning' . $this->hhh] = $this->secondsPlanning; - $this->fileContentStatic[$this->hhh . 'mapping' . $this->hhh] = $this->secondsMapping; - $this->fileContentStatic[$this->hhh . 'secondsMapping' . $this->hhh] = $this->secondsMapping; - $this->fileContentStatic[$this->hhh . 'office' . $this->hhh] = $this->secondsOffice; - $this->fileContentStatic[$this->hhh . 'secondsOffice' . $this->hhh] = $this->secondsOffice; - $this->fileContentStatic[$this->hhh . 'actualTotalHours' . $this->hhh] = $this->actualTotalHours; - $this->fileContentStatic[$this->hhh . 'actualTotalDays' . $this->hhh] = $this->actualTotalDays; - $this->fileContentStatic[$this->hhh . 'debuggingHours' . $this->hhh] = $this->debuggingHours; - $this->fileContentStatic[$this->hhh . 'planningHours' . $this->hhh] = $this->planningHours; - $this->fileContentStatic[$this->hhh . 'mappingHours' . $this->hhh] = $this->mappingHours; - $this->fileContentStatic[$this->hhh . 'officeHours' . $this->hhh] = $this->officeHours; - $this->fileContentStatic[$this->hhh . 'actualHoursSpent' . $this->hhh] = $this->actualHoursSpent; - $this->fileContentStatic[$this->hhh . 'actualDaysSpent' . $this->hhh] = $this->actualDaysSpent; - $this->fileContentStatic[$this->hhh . 'projectWeekTime' . $this->hhh] = $this->projectWeekTime; - $this->fileContentStatic[$this->hhh . 'projectMonthTime' . $this->hhh] = $this->projectMonthTime; + $this->fileContentStatic[$this->hhh . 'LINE_COUNT' . $this->hhh] + = $this->lineCount; + $this->fileContentStatic[$this->hhh . 'FIELD_COUNT' . $this->hhh] + = $this->fieldCount; + $this->fileContentStatic[$this->hhh . 'FILE_COUNT' . $this->hhh] + = $this->fileCount; + $this->fileContentStatic[$this->hhh . 'FOLDER_COUNT' . $this->hhh] + = $this->folderCount; + $this->fileContentStatic[$this->hhh . 'PAGE_COUNT' . $this->hhh] + = $this->pageCount; + $this->fileContentStatic[$this->hhh . 'folders' . $this->hhh] + = $this->folderSeconds; + $this->fileContentStatic[$this->hhh . 'foldersSeconds' . $this->hhh] + = $this->folderSeconds; + $this->fileContentStatic[$this->hhh . 'files' . $this->hhh] + = $this->fileSeconds; + $this->fileContentStatic[$this->hhh . 'filesSeconds' . $this->hhh] + = $this->fileSeconds; + $this->fileContentStatic[$this->hhh . 'lines' . $this->hhh] + = $this->lineSeconds; + $this->fileContentStatic[$this->hhh . 'linesSeconds' . $this->hhh] + = $this->lineSeconds; + $this->fileContentStatic[$this->hhh . 'seconds' . $this->hhh] + = $this->actualSeconds; + $this->fileContentStatic[$this->hhh . 'actualSeconds' . $this->hhh] + = $this->actualSeconds; + $this->fileContentStatic[$this->hhh . 'totalHours' . $this->hhh] + = $this->totalHours; + $this->fileContentStatic[$this->hhh . 'totalDays' . $this->hhh] + = $this->totalDays; + $this->fileContentStatic[$this->hhh . 'debugging' . $this->hhh] + = $this->secondsDebugging; + $this->fileContentStatic[$this->hhh . 'secondsDebugging' . $this->hhh] + = $this->secondsDebugging; + $this->fileContentStatic[$this->hhh . 'planning' . $this->hhh] + = $this->secondsPlanning; + $this->fileContentStatic[$this->hhh . 'secondsPlanning' . $this->hhh] + = $this->secondsPlanning; + $this->fileContentStatic[$this->hhh . 'mapping' . $this->hhh] + = $this->secondsMapping; + $this->fileContentStatic[$this->hhh . 'secondsMapping' . $this->hhh] + = $this->secondsMapping; + $this->fileContentStatic[$this->hhh . 'office' . $this->hhh] + = $this->secondsOffice; + $this->fileContentStatic[$this->hhh . 'secondsOffice' . $this->hhh] + = $this->secondsOffice; + $this->fileContentStatic[$this->hhh . 'actualTotalHours' . $this->hhh] + = $this->actualTotalHours; + $this->fileContentStatic[$this->hhh . 'actualTotalDays' . $this->hhh] + = $this->actualTotalDays; + $this->fileContentStatic[$this->hhh . 'debuggingHours' . $this->hhh] + = $this->debuggingHours; + $this->fileContentStatic[$this->hhh . 'planningHours' . $this->hhh] + = $this->planningHours; + $this->fileContentStatic[$this->hhh . 'mappingHours' . $this->hhh] + = $this->mappingHours; + $this->fileContentStatic[$this->hhh . 'officeHours' . $this->hhh] + = $this->officeHours; + $this->fileContentStatic[$this->hhh . 'actualHoursSpent' . $this->hhh] + = $this->actualHoursSpent; + $this->fileContentStatic[$this->hhh . 'actualDaysSpent' . $this->hhh] + = $this->actualDaysSpent; + $this->fileContentStatic[$this->hhh . 'projectWeekTime' . $this->hhh] + = $this->projectWeekTime; + $this->fileContentStatic[$this->hhh . 'projectMonthTime' . $this->hhh] + = $this->projectMonthTime; } private function setLocalRepos() { // move it to the repo folder if set - if (isset($this->repoPath) && ComponentbuilderHelper::checkString($this->repoPath)) + if (isset($this->repoPath) + && ComponentbuilderHelper::checkString( + $this->repoPath + )) { // set the repo path - $repoFullPath = $this->repoPath . '/com_' . $this->componentData->sales_name . '__joomla_' . $this->joomlaVersion; + $repoFullPath = $this->repoPath . '/com_' + . $this->componentData->sales_name . '__joomla_' + . $this->joomlaVersion; // Trigger Event: jcb_ce_onBeforeUpdateRepo - $this->triggerEvent('jcb_ce_onBeforeUpdateRepo', array(&$this->componentContext, &$this->componentPath, &$repoFullPath, &$this->componentData)); + $this->triggerEvent( + 'jcb_ce_onBeforeUpdateRepo', + array(&$this->componentContext, &$this->componentPath, + &$repoFullPath, &$this->componentData) + ); // remove old data $this->removeFolder($repoFullPath, $this->componentData->toignore); // set the new data JFolder::copy($this->componentPath, $repoFullPath, '', true); // Trigger Event: jcb_ce_onAfterUpdateRepo - $this->triggerEvent('jcb_ce_onAfterUpdateRepo', array(&$this->componentContext, &$this->componentPath, &$repoFullPath, &$this->componentData)); + $this->triggerEvent( + 'jcb_ce_onAfterUpdateRepo', + array(&$this->componentContext, &$this->componentPath, + &$repoFullPath, &$this->componentData) + ); // move the modules to local folder repos if (ComponentbuilderHelper::checkArray($this->joomlaModules)) { foreach ($this->joomlaModules as $module) { - if (ComponentbuilderHelper::checkObject($module) && isset($module->file_name)) + if (ComponentbuilderHelper::checkObject($module) + && isset($module->file_name)) { - $module_context = 'module.' . $module->file_name . '.' . $module->id; + $module_context = 'module.' . $module->file_name . '.' + . $module->id; // set the repo path - $repoFullPath = $this->repoPath . '/' . $module->folder_name . '__joomla_' . $this->joomlaVersion; + $repoFullPath = $this->repoPath . '/' + . $module->folder_name . '__joomla_' + . $this->joomlaVersion; // Trigger Event: jcb_ce_onBeforeUpdateRepo - $this->triggerEvent('jcb_ce_onBeforeUpdateRepo', array(&$module_context, &$module->folder_path, &$repoFullPath, &$module)); + $this->triggerEvent( + 'jcb_ce_onBeforeUpdateRepo', + array(&$module_context, &$module->folder_path, + &$repoFullPath, &$module) + ); // remove old data - $this->removeFolder($repoFullPath, $this->componentData->toignore); + $this->removeFolder( + $repoFullPath, $this->componentData->toignore + ); // set the new data - JFolder::copy($module->folder_path, $repoFullPath, '', true); + JFolder::copy( + $module->folder_path, $repoFullPath, '', true + ); // Trigger Event: jcb_ce_onAfterUpdateRepo - $this->triggerEvent('jcb_ce_onAfterUpdateRepo', array(&$module_context, &$module->folder_path, &$repoFullPath, &$module)); + $this->triggerEvent( + 'jcb_ce_onAfterUpdateRepo', + array(&$module_context, &$module->folder_path, + &$repoFullPath, &$module) + ); } } } @@ -656,19 +928,35 @@ class Compiler extends Infusion { foreach ($this->joomlaPlugins as $plugin) { - if (ComponentbuilderHelper::checkObject($plugin) && isset($plugin->file_name)) + if (ComponentbuilderHelper::checkObject($plugin) + && isset($plugin->file_name)) { - $plugin_context = 'plugin.' . $plugin->file_name . '.' . $plugin->id; + $plugin_context = 'plugin.' . $plugin->file_name . '.' + . $plugin->id; // set the repo path - $repoFullPath = $this->repoPath . '/' . $plugin->folder_name . '__joomla_' . $this->joomlaVersion; + $repoFullPath = $this->repoPath . '/' + . $plugin->folder_name . '__joomla_' + . $this->joomlaVersion; // Trigger Event: jcb_ce_onBeforeUpdateRepo - $this->triggerEvent('jcb_ce_onBeforeUpdateRepo', array(&$plugin_context, &$plugin->folder_path, &$repoFullPath, &$plugin)); + $this->triggerEvent( + 'jcb_ce_onBeforeUpdateRepo', + array(&$plugin_context, &$plugin->folder_path, + &$repoFullPath, &$plugin) + ); // remove old data - $this->removeFolder($repoFullPath, $this->componentData->toignore); + $this->removeFolder( + $repoFullPath, $this->componentData->toignore + ); // set the new data - JFolder::copy($plugin->folder_path, $repoFullPath, '', true); + JFolder::copy( + $plugin->folder_path, $repoFullPath, '', true + ); // Trigger Event: jcb_ce_onAfterUpdateRepo - $this->triggerEvent('jcb_ce_onAfterUpdateRepo', array(&$plugin_context, &$plugin->folder_path, &$repoFullPath, &$plugin)); + $this->triggerEvent( + 'jcb_ce_onAfterUpdateRepo', + array(&$plugin_context, &$plugin->folder_path, + &$repoFullPath, &$plugin) + ); } } } @@ -680,41 +968,76 @@ class Compiler extends Infusion // Component Folder Name $this->filepath['component-folder'] = $this->componentFolderName; // the name of the zip file to create - $this->filepath['component'] = $this->tempPath . '/' . $this->filepath['component-folder'] . '.zip'; + $this->filepath['component'] = $this->tempPath . '/' + . $this->filepath['component-folder'] . '.zip'; // Trigger Event: jcb_ce_onBeforeZipComponent - $this->triggerEvent('jcb_ce_onBeforeZipComponent', array(&$this->componentContext, &$this->componentPath, &$this->filepath['component'], &$this->tempPath, &$this->componentFolderName, &$this->componentData)); + $this->triggerEvent( + 'jcb_ce_onBeforeZipComponent', + array(&$this->componentContext, &$this->componentPath, + &$this->filepath['component'], &$this->tempPath, + &$this->componentFolderName, &$this->componentData) + ); //create the zip file - if (ComponentbuilderHelper::zip($this->componentPath, $this->filepath['component'])) + if (ComponentbuilderHelper::zip( + $this->componentPath, $this->filepath['component'] + )) { // now move to backup if zip was made and backup is required if ($this->backupPath && $this->dynamicIntegration) { // Trigger Event: jcb_ce_onBeforeBackupZip - $this->triggerEvent('jcb_ce_onBeforeBackupZip', array(&$this->componentContext, &$this->filepath['component'], &$this->tempPath, &$this->backupPath, &$this->componentData)); + $this->triggerEvent( + 'jcb_ce_onBeforeBackupZip', array(&$this->componentContext, + &$this->filepath['component'], + &$this->tempPath, + &$this->backupPath, + &$this->componentData) + ); // copy the zip to backup path - JFile::copy($this->filepath['component'], $this->backupPath . '/' . $this->componentBackupName . '.zip'); + JFile::copy( + $this->filepath['component'], + $this->backupPath . '/' . $this->componentBackupName + . '.zip' + ); } // move to sales server host - if ($this->componentData->add_sales_server == 1 && $this->dynamicIntegration) + if ($this->componentData->add_sales_server == 1 + && $this->dynamicIntegration) { // make sure we have the correct file if (isset($this->componentData->sales_server)) { // Trigger Event: jcb_ce_onBeforeMoveToServer - $this->triggerEvent('jcb_ce_onBeforeMoveToServer', array(&$this->componentContext, &$this->filepath['component'], &$this->tempPath, &$this->componentSalesName, &$this->componentData)); + $this->triggerEvent( + 'jcb_ce_onBeforeMoveToServer', + array(&$this->componentContext, + &$this->filepath['component'], &$this->tempPath, + &$this->componentSalesName, &$this->componentData) + ); // move to server - ComponentbuilderHelper::moveToServer($this->filepath['component'], $this->componentSalesName . '.zip', (int) $this->componentData->sales_server, $this->componentData->sales_server_protocol); + ComponentbuilderHelper::moveToServer( + $this->filepath['component'], + $this->componentSalesName . '.zip', + (int) $this->componentData->sales_server, + $this->componentData->sales_server_protocol + ); } } // Trigger Event: jcb_ce_onAfterZipComponent - $this->triggerEvent('jcb_ce_onAfterZipComponent', array(&$this->componentContext, &$this->filepath['component'], &$this->tempPath, &$this->componentFolderName, &$this->componentData)); + $this->triggerEvent( + 'jcb_ce_onAfterZipComponent', + array(&$this->componentContext, &$this->filepath['component'], + &$this->tempPath, &$this->componentFolderName, + &$this->componentData) + ); // remove the component folder since we are done if ($this->removeFolder($this->componentPath)) { return true; } } + return false; } @@ -724,30 +1047,53 @@ class Compiler extends Infusion { foreach ($this->joomlaModules as $module) { - if (ComponentbuilderHelper::checkObject($module) && isset($module->zip_name) + if (ComponentbuilderHelper::checkObject($module) + && isset($module->zip_name) && ComponentbuilderHelper::checkString($module->zip_name) && isset($module->folder_path) - && ComponentbuilderHelper::checkString($module->folder_path)) + && ComponentbuilderHelper::checkString( + $module->folder_path + )) { // set module context $module_context = $module->file_name . '.' . $module->id; // Component Folder Name - $this->filepath['modules-folder'][$module->id] = $module->zip_name; + $this->filepath['modules-folder'][$module->id] + = $module->zip_name; // the name of the zip file to create - $this->filepath['modules'][$module->id] = $this->tempPath . '/' . $module->zip_name . '.zip'; + $this->filepath['modules'][$module->id] = $this->tempPath + . '/' . $module->zip_name . '.zip'; // Trigger Event: jcb_ce_onBeforeZipModule - $this->triggerEvent('jcb_ce_onBeforeZipModule', array(&$module_context, &$module->folder_path, &$this->filepath['modules'][$module->id], &$this->tempPath, &$module->zip_name, &$module)); + $this->triggerEvent( + 'jcb_ce_onBeforeZipModule', + array(&$module_context, &$module->folder_path, + &$this->filepath['modules'][$module->id], + &$this->tempPath, &$module->zip_name, &$module) + ); //create the zip file - if (ComponentbuilderHelper::zip($module->folder_path, $this->filepath['modules'][$module->id])) + if (ComponentbuilderHelper::zip( + $module->folder_path, + $this->filepath['modules'][$module->id] + )) { // now move to backup if zip was made and backup is required if ($this->backupPath) { $__module_context = 'module.' . $module_context; // Trigger Event: jcb_ce_onBeforeBackupZip - $this->triggerEvent('jcb_ce_onBeforeBackupZip', array(&$__module_context, &$this->filepath['modules'][$module->id], &$this->tempPath, &$this->backupPath, &$module)); + $this->triggerEvent( + 'jcb_ce_onBeforeBackupZip', + array(&$__module_context, + &$this->filepath['modules'][$module->id], + &$this->tempPath, &$this->backupPath, + &$module) + ); // copy the zip to backup path - JFile::copy($this->filepath['modules'][$module->id], $this->backupPath . '/' . $module->zip_name . '.zip'); + JFile::copy( + $this->filepath['modules'][$module->id], + $this->backupPath . '/' . $module->zip_name + . '.zip' + ); } // move to sales server host @@ -757,13 +1103,30 @@ class Compiler extends Infusion if (isset($module->sales_server)) { // Trigger Event: jcb_ce_onBeforeMoveToServer - $this->triggerEvent('jcb_ce_onBeforeMoveToServer', array(&$__module_context, &$this->filepath['modules'][$module->id], &$this->tempPath, &$module->zip_name, &$module)); + $this->triggerEvent( + 'jcb_ce_onBeforeMoveToServer', + array(&$__module_context, + &$this->filepath['modules'][$module->id], + &$this->tempPath, &$module->zip_name, + &$module) + ); // move to server - ComponentbuilderHelper::moveToServer($this->filepath['modules'][$module->id], $module->zip_name . '.zip', (int) $module->sales_server, $module->sales_server_protocol); + ComponentbuilderHelper::moveToServer( + $this->filepath['modules'][$module->id], + $module->zip_name . '.zip', + (int) $module->sales_server, + $module->sales_server_protocol + ); } } // Trigger Event: jcb_ce_onAfterZipModule - $this->triggerEvent('jcb_ce_onAfterZipModule', array(&$module_context, &$this->filepath['modules'][$module->id], &$this->tempPath, &$module->zip_name, &$module)); + $this->triggerEvent( + 'jcb_ce_onAfterZipModule', array(&$module_context, + &$this->filepath['modules'][$module->id], + &$this->tempPath, + &$module->zip_name, + &$module) + ); // remove the module folder since we are done $this->removeFolder($module->folder_path); } @@ -778,30 +1141,53 @@ class Compiler extends Infusion { foreach ($this->joomlaPlugins as $plugin) { - if (ComponentbuilderHelper::checkObject($plugin) && isset($plugin->zip_name) + if (ComponentbuilderHelper::checkObject($plugin) + && isset($plugin->zip_name) && ComponentbuilderHelper::checkString($plugin->zip_name) && isset($plugin->folder_path) - && ComponentbuilderHelper::checkString($plugin->folder_path)) + && ComponentbuilderHelper::checkString( + $plugin->folder_path + )) { // set plugin context $plugin_context = $plugin->file_name . '.' . $plugin->id; // Component Folder Name - $this->filepath['plugins-folder'][$plugin->id] = $plugin->zip_name; + $this->filepath['plugins-folder'][$plugin->id] + = $plugin->zip_name; // the name of the zip file to create - $this->filepath['plugins'][$plugin->id] = $this->tempPath . '/' . $plugin->zip_name . '.zip'; + $this->filepath['plugins'][$plugin->id] = $this->tempPath + . '/' . $plugin->zip_name . '.zip'; // Trigger Event: jcb_ce_onBeforeZipPlugin - $this->triggerEvent('jcb_ce_onBeforeZipPlugin', array(&$plugin_context, &$plugin->folder_path, &$this->filepath['plugins'][$plugin->id], &$this->tempPath, &$plugin->zip_name, &$plugin)); + $this->triggerEvent( + 'jcb_ce_onBeforeZipPlugin', + array(&$plugin_context, &$plugin->folder_path, + &$this->filepath['plugins'][$plugin->id], + &$this->tempPath, &$plugin->zip_name, &$plugin) + ); //create the zip file - if (ComponentbuilderHelper::zip($plugin->folder_path, $this->filepath['plugins'][$plugin->id])) + if (ComponentbuilderHelper::zip( + $plugin->folder_path, + $this->filepath['plugins'][$plugin->id] + )) { // now move to backup if zip was made and backup is required if ($this->backupPath) { $__plugin_context = 'plugin.' . $plugin_context; // Trigger Event: jcb_ce_onBeforeBackupZip - $this->triggerEvent('jcb_ce_onBeforeBackupZip', array(&$__plugin_context, &$this->filepath['plugins'][$plugin->id], &$this->tempPath, &$this->backupPath, &$plugin)); + $this->triggerEvent( + 'jcb_ce_onBeforeBackupZip', + array(&$__plugin_context, + &$this->filepath['plugins'][$plugin->id], + &$this->tempPath, &$this->backupPath, + &$plugin) + ); // copy the zip to backup path - JFile::copy($this->filepath['plugins'][$plugin->id], $this->backupPath . '/' . $plugin->zip_name . '.zip'); + JFile::copy( + $this->filepath['plugins'][$plugin->id], + $this->backupPath . '/' . $plugin->zip_name + . '.zip' + ); } // move to sales server host @@ -811,13 +1197,30 @@ class Compiler extends Infusion if (isset($plugin->sales_server)) { // Trigger Event: jcb_ce_onBeforeMoveToServer - $this->triggerEvent('jcb_ce_onBeforeMoveToServer', array(&$__plugin_context, &$this->filepath['plugins'][$plugin->id], &$this->tempPath, &$plugin->zip_name, &$plugin)); + $this->triggerEvent( + 'jcb_ce_onBeforeMoveToServer', + array(&$__plugin_context, + &$this->filepath['plugins'][$plugin->id], + &$this->tempPath, &$plugin->zip_name, + &$plugin) + ); // move to server - ComponentbuilderHelper::moveToServer($this->filepath['plugins'][$plugin->id], $plugin->zip_name . '.zip', (int) $plugin->sales_server, $plugin->sales_server_protocol); + ComponentbuilderHelper::moveToServer( + $this->filepath['plugins'][$plugin->id], + $plugin->zip_name . '.zip', + (int) $plugin->sales_server, + $plugin->sales_server_protocol + ); } } // Trigger Event: jcb_ce_onAfterZipPlugin - $this->triggerEvent('jcb_ce_onAfterZipPlugin', array(&$plugin_context, &$this->filepath['plugins'][$plugin->id], &$this->tempPath, &$plugin->zip_name, &$plugin)); + $this->triggerEvent( + 'jcb_ce_onAfterZipPlugin', array(&$plugin_context, + &$this->filepath['plugins'][$plugin->id], + &$this->tempPath, + &$plugin->zip_name, + &$plugin) + ); // remove the plugin folder since we are done $this->removeFolder($plugin->folder_path); } @@ -835,22 +1238,29 @@ class Compiler extends Infusion { // reset each time per custom code $fingerPrint = array(); - if (isset($target['hashtarget'][0]) && $target['hashtarget'][0] > 3 && isset($target['path']) && ComponentbuilderHelper::checkString($target['path']) && isset($target['hashtarget'][1]) && ComponentbuilderHelper::checkString($target['hashtarget'][1])) + if (isset($target['hashtarget'][0]) && $target['hashtarget'][0] > 3 + && isset($target['path']) + && ComponentbuilderHelper::checkString($target['path']) + && isset($target['hashtarget'][1]) + && ComponentbuilderHelper::checkString( + $target['hashtarget'][1] + )) { - $file = $this->componentPath . '/' . $target['path']; - $size = (int) $target['hashtarget'][0]; - $hash = $target['hashtarget'][1]; - $cut = $size - 1; - $found = false; - $bites = 0; + $file = $this->componentPath . '/' . $target['path']; + $size = (int) $target['hashtarget'][0]; + $hash = $target['hashtarget'][1]; + $cut = $size - 1; + $found = false; + $bites = 0; $lineBites = array(); - $replace = array(); - if ($target['type'] == 1 && isset($target['hashendtarget'][0]) && $target['hashendtarget'][0] > 0) + $replace = array(); + if ($target['type'] == 1 && isset($target['hashendtarget'][0]) + && $target['hashendtarget'][0] > 0) { $foundEnd = false; - $sizeEnd = (int) $target['hashendtarget'][0]; - $hashEnd = $target['hashendtarget'][1]; - $cutEnd = $sizeEnd - 1; + $sizeEnd = (int) $target['hashendtarget'][0]; + $hashEnd = $target['hashendtarget'][1]; + $cutEnd = $sizeEnd - 1; } else { @@ -861,13 +1271,19 @@ class Compiler extends Infusion // check if file exist if (JFile::exists($file)) { - foreach (new SplFileObject($file) as $lineNumber => $lineContent) + foreach ( + new SplFileObject($file) as $lineNumber => $lineContent + ) { // if not found we need to load line bites per line - $lineBites[$lineNumber] = (int) mb_strlen($lineContent, '8bit'); + $lineBites[$lineNumber] = (int) mb_strlen( + $lineContent, '8bit' + ); if (!$found) { - $bites = (int) ComponentbuilderHelper::bcmath('add', $lineBites[$lineNumber], $bites); + $bites = (int) ComponentbuilderHelper::bcmath( + 'add', $lineBites[$lineNumber], $bites + ); } if ($found && !$foundEnd) { @@ -875,19 +1291,24 @@ class Compiler extends Infusion // we musk keep last three lines to dynamic find target entry $fingerPrint[$lineNumber] = trim($lineContent); // check lines each time if it fits our target - if (count((array) $fingerPrint) === $sizeEnd && !$foundEnd) + if (count((array) $fingerPrint) === $sizeEnd + && !$foundEnd) { $fingerTest = md5(implode('', $fingerPrint)); if ($fingerTest === $hashEnd) { // we are done here $foundEnd = true; - $replace = array_slice($replace, 0, count($replace) - $sizeEnd); + $replace = array_slice( + $replace, 0, count($replace) - $sizeEnd + ); break; } else { - $fingerPrint = array_slice($fingerPrint, -$cutEnd, $cutEnd, true); + $fingerPrint = array_slice( + $fingerPrint, -$cutEnd, $cutEnd, true + ); } } continue; @@ -916,14 +1337,22 @@ class Compiler extends Infusion } else { - $fingerPrint = array_slice($fingerPrint, -$cut, $cut, true); + $fingerPrint = array_slice( + $fingerPrint, -$cut, $cut, true + ); } } } if ($found) { - $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; + $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 @@ -932,29 +1361,61 @@ class Compiler extends Infusion elseif ($target['type'] == 1 && $foundEnd) { // found it now add code from the next line - $this->addDataToFile($file, $data, $bites, (int) array_sum($replace)); + $this->addDataToFile( + $file, $data, $bites, (int) array_sum($replace) + ); } else { // Load escaped code since the target endhash has changed $this->loadEscapedCode($file, $target, $lineBites); - $this->app->enqueueMessage(JText::_('

Custom Code Warning

'), 'Warning'); - $this->app->enqueueMessage(JText::sprintf('Custom code %s could not be added to %s please review the file after install at line %s and reposition the code, remove the comments and recompile to fix the issue. The issue could be due to a change to lines below the custom code.', '#' . $target['id'] . '', $target['path'], $target['from_line']), 'Warning'); + $this->app->enqueueMessage( + JText::_('

Custom Code Warning

'), + 'Warning' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Custom code %s could not be added to %s please review the file after install at line %s and reposition the code, remove the comments and recompile to fix the issue. The issue could be due to a change to lines below the custom code.', + '#' + . $target['id'] . '', $target['path'], + $target['from_line'] + ), 'Warning' + ); } } else { // Load escaped code since the target hash has changed $this->loadEscapedCode($file, $target, $lineBites); - $this->app->enqueueMessage(JText::_('

Custom Code Warning

'), 'Warning'); - $this->app->enqueueMessage(JText::sprintf('Custom code %s could not be added to %s please review the file after install at line %s and reposition the code, remove the comments and recompile to fix the issue. The issue could be due to a change to lines above the custom code.', '#' . $target['id'] . '', $target['path'], $target['from_line']), 'Warning'); + $this->app->enqueueMessage( + JText::_('

Custom Code Warning

'), + 'Warning' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'Custom code %s could not be added to %s please review the file after install at line %s and reposition the code, remove the comments and recompile to fix the issue. The issue could be due to a change to lines above the custom code.', + '#' + . $target['id'] . '', $target['path'], + $target['from_line'] + ), 'Warning' + ); } } else { // Give developer a notice that file is not found. - $this->app->enqueueMessage(JText::_('

Custom Code Warning

'), 'Warning'); - $this->app->enqueueMessage(JText::sprintf('File %s could not be found, so the custom code for this file could not be addded.', $target['path']), 'Warning'); + $this->app->enqueueMessage( + JText::_('

Custom Code Warning

'), + 'Warning' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'File %s could not be found, so the custom code for this file could not be addded.', + $target['path'] + ), 'Warning' + ); } } } @@ -965,19 +1426,23 @@ class Compiler extends Infusion // get comment type if ($target['comment_type'] == 1) { - $commentType = "// "; + $commentType = "// "; $_commentType = ""; } else { - $commentType = ""; } // escape the code $code = explode(PHP_EOL, $target['code']); - $code = PHP_EOL . $commentType . implode($_commentType . PHP_EOL . $commentType, $code) . $_commentType . PHP_EOL; + $code = PHP_EOL . $commentType . implode( + $_commentType . PHP_EOL . $commentType, $code + ) . $_commentType . PHP_EOL; // get place holders - $placeholder = $this->getPlaceHolder((int) $target['comment_type'] . $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 @@ -1006,12 +1471,16 @@ class Compiler extends Infusion // Add the data fwrite($fpFile, $data); // truncate file at the end of the data that was added - $remove = ComponentbuilderHelper::bcmath('add', $position, mb_strlen($data, '8bit')); + $remove = ComponentbuilderHelper::bcmath( + 'add', $position, mb_strlen($data, '8bit') + ); ftruncate($fpFile, $remove); // check if this was a replacement of data if ($replace) { - $position = ComponentbuilderHelper::bcmath('add', $position, $replace); + $position = ComponentbuilderHelper::bcmath( + 'add', $position, $replace + ); } // move to the position of the data that should remain below the new data fseek($fpTemp, $position); diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index 8e5b9322f..e9b97a8f3 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -5,7 +5,7 @@ * @created 30th April, 2015 * @author Llewellyn van der Merwe * @github Joomla Component Builder - * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @copyright Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -20,111 +20,112 @@ class Get /** * The Joomla Version - * + * * @var string */ public $joomlaVersion; /** * The hash placeholder - * + * * @var string */ public $hhh = '#' . '#' . '#'; /** * The open bracket placeholder - * + * * @var string */ public $bbb = '[' . '[' . '['; /** * The close bracket placeholder - * + * * @var string */ public $ddd = ']' . ']' . ']'; /** * The app - * + * * @var object */ public $app; /** * The Params - * + * * @var object */ public $params; /** * Add strict field export permissions - * + * * @var boolean */ public $strictFieldExportPermissions = false; /** * Add text only export options - * + * * @var boolean */ public $exportTextOnly = false; /** * The global placeholders - * + * * @var array */ public $globalPlaceholders = array(); /** * The placeholders - * + * * @var array */ public $placeholders = array(); /** * The Compiler Path - * + * * @var object */ public $compilerPath; /** * Switch to add custom code placeholders - * + * * @var bool */ public $addPlaceholders = false; /** * The placeholders for custom code keys - * + * * @var array */ - protected $customCodeKeyPlacholders = array( - '[' => '[', - ']' => ']', - ',' => ',', - '+' => '+', - '=' => '=' + protected $customCodeKeyPlacholders + = array( + '[' => '[', + ']' => ']', + ',' => ',', + '+' => '+', + '=' => '=' ); /** * The Component data - * + * * @var object */ public $componentData; /** * The Plugins data - * + * * @var array */ public $joomlaPlugins = array(); @@ -137,643 +138,650 @@ class Get public $joomlaModules = array(); /** - * 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/ + * The custom script placeholders - we use the (xxx) to avoid detection it should be (***) + * ##################################---> PHP/JS <---#################################### * - * //////////////////////////////// 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/ + * New Insert Code = /xxx[INSERT<>$$$$]xxx/ /xxx[/INSERT<>$$$$]xxx/ + * New Replace Code = /xxx[REPLACE<>$$$$]xxx/ /xxx[/REPLACE<>$$$$]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/ - * - * The custom script placeholders - we use the (==) to avoid detection it should be (--) - * ###################################---> HTML <---##################################### - * - * New Insert Code = $$$$]==> $$$$]==> - * New Replace Code = $$$$]==> $$$$]==> + * //////////////////////////////// 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/ * - * ///////////////////////////////// when JCB adds it back /////////////////////////////// - * JCB Add Inserted Code = - * JCB Add Replaced Code = + * /////////////////////////////// changeing existing custom code ///////////////////////// + * Update Inserted Code = /xxx[INSERTED<>$$$$]xxx//x23x/ /xxx[/INSERTED<>$$$$]xxx/ + * Update Replaced Code = /xxx[REPLACED<>$$$$]xxx//x25x/ /xxx[/REPLACED<>$$$$]xxx/ * - * //////////////////////////// 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 + * The custom script placeholders - we use the (==) to avoid detection it should be (--) + * ###################################---> HTML <---##################################### + * + * 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<>$$$$]' - ); + protected $customCodePlaceholders + = array( + 1 => 'REPLACE<>$$$$]', + 2 => 'INSERT<>$$$$]', + 3 => 'REPLACED<>$$$$]', + 4 => 'INSERTED<>$$$$]' + ); /** * The custom code to be added - * + * * @var array */ 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 already exist in system - * + * * @var array */ protected $existingCustomCode = array(); /** * The custom code in local files this are new - * + * * @var array */ protected $newCustomCode = array(); /** * The index of code already loaded - * + * * @var array */ protected $codeAreadyDone = array(); /** * The external code/string to be added - * + * * @var array */ protected $externalCodeString = array(); /* * The line numbers Switch - * + * * @var boolean */ public $debugLinenr = false; /* * The percentage when a language should be added - * + * * @var boolean */ public $percentageLanguageAdd = 0; /** * The Placholder Language prefix - * + * * @var string */ public $langPrefix; /** * The Language content - * + * * @var array */ public $langContent = array(); /** * The Languages bucket - * + * * @var array */ - public $languages = array(); + public $languages + = array('components' => array(), 'modules' => array(), + 'plugins' => array()); /** * The Main Languages - * + * * @var string */ public $langTag = 'en-GB'; /** * The Multi Languages bucket - * + * * @var array */ public $multiLangString = array(); /** * The new lang to add - * + * * @var array */ protected $newLangStrings = array(); /** * The existing lang to update - * + * * @var array */ protected $existingLangStrings = array(); /** * The Language JS matching check - * + * * @var array */ public $langMismatch = array(); /** * The Language SC matching check - * + * * @var array */ public $langMatch = array(); /** * The Language string targets - * + * * @var array */ - public $langStringTargets = array( - 'Joomla' . '.JText._(', - 'JText:' . ':script(', - 'JText:' . ':_(', - 'JText:' . ':sprintf(', - 'JustTEXT:' . ':_(' - ); + public $langStringTargets + = array( + 'Joomla' . '.JText._(', + 'JText:' . ':script(', + 'JText:' . ':_(', + 'JText:' . ':sprintf(', + 'JustTEXT:' . ':_(' + ); /** * The Component Code Name - * + * * @var string */ 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 - * + * * @var string */ public $component_version; /** * The UIKIT Switch - * - * @var boolean + * + * @var boolean */ public $uikit = 0; /** * The UIKIT component checker - * + * * @var array */ public $uikitComp = array(); /** * The FOOTABLE Switch - * + * * @var boolean */ public $footable = false; /** * The FOOTABLE Version - * + * * @var int */ public $footableVersion; /** * The Google Chart Switch per view - * + * * @var array */ public $googleChart = array(); /** * The Google Chart Switch - * + * * @var boolean */ public $googlechart = false; /** * The Import & Export Switch - * + * * @var boolean */ public $addEximport = false; /** * The Tag & History Switch - * + * * @var boolean */ public $setTagHistory = false; /** * The Joomla Fields Switch - * + * * @var boolean */ public $setJoomlaFields = false; /** * The site edit views - * + * * @var array */ public $siteEditView = array(); /** * The Language target - * + * * @var string */ public $lang = 'admin'; /** * The lang keys for extentions - * + * * @var array */ public $langKeys = array(); /** * The Build target Switch - * + * * @var string */ public $target; /** * The unique codes - * + * * @var array */ public $uniquecodes = array(); /** * The unique keys - * + * * @var array */ public $uniquekeys = array(); /** * The Ad contributors Switch - * + * * @var boolean */ public $addContributors = false; /** * The Custom Script Builder - * + * * @var array */ public $customScriptBuilder = array(); /** * The Footable Script Builder - * + * * @var array */ public $footableScripts = array(); /** * The pathe to the bom file to be used - * + * * @var string */ public $bomPath; /** * The SQL Tweak of admin views - * + * * @var array */ public $sqlTweak = array(); /** * The validation rules that should be added - * + * * @var array */ public $validationRules = array(); /** * The validation linked to fields - * + * * @var array */ public $validationLinkedFields = array(); /** * The admin views data array - * + * * @var array */ private $_adminViewData = array(); /** * The field data array - * + * * @var array */ private $_fieldData = array(); /** * The custom alias builder - * + * * @var array */ public $customAliasBuilder = array(); /** * The field builder type - * + * * 1 = StringManipulation * 2 = SimpleXMLElement - * + * * @var int */ public $fieldBuilderType; /** * Set unique Names - * + * * @var array */ public $uniqueNames = array(); /** * Set unique Names - * + * * @var array */ protected $uniqueFieldNames = array(); /** * Category other name bucket - * + * * @var array */ public $catOtherName = array(); /** * The field relations values - * + * * @var array */ public $fieldRelations = array(); /** * Default Fields - * + * * @var array */ - public $defaultFields = array('created', 'created_by', 'modified', 'modified_by', 'published', 'ordering', 'access', 'version', 'hits', 'id'); + public $defaultFields + = array('created', 'created_by', 'modified', 'modified_by', 'published', + 'ordering', 'access', 'version', 'hits', 'id'); /** * The list join fields - * + * * @var array */ public $listJoinBuilder = array(); /** * The list head over ride - * + * * @var array */ public $listHeadOverRide = array(); /** * The linked admin view tabs - * + * * @var array */ public $linkedAdminViews = array(); /** * The custom admin view tabs - * + * * @var array */ public $customTabs = array(); /** * The Add Ajax Switch - * + * * @var boolean */ public $addAjax = false; /** * The Add Site Ajax Switch - * + * * @var boolean */ public $addSiteAjax = false; /** * The get Module Script Switch - * + * * @var array */ public $getModule = array(); /** * The template data - * + * * @var array */ public $templateData = array(); /** * The layout data - * + * * @var array */ public $layoutData = array(); /** * The Encryption Types - * + * * @var array */ public $cryptionTypes = array('basic', 'medium', 'whmcs', 'expert'); /** * The WHMCS Encryption Switch - * + * * @var boolean */ public $whmcsEncryption = false; /** * The Basic Encryption Switch - * + * * @var boolean */ public $basicEncryption = false; /** * The Medium Encryption Switch - * + * * @var boolean */ public $mediumEncryption = false; /** * The Custom field Switch per view - * + * * @var array */ public $customFieldScript = array(); /** * The site main get - * + * * @var array */ public $siteMainGet = array(); /** * The site dynamic get - * + * * @var array */ public $siteDynamicGet = array(); /** * The get AS lookup - * + * * @var array */ public $getAsLookup = array(); /** * The site fields - * + * * @var array */ public $siteFields = array(); /** * The add SQL - * + * * @var array */ public $addSQL = array(); /** * The update SQL - * + * * @var array */ public $updateSQL = array(); /** * The Library Manager - * + * * @var array */ public $libManager = array(); /** * The Libraries - * + * * @var array */ public $libraries = array(); /** * Is minify Enabled - * + * * @var int */ public $minify = 0; /** * Is Tidy Enabled - * + * * @var bool */ public $tidy = false; /** * Set Tidy warning once switch - * + * * @var bool */ public $setTidyWarning = false; /** * mysql table setting keys - * + * * @var array */ - public $mysqlTableKeys = array( - 'engine' => array('default' => 'MyISAM'), - 'charset' => array('default' => 'utf8'), - 'collate' => array('default' => 'utf8_general_ci'), - 'row_format' => array('default' => '') + public $mysqlTableKeys + = array( + 'engine' => array('default' => 'MyISAM'), + 'charset' => array('default' => 'utf8'), + 'collate' => array('default' => 'utf8_general_ci'), + 'row_format' => array('default' => '') ); /** * mysql table settings - * + * * @var array */ public $mysqlTableSetting = array(); /** * event plugin trigger switch - * + * * @var boolean */ protected $active_plugins = false; @@ -790,7 +798,8 @@ class Get // Set the params $this->params = JComponentHelper::getParams('com_componentbuilder'); // get active plugins - if (($plugins = $this->params->get('compiler_plugin', false)) !== false) + if (($plugins = $this->params->get('compiler_plugin', false)) + !== false) { foreach ($plugins as $plugin) { @@ -809,45 +818,73 @@ class Get // set the Joomla version $this->joomlaVersion = $config['version']; // set the minfy switch of the JavaScript - $this->minify = (isset($config['minify']) && $config['minify'] != 2) ? $config['minify'] : $this->params->get('minify', 0); + $this->minify = (isset($config['minify']) && $config['minify'] != 2) + ? $config['minify'] : $this->params->get('minify', 0); // set the global language $this->langTag = $this->params->get('language', $this->langTag); // also set the helper class langTag (for safeStrings) ComponentbuilderHelper::$langTag = $this->langTag; // setup the main language array - $this->languages[$this->langTag] = array(); + $this->languages['components'][$this->langTag] = array(); // check if we have Tidy enabled $this->tidy = extension_loaded('Tidy'); // set the field type builder - $this->fieldBuilderType = $this->params->get('compiler_field_builder_type', 2); + $this->fieldBuilderType = $this->params->get( + 'compiler_field_builder_type', 2 + ); // check the field builder type logic if (!$this->tidy && $this->fieldBuilderType == 2) { // we do not have the tidy extention set fall back to StringManipulation $this->fieldBuilderType = 1; // load the sugestion to use string manipulation - $this->app->enqueueMessage(JText::_('

Field Notice

'), 'Notice'); - $this->app->enqueueMessage(JText::_('Since you do not have Tidy extentsion setup on your system, we could not use the SimpleXMLElement class. We instead used string manipulation to build all your fields, this is a faster method, you must inspect the xml files in your component package to see if you are satisfied with the result.
You can make this method your default by opening the global options of JCB and under the Global tab set the Field Builder Type to string manipulation.'), 'Notice'); + $this->app->enqueueMessage( + JText::_('

Field Notice

'), 'Notice' + ); + $this->app->enqueueMessage( + JText::_( + 'Since you do not have Tidy extentsion setup on your system, we could not use the SimpleXMLElement class. We instead used string manipulation to build all your fields, this is a faster method, you must inspect the xml files in your component package to see if you are satisfied with the result.
You can make this method your default by opening the global options of JCB and under the Global tab set the Field Builder Type to string manipulation.' + ), 'Notice' + ); } // load the compiler path - $this->compilerPath = $this->params->get('compiler_folder_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler'); + $this->compilerPath = $this->params->get( + 'compiler_folder_path', + JPATH_COMPONENT_ADMINISTRATOR . '/compiler' + ); // set the component ID $this->componentID = (int) $config['component']; // set this components code name - if ($name_code = ComponentbuilderHelper::getVar('joomla_component', $this->componentID, 'id', 'name_code')) + if ($name_code = ComponentbuilderHelper::getVar( + 'joomla_component', $this->componentID, 'id', 'name_code' + )) { // set lang prefix - $this->langPrefix = 'COM_' . ComponentbuilderHelper::safeString($name_code, 'U'); + $this->langPrefix = 'COM_' . ComponentbuilderHelper::safeString( + $name_code, 'U' + ); // set component code name - $this->componentCodeName = ComponentbuilderHelper::safeString($name_code); + $this->componentCodeName = ComponentbuilderHelper::safeString( + $name_code + ); // set component context - $this->componentContext = $this->componentCodeName . '.' . $this->componentID; + $this->componentContext = $this->componentCodeName . '.' + . $this->componentID; // set if placeholders should be added to customcode - $global = ((int) ComponentbuilderHelper::getVar('joomla_component', $this->componentID, 'id', 'add_placeholders') == 1) ? true : false; - $this->addPlaceholders = ((int) $config['placeholders'] == 0) ? false : (((int) $config['placeholders'] == 1) ? true : $global); + $global = ((int) ComponentbuilderHelper::getVar( + 'joomla_component', $this->componentID, 'id', + 'add_placeholders' + ) == 1) ? true : false; + $this->addPlaceholders = ((int) $config['placeholders'] == 0) + ? false + : (((int) $config['placeholders'] == 1) ? true : $global); // set if line numbers should be added to comments - $global = ((int) ComponentbuilderHelper::getVar('joomla_component', $this->componentID, 'id', 'debug_linenr') == 1) ? true : false; - $this->debugLinenr = ((int) $config['debuglinenr'] == 0) ? false : (((int) $config['debuglinenr'] == 1) ? true : $global); + $global = ((int) ComponentbuilderHelper::getVar( + 'joomla_component', $this->componentID, 'id', + 'debug_linenr' + ) == 1) ? true : false; + $this->debugLinenr = ((int) $config['debuglinenr'] == 0) ? false + : (((int) $config['debuglinenr'] == 1) ? true : $global); // set the current user $this->user = JFactory::getUser(); // Get a db connection. @@ -863,50 +900,71 @@ class Get $this->customCodeFactory($paths, $today); } // Trigger Event: jcb_ce_onBeforeGetComponentData - $this->triggerEvent('jcb_ce_onBeforeGetComponentData', array(&$this->componentContext, $this)); + $this->triggerEvent( + 'jcb_ce_onBeforeGetComponentData', + array(&$this->componentContext, $this) + ); // get the component data $this->componentData = $this->getComponentData(); // Trigger Event: jcb_ce_onAfterGetComponentData - $this->triggerEvent('jcb_ce_onAfterGetComponentData', array(&$this->componentContext, $this)); + $this->triggerEvent( + 'jcb_ce_onAfterGetComponentData', + array(&$this->componentContext, $this) + ); // make sure we have a version - if (strpos($this->componentData->component_version, '.') === FALSE) + if (strpos($this->componentData->component_version, '.') + === false) { $this->componentData->component_version = '1.0.0'; } // update the version - if (!isset($this->componentData->old_component_version) && (ComponentbuilderHelper::checkArray($this->addSQL) || ComponentbuilderHelper::checkArray($this->updateSQL))) + if (!isset($this->componentData->old_component_version) + && (ComponentbuilderHelper::checkArray($this->addSQL) + || ComponentbuilderHelper::checkArray( + $this->updateSQL + ))) { // set the new version - $version = (array) explode('.', $this->componentData->component_version); + $version = (array) explode( + '.', $this->componentData->component_version + ); // get last key end($version); $key = key($version); // just increment the last $version[$key]++; // set the old version - $this->componentData->old_component_version = $this->componentData->component_version; + $this->componentData->old_component_version + = $this->componentData->component_version; // set the new version, and set update switch - $this->componentData->component_version = implode('.', $version); + $this->componentData->component_version = implode( + '.', $version + ); } // set the percentage when a language can be added - $this->percentageLanguageAdd = (int) $this->params->get('percentagelanguageadd', 50); + $this->percentageLanguageAdd = (int) $this->params->get( + 'percentagelanguageadd', 50 + ); // Trigger Event: jcb_ce_onBeforeGet - $this->triggerEvent('jcb_ce_onAfterGet', array(&$this->componentContext, $this)); + $this->triggerEvent( + 'jcb_ce_onAfterGet', array(&$this->componentContext, $this) + ); return true; } } + return false; } /** * Set the tab/space - * - * @param int $nr The number of tag/space - * + * + * @param int $nr The number of tag/space + * * @return string - * + * */ public function _t($nr) { @@ -916,11 +974,11 @@ class Get /** * Set the line number in comments - * - * @param int $nr The line number - * + * + * @param int $nr The line number + * * @return void - * + * */ private function setLine($nr) { @@ -928,17 +986,18 @@ class Get { return ' [Get ' . $nr . ']'; } + return ''; } /** * Trigger events - * - * @param string $event The event to trigger - * @param mix $data The values to pass to the event/plugin - * + * + * @param string $event The event to trigger + * @param mix $data The values to pass to the event/plugin + * * @return void - * + * */ public function triggerEvent($event, $data) { @@ -969,7 +1028,7 @@ class Get * get all System Placeholders * * @return array The global placeholders - * + * */ public function getGlobalPlaceholders() { @@ -977,7 +1036,7 @@ class Get $bucket = array(); // Create a new query object. $query = $this->db->getQuery(true); - $query->select($this->db->quoteName(array('a.target','a.value'))); + $query->select($this->db->quoteName(array('a.target', 'a.value'))); // from these tables $query->from('#__componentbuilder_placeholder AS a'); // Reset the query using our newly populated query object. @@ -994,37 +1053,52 @@ class Get } } // set component place holders - $bucket[$this->hhh . 'component' . $this->hhh] = $this->componentCodeName; - $bucket[$this->hhh . 'Component' . $this->hhh] = ComponentbuilderHelper::safeString($this->componentCodeName, 'F'); - $bucket[$this->hhh . 'COMPONENT' . $this->hhh] = ComponentbuilderHelper::safeString($this->componentCodeName, 'U'); - $bucket[$this->bbb . 'component' . $this->ddd] = $bucket[$this->hhh . 'component' . $this->hhh]; - $bucket[$this->bbb . 'Component' . $this->ddd] = $bucket[$this->hhh . 'Component' . $this->hhh]; - $bucket[$this->bbb . 'COMPONENT' . $this->ddd] = $bucket[$this->hhh . 'COMPONENT' . $this->hhh]; + $bucket[$this->hhh . 'component' . $this->hhh] + = $this->componentCodeName; + $bucket[$this->hhh . 'Component' . $this->hhh] + = ComponentbuilderHelper::safeString( + $this->componentCodeName, 'F' + ); + $bucket[$this->hhh . 'COMPONENT' . $this->hhh] + = ComponentbuilderHelper::safeString( + $this->componentCodeName, 'U' + ); + $bucket[$this->bbb . 'component' . $this->ddd] = $bucket[$this->hhh + . 'component' . $this->hhh]; + $bucket[$this->bbb . 'Component' . $this->ddd] = $bucket[$this->hhh + . 'Component' . $this->hhh]; + $bucket[$this->bbb . 'COMPONENT' . $this->ddd] = $bucket[$this->hhh + . 'COMPONENT' . $this->hhh]; $bucket[$this->hhh . 'LANG_PREFIX' . $this->hhh] = $this->langPrefix; - $bucket[$this->bbb . 'LANG_PREFIX' . $this->ddd] = $bucket[$this->hhh . 'LANG_PREFIX' . $this->hhh]; + $bucket[$this->bbb . 'LANG_PREFIX' . $this->ddd] = $bucket[$this->hhh + . 'LANG_PREFIX' . $this->hhh]; // get the current components overides - if (($_placeholders = ComponentbuilderHelper::getVar('component_placeholders', $this->componentID, 'joomla_component', 'addplaceholders')) !== false - && ComponentbuilderHelper::checkJson($_placeholders)) + if (($_placeholders = ComponentbuilderHelper::getVar( + 'component_placeholders', $this->componentID, + 'joomla_component', 'addplaceholders' + )) !== false + && ComponentbuilderHelper::checkJson($_placeholders)) { $_placeholders = json_decode($_placeholders, true); if (ComponentbuilderHelper::checkArray($_placeholders)) { - foreach($_placeholders as $row) + foreach ($_placeholders as $row) { $bucket[$row['target']] = $row['value']; } } } + return $bucket; } /** * get all Component Data - * - * @param int $id The component ID + * + * @param int $id The component ID * * @return oject The component data - * + * */ public function getComponentData() { @@ -1032,25 +1106,25 @@ class Get $query = $this->db->getQuery(true); // selection $selection = array( - 'b.addadmin_views' => 'addadmin_views', - 'b.id' => 'addadmin_views_id', - 'h.addconfig' => 'addconfig', + 'b.addadmin_views' => 'addadmin_views', + 'b.id' => 'addadmin_views_id', + 'h.addconfig' => 'addconfig', 'd.addcustom_admin_views' => 'addcustom_admin_views', - 'g.addcustommenus' => 'addcustommenus', - 'j.addfiles' => 'addfiles', - 'j.addfolders' => 'addfolders', - 'j.addfilesfullpath' => 'addfilesfullpath', - 'j.addfoldersfullpath' => 'addfoldersfullpath', - 'c.addsite_views' => 'addsite_views', - 'l.addjoomla_plugins' => 'addjoomla_plugins', - 'k.addjoomla_modules' => 'addjoomla_modules', - 'i.dashboard_tab' => 'dashboard_tab', + 'g.addcustommenus' => 'addcustommenus', + 'j.addfiles' => 'addfiles', + 'j.addfolders' => 'addfolders', + 'j.addfilesfullpath' => 'addfilesfullpath', + 'j.addfoldersfullpath' => 'addfoldersfullpath', + 'c.addsite_views' => 'addsite_views', + 'l.addjoomla_plugins' => 'addjoomla_plugins', + 'k.addjoomla_modules' => 'addjoomla_modules', + 'i.dashboard_tab' => 'dashboard_tab', 'i.php_dashboard_methods' => 'php_dashboard_methods', - 'i.id' => 'component_dashboard_id', - 'f.sql_tweak' => 'sql_tweak', - 'e.version_update' => 'version_update', - 'e.id' => 'version_update_id' - ); + 'i.id' => 'component_dashboard_id', + 'f.sql_tweak' => 'sql_tweak', + 'e.version_update' => 'version_update', + 'e.id' => 'version_update_id' + ); $query->select('a.*'); $query->select( $this->db->quoteName( @@ -1074,14 +1148,25 @@ class Get 'k' => 'component_modules' ); // load the joins - foreach($joiners as $as => $join) + foreach ($joiners as $as => $join) { - $query->join('LEFT', $this->db->quoteName('#__componentbuilder_' . $join, $as) . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName($as . '.joomla_component') . ')'); + $query->join( + 'LEFT', + $this->db->quoteName('#__componentbuilder_' . $join, $as) + . ' ON (' . $this->db->quoteName('a.id') . ' = ' + . $this->db->quoteName($as . '.joomla_component') . ')' + ); } - $query->where($this->db->quoteName('a.id') . ' = ' . (int) $this->componentID); + $query->where( + $this->db->quoteName('a.id') . ' = ' . (int) $this->componentID + ); // Trigger Event: jcb_ce_onBeforeQueryComponentData - $this->triggerEvent('jcb_ce_onBeforeQueryComponentData', array(&$this->componentContext, &$this->componentID, &$query, &$this->db)); + $this->triggerEvent( + 'jcb_ce_onBeforeQueryComponentData', + array(&$this->componentContext, &$this->componentID, &$query, + &$this->db) + ); // Reset the query using our newly populated query object. $this->db->setQuery($query); @@ -1090,43 +1175,68 @@ class Get $component = $this->db->loadObject(); // Trigger Event: jcb_ce_onBeforeModelComponentData - $this->triggerEvent('jcb_ce_onBeforeModelComponentData', array(&$this->componentContext, &$component)); + $this->triggerEvent( + 'jcb_ce_onBeforeModelComponentData', + array(&$this->componentContext, &$component) + ); // set upater $updater = array( 'unique' => array( - 'addadmin_views' => array('table' => 'component_admin_views', 'val' => (int) $component->addadmin_views_id, 'key' => 'id'), - 'addconfig' => array('table' => 'component_config', 'val' => (int) $this->componentID, 'key' => 'joomla_component'), - 'addcustom_admin_views' => array('table' => 'component_custom_admin_views', 'val' => (int) $this->componentID, 'key' => 'joomla_component'), - 'addcustommenus' => array('table' => 'component_custom_admin_menus', 'val' => (int) $this->componentID, 'key' => 'joomla_component'), - 'addfiles' => array('table' => 'component_files_folders', 'val' => (int) $this->componentID, 'key' => 'joomla_component'), - 'addfolders' => array('table' => 'component_files_folders', 'val' => (int) $this->componentID, 'key' => 'joomla_component'), - 'addsite_views' => array('table' => 'component_site_views', 'val' => (int) $this->componentID, 'key' => 'joomla_component'), - 'dashboard_tab' => array('table' => 'component_dashboard', 'val' => (int) $this->componentID, 'key' => 'joomla_component'), - 'sql_tweak' => array('table' => 'component_mysql_tweaks', 'val' => (int) $this->componentID, 'key' => 'joomla_component'), - 'version_update' => array('table' => 'component_updates', 'val' => (int) $this->componentID, 'key' => 'joomla_component') + 'addadmin_views' => array('table' => 'component_admin_views', + 'val' => (int) $component->addadmin_views_id, + 'key' => 'id'), + 'addconfig' => array('table' => 'component_config', + 'val' => (int) $this->componentID, + 'key' => 'joomla_component'), + 'addcustom_admin_views' => array('table' => 'component_custom_admin_views', + 'val' => (int) $this->componentID, + 'key' => 'joomla_component'), + 'addcustommenus' => array('table' => 'component_custom_admin_menus', + 'val' => (int) $this->componentID, + 'key' => 'joomla_component'), + 'addfiles' => array('table' => 'component_files_folders', + 'val' => (int) $this->componentID, + 'key' => 'joomla_component'), + 'addfolders' => array('table' => 'component_files_folders', + 'val' => (int) $this->componentID, + 'key' => 'joomla_component'), + 'addsite_views' => array('table' => 'component_site_views', + 'val' => (int) $this->componentID, + 'key' => 'joomla_component'), + 'dashboard_tab' => array('table' => 'component_dashboard', + 'val' => (int) $this->componentID, + 'key' => 'joomla_component'), + 'sql_tweak' => array('table' => 'component_mysql_tweaks', + 'val' => (int) $this->componentID, + 'key' => 'joomla_component'), + 'version_update' => array('table' => 'component_updates', + 'val' => (int) $this->componentID, + 'key' => 'joomla_component') ), - 'table' => 'joomla_component', - 'key' => 'id', - 'val' => (int) $this->componentID + 'table' => 'joomla_component', + 'key' => 'id', + 'val' => (int) $this->componentID ); // repeatable fields to update $searchRepeatables = array( // repeatablefield => checker - 'addadmin_views' => 'adminview', - 'addconfig' => 'field', - 'addcontributors' => 'name', + 'addadmin_views' => 'adminview', + 'addconfig' => 'field', + 'addcontributors' => 'name', 'addcustom_admin_views' => 'customadminview', - 'addcustommenus' => 'name', - 'addfiles' => 'file', - 'addfolders' => 'folder', - 'addsite_views' => 'siteview', - 'dashboard_tab' => 'name', - 'sql_tweak' => 'adminview', - 'version_update' => 'version' + 'addcustommenus' => 'name', + 'addfiles' => 'file', + 'addfolders' => 'folder', + 'addsite_views' => 'siteview', + 'dashboard_tab' => 'name', + 'sql_tweak' => 'adminview', + 'version_update' => 'version' ); // update the repeatable fields - $component = ComponentbuilderHelper::convertRepeatableFields($component, $searchRepeatables, $updater); + $component = ComponentbuilderHelper::convertRepeatableFields( + $component, $searchRepeatables, $updater + ); // load the global placeholders if (ComponentbuilderHelper::checkArray($this->globalPlaceholders)) @@ -1135,20 +1245,36 @@ class Get } // set component sales name - $component->sales_name = ComponentbuilderHelper::safeString($component->system_name); + $component->sales_name = ComponentbuilderHelper::safeString( + $component->system_name + ); // ensure version naming is correct - $this->component_version = preg_replace('/[^0-9.]+/', '', $component->component_version); + $this->component_version = preg_replace( + '/[^0-9.]+/', '', $component->component_version + ); // set the add targets - $addArrayF = array('files' => 'files', 'folders' => 'folders', 'filesfullpath' => 'files', 'foldersfullpath' => 'folders'); + $addArrayF = array('files' => 'files', 'folders' => 'folders', + 'filesfullpath' => 'files', + 'foldersfullpath' => 'folders'); foreach ($addArrayF as $addTarget => $targetHere) { // set the add target data - $component->{'add' . $addTarget} = (isset($component->{'add' . $addTarget}) && ComponentbuilderHelper::checkJson($component->{'add' . $addTarget})) ? json_decode($component->{'add' . $addTarget}, true) : null; - if (ComponentbuilderHelper::checkArray($component->{'add' . $addTarget})) + $component->{'add' . $addTarget} = (isset( + $component->{'add' . $addTarget} + ) + && ComponentbuilderHelper::checkJson( + $component->{'add' . $addTarget} + )) ? json_decode($component->{'add' . $addTarget}, true) : null; + if (ComponentbuilderHelper::checkArray( + $component->{'add' . $addTarget} + )) { - if (isset($component->{$targetHere}) && ComponentbuilderHelper::checkArray($component->{$targetHere})) + if (isset($component->{$targetHere}) + && ComponentbuilderHelper::checkArray( + $component->{$targetHere} + )) { foreach ($component->{'add' . $addTarget} as $taget) { @@ -1157,7 +1283,9 @@ class Get } else { - $component->{$targetHere} = array_values($component->{'add' . $addTarget}); + $component->{$targetHere} = array_values( + $component->{'add' . $addTarget} + ); } } unset($component->{'add' . $addTarget}); @@ -1167,32 +1295,39 @@ class Get $this->uikit = $component->adduikit; // set whmcs links if needed - if (1 == $component->add_license && (!isset($component->whmcs_buy_link) || !ComponentbuilderHelper::checkString($component->whmcs_buy_link))) + if (1 == $component->add_license + && (!isset($component->whmcs_buy_link) + || !ComponentbuilderHelper::checkString( + $component->whmcs_buy_link + ))) { // update with the whmcs url - if (isset($component->whmcs_url) && ComponentbuilderHelper::checkString($component->whmcs_url)) + if (isset($component->whmcs_url) + && ComponentbuilderHelper::checkString($component->whmcs_url)) { $component->whmcs_buy_link = $component->whmcs_url; } // use the company website - elseif (isset($component->website) && ComponentbuilderHelper::checkString($component->website)) + elseif (isset($component->website) + && ComponentbuilderHelper::checkString($component->website)) { $component->whmcs_buy_link = $component->website; - $component->whmcs_url = rtrim($component->website, '/').'/whmcs'; + $component->whmcs_url = rtrim($component->website, '/') + . '/whmcs'; } // none set else { $component->whmcs_buy_link = '#'; - $component->whmcs_url = '#'; + $component->whmcs_url = '#'; } } // since the license details are not set clear elseif (0 == $component->add_license) { - $component->whmcs_key = ''; + $component->whmcs_key = ''; $component->whmcs_buy_link = ''; - $component->whmcs_url = ''; + $component->whmcs_url = ''; } // set the footable switch @@ -1200,11 +1335,14 @@ class Get { $this->footable = true; // add the version - $this->footableVersion = (1 == $component->addfootable || 2 == $component->addfootable) ? 2 : $component->addfootable; + $this->footableVersion = (1 == $component->addfootable + || 2 == $component->addfootable) ? 2 : $component->addfootable; } // set the addcustommenus data - $component->addcustommenus = (isset($component->addcustommenus) && ComponentbuilderHelper::checkJson($component->addcustommenus)) ? json_decode($component->addcustommenus, true) : null; + $component->addcustommenus = (isset($component->addcustommenus) + && ComponentbuilderHelper::checkJson($component->addcustommenus)) + ? json_decode($component->addcustommenus, true) : null; if (ComponentbuilderHelper::checkArray($component->addcustommenus)) { $component->custommenus = array_values($component->addcustommenus); @@ -1212,31 +1350,46 @@ class Get unset($component->addcustommenus); // set the sql_tweak data - $component->sql_tweak = (isset($component->sql_tweak) && ComponentbuilderHelper::checkJson($component->sql_tweak)) ? json_decode($component->sql_tweak, true) : null; + $component->sql_tweak = (isset($component->sql_tweak) + && ComponentbuilderHelper::checkJson($component->sql_tweak)) + ? json_decode($component->sql_tweak, true) : null; if (ComponentbuilderHelper::checkArray($component->sql_tweak)) { // build the tweak settings - $this->setSqlTweaking(array_map(function($array) - { - return array_map(function($value) - { - if (!ComponentbuilderHelper::checkArray($value) && !ComponentbuilderHelper::checkObject($value) && strval($value) === strval(intval($value))) - { - return (int) $value; - } - return $value; - }, $array); - }, array_values($component->sql_tweak))); + $this->setSqlTweaking( + array_map( + function ($array) { + return array_map( + function ($value) { + if (!ComponentbuilderHelper::checkArray($value) + && !ComponentbuilderHelper::checkObject( + $value + ) + && strval($value) === strval( + intval($value) + )) + { + return (int) $value; + } + + return $value; + }, $array + ); + }, array_values($component->sql_tweak) + ) + ); } unset($component->sql_tweak); // set the admin_view data - $component->addadmin_views = (isset($component->addadmin_views) && ComponentbuilderHelper::checkJson($component->addadmin_views)) ? json_decode($component->addadmin_views, true) : null; + $component->addadmin_views = (isset($component->addadmin_views) + && ComponentbuilderHelper::checkJson($component->addadmin_views)) + ? json_decode($component->addadmin_views, true) : null; if (ComponentbuilderHelper::checkArray($component->addadmin_views)) { // sort the views acording to order - usort($component->addadmin_views, function($a, $b) - { + usort( + $component->addadmin_views, function ($a, $b) { if ($a['order'] != 0 && $b['order'] != 0) { return $a['order'] - $b['order']; @@ -1249,110 +1402,156 @@ class Get { return 0; } - return 1; - }); - // build the admin_views settings - $component->admin_views = array_map(function($array) - { - $array = array_map(function($value) - { - if (!ComponentbuilderHelper::checkArray($value) && !ComponentbuilderHelper::checkObject($value) && strval($value) === strval(intval($value))) - { - return (int) $value; - } - return $value; - }, $array); - // check if we must add to site - if (isset($array['edit_create_site_view']) && is_numeric($array['edit_create_site_view']) && $array['edit_create_site_view'] > 0) - { - $this->siteEditView[$array['adminview']] = true; - $this->lang = 'both'; - } - if (isset($array['port']) && $array['port'] && !$this->addEximport) - { - $this->addEximport = true; - } - if (isset($array['history']) && $array['history'] && !$this->setTagHistory) - { - $this->setTagHistory = true; - } - if (isset($array['joomla_fields']) && $array['joomla_fields'] && !$this->setJoomlaFields) - { - $this->setJoomlaFields = true; - } - // has become a lacacy issue, can't remove this - $array['view'] = $array['adminview']; - // get the admin settings/data - $array['settings'] = $this->getAdminViewData($array['view']); - return $array; - }, array_values($component->addadmin_views)); + return 1; + } + ); + // build the admin_views settings + $component->admin_views = array_map( + function ($array) { + $array = array_map( + function ($value) { + if (!ComponentbuilderHelper::checkArray($value) + && !ComponentbuilderHelper::checkObject($value) + && strval($value) === strval(intval($value))) + { + return (int) $value; + } + + return $value; + }, $array + ); + // check if we must add to site + if (isset($array['edit_create_site_view']) + && is_numeric( + $array['edit_create_site_view'] + ) + && $array['edit_create_site_view'] > 0) + { + $this->siteEditView[$array['adminview']] = true; + $this->lang = 'both'; + } + if (isset($array['port']) && $array['port'] + && !$this->addEximport) + { + $this->addEximport = true; + } + if (isset($array['history']) && $array['history'] + && !$this->setTagHistory) + { + $this->setTagHistory = true; + } + if (isset($array['joomla_fields']) + && $array['joomla_fields'] + && !$this->setJoomlaFields) + { + $this->setJoomlaFields = true; + } + // has become a lacacy issue, can't remove this + $array['view'] = $array['adminview']; + // get the admin settings/data + $array['settings'] = $this->getAdminViewData( + $array['view'] + ); + + return $array; + }, array_values($component->addadmin_views) + ); } // set the site_view data - $component->addsite_views = (isset($component->addsite_views) && ComponentbuilderHelper::checkJson($component->addsite_views)) ? json_decode($component->addsite_views, true) : null; + $component->addsite_views = (isset($component->addsite_views) + && ComponentbuilderHelper::checkJson($component->addsite_views)) + ? json_decode($component->addsite_views, true) : null; if (ComponentbuilderHelper::checkArray($component->addsite_views)) { - $this->lang = 'site'; + $this->lang = 'site'; $this->target = 'site'; // build the site_views settings - $component->site_views = array_map(function($array) - { - // has become a lacacy issue, can't remove this - $array['view'] = $array['siteview']; - $array['settings'] = $this->getCustomViewData($array['view']); - return array_map(function($value) - { - if (!ComponentbuilderHelper::checkArray($value) && !ComponentbuilderHelper::checkObject($value) && strval($value) === strval(intval($value))) - { - return (int) $value; - } - return $value; - }, $array); - }, array_values($component->addsite_views)); + $component->site_views = array_map( + function ($array) { + // has become a lacacy issue, can't remove this + $array['view'] = $array['siteview']; + $array['settings'] = $this->getCustomViewData( + $array['view'] + ); + + return array_map( + function ($value) { + if (!ComponentbuilderHelper::checkArray($value) + && !ComponentbuilderHelper::checkObject($value) + && strval($value) === strval(intval($value))) + { + return (int) $value; + } + + return $value; + }, $array + ); + }, array_values($component->addsite_views) + ); // unset original value unset($component->addsite_views); } // set the custom_admin_views data - $component->addcustom_admin_views = (isset($component->addcustom_admin_views) && ComponentbuilderHelper::checkJson($component->addcustom_admin_views)) ? json_decode($component->addcustom_admin_views, true) : null; - if (ComponentbuilderHelper::checkArray($component->addcustom_admin_views)) + $component->addcustom_admin_views + = (isset($component->addcustom_admin_views) + && ComponentbuilderHelper::checkJson( + $component->addcustom_admin_views + )) ? json_decode($component->addcustom_admin_views, true) : null; + if (ComponentbuilderHelper::checkArray( + $component->addcustom_admin_views + )) { - $this->lang = 'admin'; + $this->lang = 'admin'; $this->target = 'custom_admin'; // build the custom_admin_views settings - $component->custom_admin_views = array_map(function($array) - { - // has become a lacacy issue, can't remove this - $array['view'] = $array['customadminview']; - $array['settings'] = $this->getCustomViewData($array['view'], 'custom_admin_view'); - return array_map(function($value) - { - if (!ComponentbuilderHelper::checkArray($value) && !ComponentbuilderHelper::checkObject($value) && strval($value) === strval(intval($value))) - { - return (int) $value; - } - return $value; - }, $array); - }, array_values($component->addcustom_admin_views)); + $component->custom_admin_views = array_map( + function ($array) { + // has become a lacacy issue, can't remove this + $array['view'] = $array['customadminview']; + $array['settings'] = $this->getCustomViewData( + $array['view'], 'custom_admin_view' + ); + + return array_map( + function ($value) { + if (!ComponentbuilderHelper::checkArray($value) + && !ComponentbuilderHelper::checkObject($value) + && strval($value) === strval(intval($value))) + { + return (int) $value; + } + + return $value; + }, $array + ); + }, array_values($component->addcustom_admin_views) + ); // unset original value unset($component->addcustom_admin_views); } // set the config data - $component->addconfig = (isset($component->addconfig) && ComponentbuilderHelper::checkJson($component->addconfig)) ? json_decode($component->addconfig, true) : null; + $component->addconfig = (isset($component->addconfig) + && ComponentbuilderHelper::checkJson($component->addconfig)) + ? json_decode($component->addconfig, true) : null; if (ComponentbuilderHelper::checkArray($component->addconfig)) { - $component->config = array_map(function($field) { - // make sure the alias and title is 0 - $field['alias'] = 0; - $field['title'] = 0; - // set the field details - $this->setFieldDetails($field); - // set unique name counter - $this->setUniqueNameCounter($field['base_name'], 'configs'); - // return field - return $field; - }, array_values($component->addconfig)); + $component->config = array_map( + function ($field) { + // make sure the alias and title is 0 + $field['alias'] = 0; + $field['title'] = 0; + // set the field details + $this->setFieldDetails($field); + // set unique name counter + $this->setUniqueNameCounter($field['base_name'], 'configs'); + + // return field + return $field; + }, array_values($component->addconfig) + ); // do some house cleaning (for fields) foreach ($component->config as $field) @@ -1365,41 +1564,62 @@ class Get } // set the addcustommenus data - $component->addcontributors = (isset($component->addcontributors) && ComponentbuilderHelper::checkJson($component->addcontributors)) ? json_decode($component->addcontributors, true) : null; + $component->addcontributors = (isset($component->addcontributors) + && ComponentbuilderHelper::checkJson($component->addcontributors)) + ? json_decode($component->addcontributors, true) : null; if (ComponentbuilderHelper::checkArray($component->addcontributors)) { - $this->addContributors = true; - $component->contributors = array_values($component->addcontributors); + $this->addContributors = true; + $component->contributors = array_values( + $component->addcontributors + ); } unset($component->addcontributors); // set the addcustommenus data - $component->version_update = (isset($component->version_update) && ComponentbuilderHelper::checkJson($component->version_update)) ? json_decode($component->version_update, true) : null; + $component->version_update = (isset($component->version_update) + && ComponentbuilderHelper::checkJson($component->version_update)) + ? json_decode($component->version_update, true) : null; if (ComponentbuilderHelper::checkArray($component->version_update)) { - $component->version_update = array_values($component->version_update); + $component->version_update = array_values( + $component->version_update + ); } // build update SQL - $old_admin_views = $this->getHistoryWatch('component_admin_views', $component->addadmin_views_id); - $old_component = $this->getHistoryWatch('joomla_component', $this->componentID); + $old_admin_views = $this->getHistoryWatch( + 'component_admin_views', $component->addadmin_views_id + ); + $old_component = $this->getHistoryWatch( + 'joomla_component', $this->componentID + ); if ($old_component || $old_admin_views) { if (ComponentbuilderHelper::checkObject($old_admin_views)) { // add new views if found - if (isset($old_admin_views->addadmin_views) && ComponentbuilderHelper::checkJson($old_admin_views->addadmin_views)) + if (isset($old_admin_views->addadmin_views) + && ComponentbuilderHelper::checkJson( + $old_admin_views->addadmin_views + )) { - $this->setUpdateSQL(json_decode($old_admin_views->addadmin_views, true), $component->addadmin_views, 'adminview'); + $this->setUpdateSQL( + json_decode($old_admin_views->addadmin_views, true), + $component->addadmin_views, 'adminview' + ); } // check if a new version was manualy set if (ComponentbuilderHelper::checkObject($old_component)) { - $old_component_version = preg_replace('/[^0-9.]+/', '', $old_component->component_version); + $old_component_version = preg_replace( + '/[^0-9.]+/', '', $old_component->component_version + ); if ($old_component_version != $this->component_version) { // yes, this is a new version, this mean there may be manual sql and must be checked and updated - $component->old_component_version = $old_component_version; + $component->old_component_version + = $old_component_version; } // clear this data unset($old_component); @@ -1412,7 +1632,9 @@ class Get unset($component->addadmin_views); // set GUI mapper - $guiMapper = array( 'table' => 'joomla_component', 'id' => (int) $this->componentID, 'field' => 'javascript', 'type' => 'js'); + $guiMapper = array('table' => 'joomla_component', + 'id' => (int) $this->componentID, + 'field' => 'javascript', 'type' => 'js'); // add_javascript if ($component->add_javascript == 1) @@ -1436,7 +1658,12 @@ class Get foreach ($addGlobalCss as $area) { // add_css if found - if (isset($component->{'add_css_' . $area}) && $component->{'add_css_' . $area} == 1 && isset($component->{'css_' . $area}) && ComponentbuilderHelper::checkString($component->{'css_' . $area})) + if (isset($component->{'add_css_' . $area}) + && $component->{'add_css_' . $area} == 1 + && isset($component->{'css_' . $area}) + && ComponentbuilderHelper::checkString( + $component->{'css_' . $area} + )) { $this->setCustomScriptBuilder( $component->{'css_' . $area}, @@ -1452,15 +1679,23 @@ class Get // set the lang target $this->lang = 'admin'; // add PHP in ADMIN - $addScriptMethods = array('php_preflight', 'php_postflight', 'php_method'); - $addScriptTypes = array('install', 'update', 'uninstall'); + $addScriptMethods = array('php_preflight', 'php_postflight', + 'php_method'); + $addScriptTypes = array('install', 'update', 'uninstall'); // update GUI mapper $guiMapper['type'] = 'php'; foreach ($addScriptMethods as $scriptMethod) { foreach ($addScriptTypes as $scriptType) { - if (isset($component->{'add_' . $scriptMethod . '_' . $scriptType}) && $component->{'add_' . $scriptMethod . '_' . $scriptType} == 1 && ComponentbuilderHelper::checkString($component->{$scriptMethod . '_' . $scriptType})) + if (isset( + $component->{'add_' . $scriptMethod . '_' . $scriptType} + ) + && $component->{'add_' . $scriptMethod . '_' . $scriptType} + == 1 + && ComponentbuilderHelper::checkString( + $component->{$scriptMethod . '_' . $scriptType} + )) { // set GUI mapper field $guiMapper['field'] = $scriptMethod . '_' . $scriptType; @@ -1480,11 +1715,14 @@ class Get } } // add_php_helper - if ($component->add_php_helper_admin == 1 && ComponentbuilderHelper::checkString($component->php_helper_admin)) + if ($component->add_php_helper_admin == 1 + && ComponentbuilderHelper::checkString( + $component->php_helper_admin + )) { $this->lang = 'admin'; // update GUI mapper - $guiMapper['field'] = 'php_helper_admin'; + $guiMapper['field'] = 'php_helper_admin'; $guiMapper['prefix'] = PHP_EOL . PHP_EOL; $this->setCustomScriptBuilder( $component->php_helper_admin, @@ -1501,7 +1739,8 @@ class Get } unset($component->php_helper); // add_admin_event - if ($component->add_admin_event == 1 && ComponentbuilderHelper::checkString($component->php_admin_event)) + if ($component->add_admin_event == 1 + && ComponentbuilderHelper::checkString($component->php_admin_event)) { $this->lang = 'admin'; // update GUI mapper field @@ -1520,11 +1759,12 @@ class Get } unset($component->php_admin_event); // add_php_helper_both - if ($component->add_php_helper_both == 1 && ComponentbuilderHelper::checkString($component->php_helper_both)) + if ($component->add_php_helper_both == 1 + && ComponentbuilderHelper::checkString($component->php_helper_both)) { $this->lang = 'both'; // update GUI mapper field - $guiMapper['field'] = 'php_helper_both'; + $guiMapper['field'] = 'php_helper_both'; $guiMapper['prefix'] = PHP_EOL . PHP_EOL; $this->setCustomScriptBuilder( $component->php_helper_both, @@ -1540,11 +1780,12 @@ class Get $this->customScriptBuilder['component_php_helper_both'] = ''; } // add_php_helper_site - if ($component->add_php_helper_site == 1 && ComponentbuilderHelper::checkString($component->php_helper_site)) + if ($component->add_php_helper_site == 1 + && ComponentbuilderHelper::checkString($component->php_helper_site)) { $this->lang = 'site'; // update GUI mapper field - $guiMapper['field'] = 'php_helper_site'; + $guiMapper['field'] = 'php_helper_site'; $guiMapper['prefix'] = PHP_EOL . PHP_EOL; $this->setCustomScriptBuilder( $component->php_helper_site, @@ -1561,7 +1802,8 @@ class Get } unset($component->php_helper); // add_site_event - if ($component->add_site_event == 1 && ComponentbuilderHelper::checkString($component->php_site_event)) + if ($component->add_site_event == 1 + && ComponentbuilderHelper::checkString($component->php_site_event)) { $this->lang = 'site'; // update GUI mapper field @@ -1611,7 +1853,9 @@ class Get // README if ($component->addreadme) { - $component->readme = $this->setDynamicValues(base64_decode($component->readme)); + $component->readme = $this->setDynamicValues( + base64_decode($component->readme) + ); } else { @@ -1619,34 +1863,43 @@ class Get } // set lang now - $nowLang = $this->lang; + $nowLang = $this->lang; $this->lang = 'admin'; // dashboard methods - $component->dashboard_tab = (isset($component->dashboard_tab) && ComponentbuilderHelper::checkJson($component->dashboard_tab)) ? json_decode($component->dashboard_tab, true) : null; + $component->dashboard_tab = (isset($component->dashboard_tab) + && ComponentbuilderHelper::checkJson($component->dashboard_tab)) + ? json_decode($component->dashboard_tab, true) : null; if (ComponentbuilderHelper::checkArray($component->dashboard_tab)) { - $component->dashboard_tab = array_map(function($array) - { - $array['html'] = $this->setDynamicValues($array['html']); - return $array; - }, array_values($component->dashboard_tab)); + $component->dashboard_tab = array_map( + function ($array) { + $array['html'] = $this->setDynamicValues($array['html']); + + return $array; + }, array_values($component->dashboard_tab) + ); } else { $component->dashboard_tab = ''; } // add the php of the dashboard if set - if (isset($component->php_dashboard_methods) && ComponentbuilderHelper::checkString($component->php_dashboard_methods)) + if (isset($component->php_dashboard_methods) + && ComponentbuilderHelper::checkString( + $component->php_dashboard_methods + )) { // load the php for the dashboard model $component->php_dashboard_methods = $this->setGuiCodePlaceholder( - $this->setDynamicValues(base64_decode($component->php_dashboard_methods)), + $this->setDynamicValues( + base64_decode($component->php_dashboard_methods) + ), array( 'table' => 'component_dashboard', 'field' => 'php_dashboard_methods', - 'id' => (int) $component->component_dashboard_id, - 'type' => 'php') - ); + 'id' => (int) $component->component_dashboard_id, + 'type' => 'php') + ); } else { @@ -1659,10 +1912,17 @@ class Get $serverArray = array('update_server', 'sales_server'); foreach ($serverArray as $server) { - if ($component->{'add_' . $server} == 1 && is_numeric($component->{$server}) && $component->{$server} > 0) + if ($component->{'add_' . $server} == 1 + && is_numeric( + $component->{$server} + ) + && $component->{$server} > 0) { // get the server protocol - $component->{$server . '_protocol'} = ComponentbuilderHelper::getVar('server', (int) $component->{$server}, 'id', 'protocol'); + $component->{$server . '_protocol'} + = ComponentbuilderHelper::getVar( + 'server', (int) $component->{$server}, 'id', 'protocol' + ); } else { @@ -1676,11 +1936,16 @@ class Get } } // set the ignore folders for repo if found - if (isset($component->toignore) && ComponentbuilderHelper::checkString($component->toignore)) + if (isset($component->toignore) + && ComponentbuilderHelper::checkString( + $component->toignore + )) { if (strpos($component->toignore, ',') !== false) { - $component->toignore = array_map('trim', (array) explode(',', $component->toignore)); + $component->toignore = array_map( + 'trim', (array) explode(',', $component->toignore) + ); } else { @@ -1693,36 +1958,53 @@ class Get $component->toignore = array('.git'); } // get all modules - $component->addjoomla_modules = (isset($component->addjoomla_modules) && ComponentbuilderHelper::checkJson($component->addjoomla_modules)) ? json_decode($component->addjoomla_modules, true) : null; + $component->addjoomla_modules = (isset($component->addjoomla_modules) + && ComponentbuilderHelper::checkJson($component->addjoomla_modules)) + ? json_decode($component->addjoomla_modules, true) : null; if (ComponentbuilderHelper::checkArray($component->addjoomla_modules)) { - $joomla_modules = array_map(function($array) use(&$component) { - // only load the modules whose target association calls for it - if (!isset($array['target']) || $array['target'] != 2) - { - return $this->setJoomlaModule($array['module'], $component); - } - return null; - }, array_values($component->addjoomla_modules)); + $joomla_modules = array_map( + function ($array) use (&$component) { + // only load the modules whose target association calls for it + if (!isset($array['target']) || $array['target'] != 2) + { + return $this->setJoomlaModule( + $array['module'], $component + ); + } + + return null; + }, array_values($component->addjoomla_modules) + ); } unset($component->addjoomla_modules); // get all plugins - $component->addjoomla_plugins = (isset($component->addjoomla_plugins) && ComponentbuilderHelper::checkJson($component->addjoomla_plugins)) ? json_decode($component->addjoomla_plugins, true) : null; + $component->addjoomla_plugins = (isset($component->addjoomla_plugins) + && ComponentbuilderHelper::checkJson($component->addjoomla_plugins)) + ? json_decode($component->addjoomla_plugins, true) : null; if (ComponentbuilderHelper::checkArray($component->addjoomla_plugins)) { - $joomla_plugins = array_map(function($array) use(&$component) { - // only load the plugins whose target association calls for it - if (!isset($array['target']) || $array['target'] != 2) - { - return $this->setJoomlaPlugin($array['plugin'], $component); - } - return null; - }, array_values($component->addjoomla_plugins)); + $joomla_plugins = array_map( + function ($array) use (&$component) { + // only load the plugins whose target association calls for it + if (!isset($array['target']) || $array['target'] != 2) + { + return $this->setJoomlaPlugin( + $array['plugin'], $component + ); + } + + return null; + }, array_values($component->addjoomla_plugins) + ); } unset($component->addjoomla_plugins); // Trigger Event: jcb_ce_onAfterModelComponentData - $this->triggerEvent('jcb_ce_onAfterModelComponentData', array(&$this->componentContext, &$component)); + $this->triggerEvent( + 'jcb_ce_onAfterModelComponentData', + array(&$this->componentContext, &$component) + ); // return the found component data return $component; @@ -1730,20 +2012,25 @@ class Get /** * set the language content values to language content array - * - * @param string $target The target area for the language string - * @param string $language The language key string - * @param string $string The language string - * @param boolean $addPrefix The switch to add langPrefix + * + * @param string $target The target area for the language string + * @param string $language The language key string + * @param string $string The language string + * @param boolean $addPrefix The switch to add langPrefix * * @return void - * + * */ - public function setLangContent($target, $language, $string, $addPrefix = false) - { - if ($addPrefix && !isset($this->langContent[$target][$this->langPrefix . '_' . $language])) + public function setLangContent($target, $language, $string, + $addPrefix = false + ) { + if ($addPrefix + && !isset( + $this->langContent[$target][$this->langPrefix . '_' . $language] + )) { - $this->langContent[$target][$this->langPrefix . '_' . $language] = trim($string); + $this->langContent[$target][$this->langPrefix . '_' . $language] + = trim($string); } elseif (!isset($this->langContent[$target][$language])) { @@ -1753,11 +2040,11 @@ class Get /** * Get all Admin View Data - * - * @param int $id The view ID + * + * @param int $id The view ID * * @return oject The view data - * + * */ public function getAdminViewData($id) { @@ -1770,31 +2057,54 @@ class Get $query->select( $this->db->quoteName( array( - 'b.addfields', - 'b.id', - 'c.addconditions', - 'c.id', - 'r.addrelations', - 't.tabs' + 'b.addfields', + 'b.id', + 'c.addconditions', + 'c.id', + 'r.addrelations', + 't.tabs' ), array( - 'addfields', - 'addfields_id', - 'addconditions', - 'addconditions_id', - 'addrelations', - 'customtabs' + 'addfields', + 'addfields_id', + 'addconditions', + 'addconditions_id', + 'addrelations', + 'customtabs' ) ) ); $query->from('#__componentbuilder_admin_view AS a'); - $query->join('LEFT', $this->db->quoteName('#__componentbuilder_admin_fields', 'b') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('b.admin_view') . ')'); - $query->join('LEFT', $this->db->quoteName('#__componentbuilder_admin_fields_conditions', 'c') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('c.admin_view') . ')'); - $query->join('LEFT', $this->db->quoteName('#__componentbuilder_admin_fields_relations', 'r') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('r.admin_view') . ')'); - $query->join('LEFT', $this->db->quoteName('#__componentbuilder_admin_custom_tabs', 't') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('t.admin_view') . ')'); + $query->join( + 'LEFT', + $this->db->quoteName('#__componentbuilder_admin_fields', 'b') + . ' ON (' . $this->db->quoteName('a.id') . ' = ' + . $this->db->quoteName('b.admin_view') . ')' + ); + $query->join( + 'LEFT', $this->db->quoteName( + '#__componentbuilder_admin_fields_conditions', 'c' + ) . ' ON (' . $this->db->quoteName('a.id') . ' = ' + . $this->db->quoteName('c.admin_view') . ')' + ); + $query->join( + 'LEFT', $this->db->quoteName( + '#__componentbuilder_admin_fields_relations', 'r' + ) . ' ON (' . $this->db->quoteName('a.id') . ' = ' + . $this->db->quoteName('r.admin_view') . ')' + ); + $query->join( + 'LEFT', $this->db->quoteName( + '#__componentbuilder_admin_custom_tabs', 't' + ) . ' ON (' . $this->db->quoteName('a.id') . ' = ' + . $this->db->quoteName('t.admin_view') . ')' + ); $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); // Trigger Event: jcb_ce_onBeforeQueryViewData - $this->triggerEvent('jcb_ce_onBeforeQueryViewData', array(&$this->componentContext, &$id, &$query, &$this->db)); + $this->triggerEvent( + 'jcb_ce_onBeforeQueryViewData', + array(&$this->componentContext, &$id, &$query, &$this->db) + ); // Reset the query using our newly populated query object. $this->db->setQuery($query); @@ -1803,33 +2113,41 @@ class Get $view = $this->db->loadObject(); // setup view name to use in storing the data - $name_single = ComponentbuilderHelper::safeString($view->name_single); - $name_list = ComponentbuilderHelper::safeString($view->name_list); + $name_single = ComponentbuilderHelper::safeString( + $view->name_single + ); + $name_list = ComponentbuilderHelper::safeString($view->name_list); // set upater $updater = array( 'unique' => array( - 'addfields' => array('table' => 'admin_fields', 'val' => (int) $view->addfields_id, 'key' => 'id'), - 'addconditions' => array('table' => 'admin_fields_conditions', 'val' => (int) $view->addconditions_id, 'key' => 'id') + 'addfields' => array('table' => 'admin_fields', + 'val' => (int) $view->addfields_id, + 'key' => 'id'), + 'addconditions' => array('table' => 'admin_fields_conditions', + 'val' => (int) $view->addconditions_id, + 'key' => 'id') ), - 'table' => 'admin_view', - 'key' => 'id', - 'val' => (int) $id + 'table' => 'admin_view', + 'key' => 'id', + 'val' => (int) $id ); // repeatable fields to update $searchRepeatables = array( // repeatablefield => checker - 'addfields' => 'field', - 'addconditions' => 'target_field', - 'ajax_input' => 'value_name', - 'custom_button' => 'name', + 'addfields' => 'field', + 'addconditions' => 'target_field', + 'ajax_input' => 'value_name', + 'custom_button' => 'name', 'addlinked_views' => 'adminview', - 'addtables' => 'table', - 'addtabs' => 'name', - 'addpermissions' => 'action' + 'addtables' => 'table', + 'addtabs' => 'name', + 'addpermissions' => 'action' ); // update the repeatable fields - $view = ComponentbuilderHelper::convertRepeatableFields($view, $searchRepeatables, $updater); + $view = ComponentbuilderHelper::convertRepeatableFields( + $view, $searchRepeatables, $updater + ); // setup token check if (!isset($this->customScriptBuilder['token'])) @@ -1837,26 +2155,55 @@ class Get $this->customScriptBuilder['token'] = array(); } $this->customScriptBuilder['token'][$name_single] = false; - $this->customScriptBuilder['token'][$name_list] = false; + $this->customScriptBuilder['token'][$name_list] = false; // set some placeholders - $this->placeholders[$this->hhh . 'view' . $this->hhh] = ComponentbuilderHelper::safeString($name_single); - $this->placeholders[$this->hhh . 'views' . $this->hhh] = ComponentbuilderHelper::safeString($name_list); - $this->placeholders[$this->hhh . 'View' . $this->hhh] = ComponentbuilderHelper::safeString($name_single, 'F'); - $this->placeholders[$this->hhh . 'Views' . $this->hhh] = ComponentbuilderHelper::safeString($name_list, 'F'); - $this->placeholders[$this->hhh . 'VIEW' . $this->hhh] = ComponentbuilderHelper::safeString($name_single, 'U'); - $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh] = ComponentbuilderHelper::safeString($name_list, 'U'); - $this->placeholders[$this->bbb . 'view' . $this->ddd] = $this->placeholders[$this->hhh . 'view' . $this->hhh]; - $this->placeholders[$this->bbb . 'views' . $this->ddd] = $this->placeholders[$this->hhh . 'views' . $this->hhh]; - $this->placeholders[$this->bbb . 'View' . $this->ddd] = $this->placeholders[$this->hhh . 'View' . $this->hhh]; - $this->placeholders[$this->bbb . 'Views' . $this->ddd] = $this->placeholders[$this->hhh . 'Views' . $this->hhh]; - $this->placeholders[$this->bbb . 'VIEW' . $this->ddd] = $this->placeholders[$this->hhh . 'VIEW' . $this->hhh]; - $this->placeholders[$this->bbb . 'VIEWS' . $this->ddd] = $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh]; + $this->placeholders[$this->hhh . 'view' . $this->hhh] + = ComponentbuilderHelper::safeString( + $name_single + ); + $this->placeholders[$this->hhh . 'views' . $this->hhh] + = ComponentbuilderHelper::safeString( + $name_list + ); + $this->placeholders[$this->hhh . 'View' . $this->hhh] + = ComponentbuilderHelper::safeString( + $name_single, 'F' + ); + $this->placeholders[$this->hhh . 'Views' . $this->hhh] + = ComponentbuilderHelper::safeString( + $name_list, 'F' + ); + $this->placeholders[$this->hhh . 'VIEW' . $this->hhh] + = ComponentbuilderHelper::safeString( + $name_single, 'U' + ); + $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh] + = ComponentbuilderHelper::safeString( + $name_list, 'U' + ); + $this->placeholders[$this->bbb . 'view' . $this->ddd] + = $this->placeholders[$this->hhh . 'view' . $this->hhh]; + $this->placeholders[$this->bbb . 'views' . $this->ddd] + = $this->placeholders[$this->hhh . 'views' . $this->hhh]; + $this->placeholders[$this->bbb . 'View' . $this->ddd] + = $this->placeholders[$this->hhh . 'View' . $this->hhh]; + $this->placeholders[$this->bbb . 'Views' . $this->ddd] + = $this->placeholders[$this->hhh . 'Views' . $this->hhh]; + $this->placeholders[$this->bbb . 'VIEW' . $this->ddd] + = $this->placeholders[$this->hhh . 'VIEW' . $this->hhh]; + $this->placeholders[$this->bbb . 'VIEWS' . $this->ddd] + = $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh]; // Trigger Event: jcb_ce_onBeforeModelViewData - $this->triggerEvent('jcb_ce_onBeforeModelViewData', array(&$this->componentContext, &$view, &$this->placeholders)); + $this->triggerEvent( + 'jcb_ce_onBeforeModelViewData', + array(&$this->componentContext, &$view, &$this->placeholders) + ); // add the tables - $view->addtables = (isset($view->addtables) && ComponentbuilderHelper::checkJson($view->addtables)) ? json_decode($view->addtables, true) : null; + $view->addtables = (isset($view->addtables) + && ComponentbuilderHelper::checkJson($view->addtables)) + ? json_decode($view->addtables, true) : null; if (ComponentbuilderHelper::checkArray($view->addtables)) { $view->tables = array_values($view->addtables); @@ -1865,71 +2212,131 @@ class Get // set custom tabs $this->customTabs[$name_single] = null; - $view->customtabs = (isset($view->customtabs) && ComponentbuilderHelper::checkJson($view->customtabs)) ? json_decode($view->customtabs, true) : null; + $view->customtabs = (isset($view->customtabs) + && ComponentbuilderHelper::checkJson($view->customtabs)) + ? json_decode($view->customtabs, true) : null; if (ComponentbuilderHelper::checkArray($view->customtabs)) { // setup custom tabs to global data sets - $this->customTabs[$name_single] = array_map( function ($tab) use($name_single) { - // set the view name - $tab['view'] = $name_single; - // load the dynamic data - $tab['html'] = $this->setPlaceholders($this->setDynamicValues($tab['html']), $this->placeholders); - // set the tab name - $tab['name'] = (isset($tab['name']) && ComponentbuilderHelper::checkString($tab['name'])) ? $tab['name'] : 'Tab'; - // set lang - $tab['lang'] = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($tab['view'], 'U') . '_' . ComponentbuilderHelper::safeString($tab['name'], 'U'); - $this->setLangContent('both', $tab['lang'], $tab['name']); - // set code name - $tab['code'] = ComponentbuilderHelper::safeString($tab['name']); - // check if the permissions for the tab should be added - $_tab = ''; - if (isset($tab['permission']) && $tab['permission'] == 1) - { - $_tab = $this->_t(1); - } - // check if the php of the tab is set, if not load it now - if (strpos($tab['html'], 'bootstrap.addTab') === false && strpos($tab['html'], 'bootstrap.endTab') === false) - { - // add the tab - $tmp = PHP_EOL . $_tab . $this->_t(1) . ""; - $tmp .= PHP_EOL . $_tab . $this->_t(2) . '
'; - $tmp .= PHP_EOL . $_tab . $this->_t(3) . '
'; - $tmp .= PHP_EOL . $_tab . $this->_t(4) . implode(PHP_EOL . $_tab . $this->_t(4), (array) explode(PHP_EOL, trim($tab['html']))); - $tmp .= PHP_EOL . $_tab . $this->_t(3) . '
'; - $tmp .= PHP_EOL . $_tab . $this->_t(2) . '
'; - $tmp .= PHP_EOL . $_tab . $this->_t(1) . ""; - // update html - $tab['html'] = $tmp; - } - else - { - $tab['html'] = PHP_EOL . $_tab. $this->_t(1) . implode(PHP_EOL . $_tab. $this->_t(1), (array) explode(PHP_EOL, trim($tab['html']))); - } - // add the permissions if needed - if (isset($tab['permission']) && $tab['permission'] == 1) - { - $tmp = PHP_EOL . $this->_t(1) . "canDo->get('" . $tab['view'] . "." . $tab['code'] . ".viewtab')) : ?>"; - $tmp .= $tab['html']; - $tmp .= PHP_EOL . $this->_t(1) . ""; - // update html - $tab['html'] = $tmp; - // set lang for permissions - $tab['lang_permission'] = $tab['lang'] . '_TAB_PERMISSION'; - $tab['lang_permission_desc'] = $tab['lang'] . '_TAB_PERMISSION_DESC'; - $tab['lang_permission_title'] = $this->placeholders[$this->hhh . 'Views' . $this->hhh] . ' View ' . $tab['name'] . ' Tab'; - $this->setLangContent('both', $tab['lang_permission'], $tab['lang_permission_title']); - $this->setLangContent('both', $tab['lang_permission_desc'], 'Allow the users in this group to view ' . $tab['name'] . ' Tab of ' . $this->placeholders[$this->hhh . 'views' . $this->hhh]); - // set the sort key - $tab['sortKey'] = ComponentbuilderHelper::safeString($tab['lang_permission_title']); - } - // return tab - return $tab; - }, array_values($view->customtabs)); + $this->customTabs[$name_single] = array_map( + function ($tab) use ($name_single) { + // set the view name + $tab['view'] = $name_single; + // load the dynamic data + $tab['html'] = $this->setPlaceholders( + $this->setDynamicValues($tab['html']), + $this->placeholders + ); + // set the tab name + $tab['name'] = (isset($tab['name']) + && ComponentbuilderHelper::checkString( + $tab['name'] + )) ? $tab['name'] : 'Tab'; + // set lang + $tab['lang'] = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString( + $tab['view'], 'U' + ) . '_' . ComponentbuilderHelper::safeString( + $tab['name'], 'U' + ); + $this->setLangContent( + 'both', $tab['lang'], $tab['name'] + ); + // set code name + $tab['code'] = ComponentbuilderHelper::safeString( + $tab['name'] + ); + // check if the permissions for the tab should be added + $_tab = ''; + if (isset($tab['permission']) + && $tab['permission'] == 1) + { + $_tab = $this->_t(1); + } + // check if the php of the tab is set, if not load it now + if (strpos($tab['html'], 'bootstrap.addTab') === false + && strpos($tab['html'], 'bootstrap.endTab') + === false) + { + // add the tab + $tmp = PHP_EOL . $_tab . $this->_t(1) + . ""; + $tmp .= PHP_EOL . $_tab . $this->_t(2) + . '
'; + $tmp .= PHP_EOL . $_tab . $this->_t(3) + . '
'; + $tmp .= PHP_EOL . $_tab . $this->_t(4) . implode( + PHP_EOL . $_tab . $this->_t(4), + (array) explode(PHP_EOL, trim($tab['html'])) + ); + $tmp .= PHP_EOL . $_tab . $this->_t(3) . '
'; + $tmp .= PHP_EOL . $_tab . $this->_t(2) . '
'; + $tmp .= PHP_EOL . $_tab . $this->_t(1) + . ""; + // update html + $tab['html'] = $tmp; + } + else + { + $tab['html'] = PHP_EOL . $_tab . $this->_t(1) + . implode( + PHP_EOL . $_tab . $this->_t(1), + (array) explode(PHP_EOL, trim($tab['html'])) + ); + } + // add the permissions if needed + if (isset($tab['permission']) + && $tab['permission'] == 1) + { + $tmp = PHP_EOL . $this->_t(1) + . "canDo->get('" + . $tab['view'] . "." . $tab['code'] + . ".viewtab')) : ?>"; + $tmp .= $tab['html']; + $tmp .= PHP_EOL . $this->_t(1) . ""; + // update html + $tab['html'] = $tmp; + // set lang for permissions + $tab['lang_permission'] = $tab['lang'] + . '_TAB_PERMISSION'; + $tab['lang_permission_desc'] = $tab['lang'] + . '_TAB_PERMISSION_DESC'; + $tab['lang_permission_title'] + = $this->placeholders[$this->hhh + . 'Views' . $this->hhh] . ' View ' + . $tab['name'] . ' Tab'; + $this->setLangContent( + 'both', $tab['lang_permission'], + $tab['lang_permission_title'] + ); + $this->setLangContent( + 'both', $tab['lang_permission_desc'], + 'Allow the users in this group to view ' + . $tab['name'] . ' Tab of ' + . $this->placeholders[$this->hhh . 'views' + . $this->hhh] + ); + // set the sort key + $tab['sortKey'] + = ComponentbuilderHelper::safeString( + $tab['lang_permission_title'] + ); + } + + // return tab + return $tab; + }, array_values($view->customtabs) + ); } unset($view->customtabs); // add the local tabs - $view->addtabs = (isset($view->addtabs) && ComponentbuilderHelper::checkJson($view->addtabs)) ? json_decode($view->addtabs, true) : null; + $view->addtabs = (isset($view->addtabs) + && ComponentbuilderHelper::checkJson($view->addtabs)) + ? json_decode($view->addtabs, true) : null; if (ComponentbuilderHelper::checkArray($view->addtabs)) { $nr = 1; @@ -1945,7 +2352,9 @@ class Get $view->tabs[1] = 'Details'; } // always make sure that publishing is lowercase - if (($removeKey = array_search('publishing', array_map('strtolower', $view->tabs))) !== false) + if (($removeKey = array_search( + 'publishing', array_map('strtolower', $view->tabs) + )) !== false) { $view->tabs[$removeKey] = 'publishing'; } @@ -1953,7 +2362,9 @@ class Get $view->tabs[15] = 'publishing'; unset($view->addtabs); // add permissions - $view->addpermissions = (isset($view->addpermissions) && ComponentbuilderHelper::checkJson($view->addpermissions)) ? json_decode($view->addpermissions, true) : null; + $view->addpermissions = (isset($view->addpermissions) + && ComponentbuilderHelper::checkJson($view->addpermissions)) + ? json_decode($view->addpermissions, true) : null; if (ComponentbuilderHelper::checkArray($view->addpermissions)) { $view->permissions = array_values($view->addpermissions); @@ -1962,40 +2373,60 @@ class Get // reset fields $view->fields = array(); // set fields - $view->addfields = (isset($view->addfields) && ComponentbuilderHelper::checkJson($view->addfields)) ? json_decode($view->addfields, true) : null; + $view->addfields = (isset($view->addfields) + && ComponentbuilderHelper::checkJson($view->addfields)) + ? json_decode($view->addfields, true) : null; if (ComponentbuilderHelper::checkArray($view->addfields)) { $ignoreFields = array(); // load the field data - $view->fields = array_map(function($field) use($name_single, $name_list, &$ignoreFields) - { - // set the field details - $this->setFieldDetails($field, $name_single, $name_list); - // check if this field is a default field OR - // check if this is none database related field - if (in_array($field['base_name'], $this->defaultFields) || - ComponentbuilderHelper::fieldCheck($field['type_name'], 'spacer') || - (isset($field['list']) && $field['list'] == 2)) // 2 = none database - { - $ignoreFields[$field['field']] = $field['field']; - } - // return field - return $field; - }, array_values($view->addfields)); + $view->fields = array_map( + function ($field) use ( + $name_single, $name_list, &$ignoreFields + ) { + // set the field details + $this->setFieldDetails( + $field, $name_single, $name_list + ); + // check if this field is a default field OR + // check if this is none database related field + if (in_array($field['base_name'], $this->defaultFields) + || ComponentbuilderHelper::fieldCheck( + $field['type_name'], 'spacer' + ) + || (isset($field['list']) + && $field['list'] == 2)) // 2 = none database + { + $ignoreFields[$field['field']] = $field['field']; + } + + // return field + return $field; + }, array_values($view->addfields) + ); // build update SQL - if ($old_view = $this->getHistoryWatch('admin_fields', $view->addfields_id)) + if ($old_view = $this->getHistoryWatch( + 'admin_fields', $view->addfields_id + )) { // add new fields were added - if (isset($old_view->addfields) && ComponentbuilderHelper::checkJson($old_view->addfields)) + if (isset($old_view->addfields) + && ComponentbuilderHelper::checkJson( + $old_view->addfields + )) { - $this->setUpdateSQL(json_decode($old_view->addfields, true), $view->addfields, 'field', $name_single, $ignoreFields); + $this->setUpdateSQL( + json_decode($old_view->addfields, true), + $view->addfields, 'field', $name_single, + $ignoreFields + ); } // clear this data unset($old_view); } // sort the fields acording to order - usort($view->fields, function($a, $b) - { + usort( + $view->fields, function ($a, $b) { if (isset($a['order_list']) && isset($b['order_list'])) { if ($a['order_list'] != 0 && $b['order_list'] != 0) @@ -2010,59 +2441,103 @@ class Get { return 0; } + return 1; } + return 0; - }); + } + ); // do some house cleaning (for fields) foreach ($view->fields as $field) { // so first we lock the field name in $field_name = $this->getFieldName($field, $name_list); // check if the field changed since the last compilation (default fields never change and are always added) - if (!isset($ignoreFields[$field['field']]) && ComponentbuilderHelper::checkObject($field['settings']->history)) + if (!isset($ignoreFields[$field['field']]) + && ComponentbuilderHelper::checkObject( + $field['settings']->history + )) { // check if the datatype changed if (isset($field['settings']->history->datatype)) { - $this->setUpdateSQL($field['settings']->history->datatype, $field['settings']->datatype, 'field.datatype', $name_single . '.' . $field_name); + $this->setUpdateSQL( + $field['settings']->history->datatype, + $field['settings']->datatype, 'field.datatype', + $name_single . '.' . $field_name + ); } // check if the datatype lenght changed - if (isset($field['settings']->history->datalenght) && isset($field['settings']->history->datalenght_other)) + if (isset($field['settings']->history->datalenght) + && isset($field['settings']->history->datalenght_other)) { - $this->setUpdateSQL($field['settings']->history->datalenght . $field['settings']->history->datalenght_other, $field['settings']->datalenght . $field['settings']->datalenght_other, 'field.lenght', $name_single . '.' . $field_name); + $this->setUpdateSQL( + $field['settings']->history->datalenght + . $field['settings']->history->datalenght_other, + $field['settings']->datalenght + . $field['settings']->datalenght_other, + 'field.lenght', $name_single . '.' . $field_name + ); } // check if the name changed - if (isset($field['settings']->history->xml) && ComponentbuilderHelper::checkJson($field['settings']->history->xml)) + if (isset($field['settings']->history->xml) + && ComponentbuilderHelper::checkJson( + $field['settings']->history->xml + )) { // only run if this is not an alias or a tag - if ((!isset($field['alias']) || !$field['alias']) && 'tag' !== $field['settings']->type_name) + if ((!isset($field['alias']) || !$field['alias']) + && 'tag' !== $field['settings']->type_name) { // build temp field bucket - $tmpfield = array(); + $tmpfield = array(); $tmpfield['settings'] = new stdClass(); // convert the xml json string to normal string - $tmpfield['settings']->xml = $this->setDynamicValues(json_decode($field['settings']->history->xml)); + $tmpfield['settings']->xml + = $this->setDynamicValues( + json_decode( + $field['settings']->history->xml + ) + ); // add properties from current field as it is generic - $tmpfield['settings']->properties = $field['settings']->properties; + $tmpfield['settings']->properties + = $field['settings']->properties; // add the old name - $tmpfield['settings']->name = $field['settings']->history->name; + $tmpfield['settings']->name + = $field['settings']->history->name; // add the field type from current field since it is generic - $tmpfield['settings']->type_name = $field['settings']->type_name; + $tmpfield['settings']->type_name + = $field['settings']->type_name; // get the old name - $old_field_name = $this->getFieldName($tmpfield); + $old_field_name = $this->getFieldName( + $tmpfield + ); // only run this if not a multi field if (!isset($this->uniqueNames[$name_list]['names'][$field_name])) { // this only works when the field is not multiple of the same field - $this->setUpdateSQL($old_field_name, $field_name, 'field.name', $name_single . '.' . $field_name); + $this->setUpdateSQL( + $old_field_name, $field_name, + 'field.name', + $name_single . '.' . $field_name + ); } elseif ($old_field_name !== $field_name) { // give a notice atleast that the multi fields could have changed and no DB update was done - $this->app->enqueueMessage(JText::_('

Field Notice

'), 'Notice'); - $this->app->enqueueMessage(JText::sprintf('You have a field called %s that has been added multiple times to the %s view, the name of that field has changed to %s. Normaly we would automaticly add the update SQL to your component, but with multiple fields this does not work automaticly since it could be that noting changed and it just seems like it did. Therefore you will have to do this manualy if it actualy did change!', $field_name, $name_single, $old_field_name), 'Notice'); + $this->app->enqueueMessage( + JText::_('

Field Notice

'), + 'Notice' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'You have a field called %s that has been added multiple times to the %s view, the name of that field has changed to %s. Normaly we would automaticly add the update SQL to your component, but with multiple fields this does not work automaticly since it could be that noting changed and it just seems like it did. Therefore you will have to do this manualy if it actualy did change!', + $field_name, $name_single, + $old_field_name + ), 'Notice' + ); } // remove tmp unset($tmpfield); @@ -2078,52 +2553,99 @@ class Get // check if the view name changed if (ComponentbuilderHelper::checkString($old_view->name_single)) { - $this->setUpdateSQL(ComponentbuilderHelper::safeString($old_view->name_single), $name_single, 'table_name', $name_single); + $this->setUpdateSQL( + ComponentbuilderHelper::safeString( + $old_view->name_single + ), $name_single, 'table_name', $name_single + ); } // loop the mysql table settings - foreach ($this->mysqlTableKeys as $_mysqlTableKey => $_mysqlTableVal) + foreach ( + $this->mysqlTableKeys as $_mysqlTableKey => $_mysqlTableVal + ) { // check if the table engine changed - if (isset($old_view->{'mysql_table_' . $_mysqlTableKey}) && isset($view->{'mysql_table_' . $_mysqlTableKey})) + if (isset($old_view->{'mysql_table_' . $_mysqlTableKey}) + && isset($view->{'mysql_table_' . $_mysqlTableKey})) { - $this->setUpdateSQL( $old_view->{'mysql_table_' . $_mysqlTableKey}, $view->{'mysql_table_' . $_mysqlTableKey}, 'table_' . $_mysqlTableKey, $name_single); + $this->setUpdateSQL( + $old_view->{'mysql_table_' . $_mysqlTableKey}, + $view->{'mysql_table_' . $_mysqlTableKey}, + 'table_' . $_mysqlTableKey, $name_single + ); } // check if there is no history on table engine, and it changed from the default/global - elseif (isset($view->{'mysql_table_' . $_mysqlTableKey}) && ComponentbuilderHelper::checkString($view->{'mysql_table_' . $_mysqlTableKey}) && !is_numeric($view->{'mysql_table_' . $_mysqlTableKey})) + elseif (isset($view->{'mysql_table_' . $_mysqlTableKey}) + && ComponentbuilderHelper::checkString( + $view->{'mysql_table_' . $_mysqlTableKey} + ) + && !is_numeric( + $view->{'mysql_table_' . $_mysqlTableKey} + )) { - $this->setUpdateSQL($_mysqlTableVal['default'], $view->{'mysql_table_' . $_mysqlTableKey}, 'table_' . $_mysqlTableKey, $name_single); + $this->setUpdateSQL( + $_mysqlTableVal['default'], + $view->{'mysql_table_' . $_mysqlTableKey}, + 'table_' . $_mysqlTableKey, $name_single + ); } } // clear this data unset($old_view); } // set the conditions - $view->addconditions = (isset($view->addconditions) && ComponentbuilderHelper::checkJson($view->addconditions)) ? json_decode($view->addconditions, true) : null; + $view->addconditions = (isset($view->addconditions) + && ComponentbuilderHelper::checkJson($view->addconditions)) + ? json_decode($view->addconditions, true) : null; if (ComponentbuilderHelper::checkArray($view->addconditions)) { $view->conditions = array(); - $ne = 0; + $ne = 0; foreach ($view->addconditions as $nr => $conditionValue) { - if (ComponentbuilderHelper::checkArray($conditionValue['target_field']) && ComponentbuilderHelper::checkArray($view->fields)) + if (ComponentbuilderHelper::checkArray( + $conditionValue['target_field'] + ) + && ComponentbuilderHelper::checkArray($view->fields)) { - foreach ($conditionValue['target_field'] as $fieldKey => $fieldId) + foreach ( + $conditionValue['target_field'] as $fieldKey => + $fieldId + ) { foreach ($view->fields as $fieldValues) { - if ((int) $fieldValues['field'] == (int) $fieldId) + if ((int) $fieldValues['field'] + == (int) $fieldId) { // load the field details - $required = ComponentbuilderHelper::getBetween($fieldValues['settings']->xml, 'required="', '"'); - $required = ($required === 'true' || $required === '1') ? 'yes' : 'no'; - $filter = ComponentbuilderHelper::getBetween($fieldValues['settings']->xml, 'filter="', '"'); - $filter = ComponentbuilderHelper::checkString($filter) ? $filter : 'none'; + $required + = ComponentbuilderHelper::getBetween( + $fieldValues['settings']->xml, + 'required="', '"' + ); + $required = ($required === 'true' + || $required === '1') ? 'yes' : 'no'; + $filter + = ComponentbuilderHelper::getBetween( + $fieldValues['settings']->xml, + 'filter="', '"' + ); + $filter + = ComponentbuilderHelper::checkString( + $filter + ) ? $filter : 'none'; // set the field name - $conditionValue['target_field'][$fieldKey] = array( - 'name' => $this->getFieldName($fieldValues, $name_list), - 'type' => $this->getFieldType($fieldValues), + $conditionValue['target_field'][$fieldKey] + = array( + 'name' => $this->getFieldName( + $fieldValues, $name_list + ), + 'type' => $this->getFieldType( + $fieldValues + ), 'required' => $required, - 'filter' => $filter + 'filter' => $filter ); break; } @@ -2132,22 +2654,32 @@ class Get } // load match field - if (ComponentbuilderHelper::checkArray($view->fields) && isset($conditionValue['match_field'])) + if (ComponentbuilderHelper::checkArray($view->fields) + && isset($conditionValue['match_field'])) { foreach ($view->fields as $fieldValue) { - if ((int) $fieldValue['field'] == (int) $conditionValue['match_field']) + if ((int) $fieldValue['field'] + == (int) $conditionValue['match_field']) { // set the type $type = $this->getFieldType($fieldValue); // set the field details - $conditionValue['match_name'] = $this->getFieldName($fieldValue, $name_list); + $conditionValue['match_name'] + = $this->getFieldName( + $fieldValue, $name_list + ); $conditionValue['match_type'] = $type; - $conditionValue['match_xml'] = $fieldValue['settings']->xml; + $conditionValue['match_xml'] + = $fieldValue['settings']->xml; // if custom field load field being extended if (!ComponentbuilderHelper::fieldCheck($type)) { - $conditionValue['match_extends'] = ComponentbuilderHelper::getBetween($fieldValue['settings']->xml, 'extends="', '"'); + $conditionValue['match_extends'] + = ComponentbuilderHelper::getBetween( + $fieldValue['settings']->xml, + 'extends="', '"' + ); } else { @@ -2165,49 +2697,86 @@ class Get unset($view->addconditions); // prep the buckets - $this->fieldRelations[$name_list] = array(); - $this->listJoinBuilder[$name_list] = array(); + $this->fieldRelations[$name_list] = array(); + $this->listJoinBuilder[$name_list] = array(); $this->listHeadOverRide[$name_list] = array(); // set the relations - $view->addrelations = (isset($view->addrelations) && ComponentbuilderHelper::checkJson($view->addrelations)) ? json_decode($view->addrelations, true) : null; + $view->addrelations = (isset($view->addrelations) + && ComponentbuilderHelper::checkJson($view->addrelations)) + ? json_decode($view->addrelations, true) : null; if (ComponentbuilderHelper::checkArray($view->addrelations)) { foreach ($view->addrelations as $nr => $relationsValue) { // only add if list view field is selected and joind fields are set - if (isset($relationsValue['listfield']) && is_numeric($relationsValue['listfield']) && $relationsValue['listfield'] > 0 && - isset($relationsValue['area']) && is_numeric($relationsValue['area']) && $relationsValue['area'] > 0) + if (isset($relationsValue['listfield']) + && is_numeric( + $relationsValue['listfield'] + ) + && $relationsValue['listfield'] > 0 + && isset($relationsValue['area']) + && is_numeric($relationsValue['area']) + && $relationsValue['area'] > 0) { // do a dynamic update on the set values - if (isset($relationsValue['set']) && ComponentbuilderHelper::checkString($relationsValue['set'])) + if (isset($relationsValue['set']) + && ComponentbuilderHelper::checkString( + $relationsValue['set'] + )) { - $relationsValue['set'] = $this->setDynamicValues($relationsValue['set']); + $relationsValue['set'] = $this->setDynamicValues( + $relationsValue['set'] + ); } // check that the arrays are set - if (!isset($this->fieldRelations[$name_list][(int) $relationsValue['listfield']]) || !ComponentbuilderHelper::checkArray($this->fieldRelations[$name_list][(int) $relationsValue['listfield']])) + if (!isset($this->fieldRelations[$name_list][(int) $relationsValue['listfield']]) + || !ComponentbuilderHelper::checkArray( + $this->fieldRelations[$name_list][(int) $relationsValue['listfield']] + )) { - $this->fieldRelations[$name_list][(int) $relationsValue['listfield']] = array(); + $this->fieldRelations[$name_list][(int) $relationsValue['listfield']] + = array(); } // load the field relations - $this->fieldRelations[$name_list][ (int) $relationsValue['listfield']][ (int) $relationsValue['area']] = $relationsValue; + $this->fieldRelations[$name_list][(int) $relationsValue['listfield']][(int) $relationsValue['area']] + = $relationsValue; // load the list joints - if (isset($relationsValue['joinfields']) && ComponentbuilderHelper::checkArray($relationsValue['joinfields'])) + if (isset($relationsValue['joinfields']) + && ComponentbuilderHelper::checkArray( + $relationsValue['joinfields'] + )) { foreach ($relationsValue['joinfields'] as $join) { - $this->listJoinBuilder[$name_list][(int) $join] = (int) $join; + $this->listJoinBuilder[$name_list][(int) $join] + = (int) $join; } } // set header over-ride - if (isset($relationsValue['column_name']) && ComponentbuilderHelper::checkString($relationsValue['column_name'])) + if (isset($relationsValue['column_name']) + && ComponentbuilderHelper::checkString( + $relationsValue['column_name'] + )) { - $check_column_name = trim(strtolower($relationsValue['column_name'])); + $check_column_name = trim( + strtolower($relationsValue['column_name']) + ); // confirm it should really make the over ride if ('default' !== $check_column_name) { - $column_name_lang = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($name_list, 'U') . '_' . ComponentbuilderHelper::safeString($relationsValue['column_name'], 'U'); - $this->setLangContent('admin', $column_name_lang, $relationsValue['column_name']); - $this->listHeadOverRide[$name_list][(int) $relationsValue['listfield']] = $column_name_lang; + $column_name_lang = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString( + $name_list, 'U' + ) . '_' + . ComponentbuilderHelper::safeString( + $relationsValue['column_name'], 'U' + ); + $this->setLangContent( + 'admin', $column_name_lang, + $relationsValue['column_name'] + ); + $this->listHeadOverRide[$name_list][(int) $relationsValue['listfield']] + = $column_name_lang; } } } @@ -2217,11 +2786,16 @@ class Get // set linked views $this->linkedAdminViews[$name_single] = null; - $view->addlinked_views = (isset($view->addlinked_views) && ComponentbuilderHelper::checkJson($view->addlinked_views)) ? json_decode($view->addlinked_views, true) : null; + $view->addlinked_views + = (isset($view->addlinked_views) + && ComponentbuilderHelper::checkJson($view->addlinked_views)) + ? json_decode($view->addlinked_views, true) : null; if (ComponentbuilderHelper::checkArray($view->addlinked_views)) { // setup linked views to global data sets - $this->linkedAdminViews[$name_single] = array_values($view->addlinked_views); + $this->linkedAdminViews[$name_single] = array_values( + $view->addlinked_views + ); } unset($view->addlinked_views); // set the lang target @@ -2231,16 +2805,23 @@ class Get $this->lang = 'both'; } // set GUI mapper - $guiMapper = array( 'table' => 'admin_view', 'id' => (int) $id, 'type' => 'js'); + $guiMapper = array('table' => 'admin_view', 'id' => (int) $id, + 'type' => 'js'); // add_javascript - $addArrayJ = array('javascript_view_file', 'javascript_view_footer', 'javascript_views_file', 'javascript_views_footer'); + $addArrayJ = array('javascript_view_file', 'javascript_view_footer', + 'javascript_views_file', + 'javascript_views_footer'); // update GUI mapper $guiMapper['prefix'] = PHP_EOL; foreach ($addArrayJ as $scripter) { - if (isset($view->{'add_' . $scripter}) && $view->{'add_' . $scripter} == 1 && ComponentbuilderHelper::checkString($view->$scripter)) + if (isset($view->{'add_' . $scripter}) + && $view->{'add_' . $scripter} == 1 + && ComponentbuilderHelper::checkString($view->$scripter)) { - $scripter_target = str_replace('javascript_', '', $scripter); + $scripter_target = str_replace( + 'javascript_', '', $scripter + ); // update GUI mapper field $guiMapper['field'] = $scripter; $this->setCustomScriptBuilder( @@ -2254,11 +2835,15 @@ class Get true ); // check if a token must be set - if (strpos($view->$scripter, "token") !== false || strpos($view->$scripter, "task=ajax") !== false) + if (strpos($view->$scripter, "token") !== false + || strpos( + $view->$scripter, "task=ajax" + ) !== false) { if (!$this->customScriptBuilder['token'][$name_single]) { - $this->customScriptBuilder['token'][$name_single] = true; + $this->customScriptBuilder['token'][$name_single] + = true; } } unset($view->{$scripter}); @@ -2269,7 +2854,9 @@ class Get $addArrayC = array('css_view', 'css_views'); foreach ($addArrayC as $scripter) { - if (isset($view->{'add_' . $scripter}) && $view->{'add_' . $scripter} == 1 && ComponentbuilderHelper::checkString($view->{$scripter})) + if (isset($view->{'add_' . $scripter}) + && $view->{'add_' . $scripter} == 1 + && ComponentbuilderHelper::checkString($view->{$scripter})) { $this->setCustomScriptBuilder( $view->{$scripter}, @@ -2287,10 +2874,19 @@ class Get // update GUI mapper $guiMapper['type'] = 'php'; // add_php - $addArrayP = array('php_getitem', 'php_before_save', 'php_save', 'php_getform', 'php_postsavehook', 'php_getitems', 'php_getitems_after_all', 'php_getlistquery', 'php_allowadd', 'php_allowedit', 'php_before_cancel', 'php_after_cancel', 'php_before_delete', 'php_after_delete', 'php_before_publish', 'php_after_publish', 'php_batchcopy', 'php_batchmove', 'php_document'); + $addArrayP = array('php_getitem', 'php_before_save', 'php_save', + 'php_getform', 'php_postsavehook', + 'php_getitems', 'php_getitems_after_all', + 'php_getlistquery', 'php_allowadd', + 'php_allowedit', 'php_before_cancel', + 'php_after_cancel', 'php_before_delete', + 'php_after_delete', 'php_before_publish', + 'php_after_publish', 'php_batchcopy', + 'php_batchmove', 'php_document'); foreach ($addArrayP as $scripter) { - if (isset($view->{'add_' . $scripter}) && $view->{'add_' . $scripter} == 1) + if (isset($view->{'add_' . $scripter}) + && $view->{'add_' . $scripter} == 1) { // update GUI mapper field $guiMapper['field'] = $scripter; @@ -2305,7 +2901,8 @@ class Get } } // add the custom buttons - if (isset($view->add_custom_button) && $view->add_custom_button == 1) + if (isset($view->add_custom_button) + && $view->add_custom_button == 1) { $button_code_array = array( 'php_model', @@ -2316,18 +2913,26 @@ class Get // set for the code foreach ($button_code_array as $button_code_field) { - if (isset($view->{$button_code_field}) && ComponentbuilderHelper::checkString($view->{$button_code_field})) + if (isset($view->{$button_code_field}) + && ComponentbuilderHelper::checkString( + $view->{$button_code_field} + )) { // set field $guiMapper['field'] = $button_code_field; - $view->{$button_code_field} = $this->setGuiCodePlaceholder( - $this->setDynamicValues(base64_decode($view->{$button_code_field})), + $view->{$button_code_field} + = $this->setGuiCodePlaceholder( + $this->setDynamicValues( + base64_decode($view->{$button_code_field}) + ), $guiMapper - ); + ); } } // set the button array - $view->custom_button = (isset($view->custom_button) && ComponentbuilderHelper::checkJson($view->custom_button)) ? json_decode($view->custom_button, true) : null; + $view->custom_button = (isset($view->custom_button) + && ComponentbuilderHelper::checkJson($view->custom_button)) + ? json_decode($view->custom_button, true) : null; if (ComponentbuilderHelper::checkArray($view->custom_button)) { $view->custom_buttons = array_values($view->custom_button); @@ -2335,12 +2940,19 @@ class Get unset($view->custom_button); } // set custom import scripts - if (isset($view->add_custom_import) && $view->add_custom_import == 1) + if (isset($view->add_custom_import) + && $view->add_custom_import == 1) { - $addImportArray = array('php_import_ext', 'php_import_display', 'php_import', 'php_import_setdata', 'php_import_save', 'php_import_headers', 'html_import_view'); + $addImportArray = array('php_import_ext', 'php_import_display', + 'php_import', 'php_import_setdata', + 'php_import_save', 'php_import_headers', + 'html_import_view'); foreach ($addImportArray as $importScripter) { - if (isset($view->$importScripter) && strlen($view->$importScripter) > 0) + if (isset($view->$importScripter) + && strlen( + $view->$importScripter + ) > 0) { // update GUI mapper field $guiMapper['field'] = $importScripter; @@ -2356,7 +2968,11 @@ class Get else { // load the default - $this->customScriptBuilder[$importScripter]['import_' . $name_list] = ComponentbuilderHelper::getDynamicScripts($importScripter, true); + $this->customScriptBuilder[$importScripter]['import_' + . $name_list] + = ComponentbuilderHelper::getDynamicScripts( + $importScripter, true + ); } } } @@ -2366,7 +2982,7 @@ class Get { // insure the token is added to edit view atleast $this->customScriptBuilder['token'][$name_single] = true; - $addAjaxSite = false; + $addAjaxSite = false; if (isset($this->siteEditView[$id]) && $this->siteEditView[$id]) { // we should add this site ajax to front ajax @@ -2377,14 +2993,18 @@ class Get } } // check if controller input as been set - $view->ajax_input = (isset($view->ajax_input) && ComponentbuilderHelper::checkJson($view->ajax_input)) ? json_decode($view->ajax_input, true) : null; + $view->ajax_input = (isset($view->ajax_input) + && ComponentbuilderHelper::checkJson($view->ajax_input)) + ? json_decode($view->ajax_input, true) : null; if (ComponentbuilderHelper::checkArray($view->ajax_input)) { if ($addAjaxSite) { - $this->customScriptBuilder['site']['ajax_controller'][$name_single] = array_values($view->ajax_input); + $this->customScriptBuilder['site']['ajax_controller'][$name_single] + = array_values($view->ajax_input); } - $this->customScriptBuilder['admin']['ajax_controller'][$name_single] = array_values($view->ajax_input); + $this->customScriptBuilder['admin']['ajax_controller'][$name_single] + = array_values($view->ajax_input); $this->addAjax = true; unset($view->ajax_input); } @@ -2417,26 +3037,32 @@ class Get } } // activate alias builder - if (!isset($this->customAliasBuilder[$name_single]) && isset($view->alias_builder_type) && 2 == $view->alias_builder_type && isset($view->alias_builder) && ComponentbuilderHelper::checkJson($view->alias_builder)) + if (!isset($this->customAliasBuilder[$name_single]) + && isset($view->alias_builder_type) + && 2 == $view->alias_builder_type + && isset($view->alias_builder) + && ComponentbuilderHelper::checkJson($view->alias_builder)) { // get the aliasFields $alias_fields = (array) json_decode($view->alias_builder, true); // get the active fields - $alias_fields = (array) array_filter($view->fields, function($field) use($alias_fields) + $alias_fields = (array) array_filter( + $view->fields, function ($field) use ($alias_fields) { + // check if field is in view fields + if (in_array($field['field'], $alias_fields)) { - // check if field is in view fields - if (in_array($field['field'], $alias_fields)) - { - return true; - } - return false; - }); + return true; + } + + return false; + } + ); // check if all is well if (ComponentbuilderHelper::checkArray($alias_fields)) { // load the field names - $this->customAliasBuilder[$name_single] = (array) array_map(function ($field) use($name_list) - { + $this->customAliasBuilder[$name_single] = (array) array_map( + function ($field) use ($name_list) { return $this->getFieldName($field, $name_list); }, $alias_fields ); @@ -2450,7 +3076,8 @@ class Get if ($view->source == 1 && isset($view->tables)) { // build and add the SQL dump - $this->customScriptBuilder['sql'][$name_single] = $this->buildSqlDump($view->tables, $name_single, $id); + $this->customScriptBuilder['sql'][$name_single] + = $this->buildSqlDump($view->tables, $name_single, $id); unset($view->tables); } elseif ($view->source == 2 && isset($view->sql)) @@ -2470,22 +3097,33 @@ class Get $this->mysqlTableSetting[$name_single] = array(); } // set mySql Table Settings - foreach ($this->mysqlTableKeys as $_mysqlTableKey => $_mysqlTableVal) + foreach ( + $this->mysqlTableKeys as $_mysqlTableKey => $_mysqlTableVal + ) { - if (isset($view->{'mysql_table_' . $_mysqlTableKey}) && ComponentbuilderHelper::checkString($view->{'mysql_table_' . $_mysqlTableKey}) && !is_numeric($view->{'mysql_table_' . $_mysqlTableKey})) + if (isset($view->{'mysql_table_' . $_mysqlTableKey}) + && ComponentbuilderHelper::checkString( + $view->{'mysql_table_' . $_mysqlTableKey} + ) + && !is_numeric($view->{'mysql_table_' . $_mysqlTableKey})) { - $this->mysqlTableSetting[$name_single][$_mysqlTableKey] = $view->{'mysql_table_' . $_mysqlTableKey}; + $this->mysqlTableSetting[$name_single][$_mysqlTableKey] + = $view->{'mysql_table_' . $_mysqlTableKey}; } else { - $this->mysqlTableSetting[$name_single][$_mysqlTableKey] = $_mysqlTableVal['default']; + $this->mysqlTableSetting[$name_single][$_mysqlTableKey] + = $_mysqlTableVal['default']; } // remove the table values since we moved to another object unset($view->{'mysql_table_' . $_mysqlTableKey}); } // Trigger Event: jcb_ce_onAfterModelViewData - $this->triggerEvent('jcb_ce_onAfterModelViewData', array(&$this->componentContext, &$view, &$this->placeholders)); + $this->triggerEvent( + 'jcb_ce_onAfterModelViewData', + array(&$this->componentContext, &$view, &$this->placeholders) + ); // clear placeholders unset($this->placeholders[$this->hhh . 'view' . $this->hhh]); @@ -2504,18 +3142,19 @@ class Get // store this view to class object $this->_adminViewData[$id] = $view; } + // return the found view data return $this->_adminViewData[$id]; } /** * Get all Custom View Data - * - * @param int $id The view ID - * @param string $table The view table - * + * + * @param int $id The view ID + * @param string $table The view table + * * @return oject The view data - * + * */ public function getCustomViewData($id, $table = 'site_view') { @@ -2527,7 +3166,10 @@ class Get $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); // Trigger Event: jcb_ce_onBeforeQueryCustomViewData - $this->triggerEvent('jcb_ce_onBeforeQueryCustomViewData', array(&$this->componentContext, &$id, &$table, &$query, &$this->db)); + $this->triggerEvent( + 'jcb_ce_onBeforeQueryCustomViewData', + array(&$this->componentContext, &$id, &$table, &$query, &$this->db) + ); // Reset the query using our newly populated query object. $this->db->setQuery($query); @@ -2536,7 +3178,10 @@ class Get $view = $this->db->loadObject(); // Trigger Event: jcb_ce_onBeforeModelCustomViewData - $this->triggerEvent('jcb_ce_onBeforeModelCustomViewData', array(&$this->componentContext, &$view, &$id, &$table)); + $this->triggerEvent( + 'jcb_ce_onBeforeModelCustomViewData', + array(&$this->componentContext, &$view, &$id, &$table) + ); if ($table === 'site_view') { @@ -2544,7 +3189,7 @@ class Get // repeatable fields to update $searchRepeatables = array( // repeatablefield => checker - 'ajax_input' => 'value_name', + 'ajax_input' => 'value_name', 'custom_button' => 'name' ); } @@ -2560,26 +3205,34 @@ class Get // set upater $updater = array( 'table' => $table, - 'key' => 'id', - 'val' => (int) $id + 'key' => 'id', + 'val' => (int) $id ); // update the repeatable fields - $view = ComponentbuilderHelper::convertRepeatableFields($view, $searchRepeatables, $updater); + $view = ComponentbuilderHelper::convertRepeatableFields( + $view, $searchRepeatables, $updater + ); // set GUI mapper - $guiMapper = array( 'table' => $table, 'id' => (int) $id, 'field' => 'default', 'type' => 'html'); + $guiMapper = array('table' => $table, 'id' => (int) $id, + 'field' => 'default', 'type' => 'html'); // set the default data $view->default = $this->setGuiCodePlaceholder( - $this->setDynamicValues(base64_decode($view->default)), - $guiMapper - ); + $this->setDynamicValues(base64_decode($view->default)), + $guiMapper + ); // fix alias to use in code - $view->code = $this->uniqueCode(ComponentbuilderHelper::safeString($view->codename)); + $view->code = $this->uniqueCode( + ComponentbuilderHelper::safeString($view->codename) + ); $view->Code = ComponentbuilderHelper::safeString($view->code, 'F'); $view->CODE = ComponentbuilderHelper::safeString($view->code, 'U'); // load context if not set - if (!isset($view->context) || !ComponentbuilderHelper::checkString($view->context)) + if (!isset($view->context) + || !ComponentbuilderHelper::checkString( + $view->context + )) { $view->context = $view->code; } @@ -2611,16 +3264,19 @@ class Get { if ($this->getMediaLibrary((int) $library)) { - $this->libManager[$this->target][$view->code][(int) $library] = true; + $this->libManager[$this->target][$view->code][(int) $library] + = true; } } } } - elseif (is_numeric($view->libraries) && !isset($this->libManager[$this->target][$view->code][(int) $view->libraries])) + elseif (is_numeric($view->libraries) + && !isset($this->libManager[$this->target][$view->code][(int) $view->libraries])) { if ($this->getMediaLibrary((int) $view->libraries)) { - $this->libManager[$this->target][$view->code][(int) $view->libraries] = true; + $this->libManager[$this->target][$view->code][(int) $view->libraries] + = true; } } // setup template array @@ -2634,10 +3290,14 @@ class Get { $this->uikitComp[$view->code] = array(); } - $this->uikitComp[$view->code] = ComponentbuilderHelper::getUikitComp($view->default, $this->uikitComp[$view->code]); + $this->uikitComp[$view->code] + = ComponentbuilderHelper::getUikitComp( + $view->default, $this->uikitComp[$view->code] + ); } // check for footable - if (!isset($this->footableScripts[$this->target][$view->code]) || !$this->footableScripts[$this->target][$view->code]) + if (!isset($this->footableScripts[$this->target][$view->code]) + || !$this->footableScripts[$this->target][$view->code]) { $foundFoo = $this->getFootableScripts($view->default); if ($foundFoo) @@ -2650,7 +3310,8 @@ class Get } } // check for get module - if (!isset($this->getModule[$this->target][$view->code]) || !$this->getModule[$this->target][$view->code]) + if (!isset($this->getModule[$this->target][$view->code]) + || !$this->getModule[$this->target][$view->code]) { $found = $this->getGetModule($view->default); if ($found) @@ -2659,31 +3320,43 @@ class Get } } // set the main get data - $main_get = $this->setGetData(array($view->main_get), $view->code, $view->context); + $main_get = $this->setGetData( + array($view->main_get), $view->code, $view->context + ); $view->main_get = $main_get[0]; // set the custom_get data - $view->custom_get = $this->setGetData(json_decode($view->custom_get, true), $view->code, $view->context); + $view->custom_get = $this->setGetData( + json_decode($view->custom_get, true), $view->code, $view->context + ); // set array adding array of scripts - $addArray = array('php_view', 'php_jview', 'php_jview_display', 'php_document', 'javascript_file', 'js_document', 'css_document', 'css'); + $addArray = array('php_view', 'php_jview', 'php_jview_display', + 'php_document', 'javascript_file', 'js_document', + 'css_document', 'css'); // set GUI mapper $guiMapper['type'] = 'php'; foreach ($addArray as $scripter) { - if (isset($view->{'add_' . $scripter}) && $view->{'add_' . $scripter} == 1 && ComponentbuilderHelper::checkString($view->$scripter)) + if (isset($view->{'add_' . $scripter}) + && $view->{'add_' . $scripter} == 1 + && ComponentbuilderHelper::checkString($view->$scripter)) { // css does not get placholders yet if (strpos($scripter, 'css') === false) { // set field $guiMapper['field'] = $scripter; - $view->$scripter = $this->setGuiCodePlaceholder( - $this->setDynamicValues(base64_decode($view->$scripter)), - $guiMapper - ); + $view->$scripter = $this->setGuiCodePlaceholder( + $this->setDynamicValues( + base64_decode($view->$scripter) + ), + $guiMapper + ); } else { - $view->$scripter = $this->setDynamicValues(base64_decode($view->$scripter)); + $view->$scripter = $this->setDynamicValues( + base64_decode($view->$scripter) + ); } if (2 == $this->uikit || 1 == $this->uikit) { @@ -2692,18 +3365,23 @@ class Get $this->uikitComp[$view->code] = array(); } // set uikit to views - $this->uikitComp[$view->code] = ComponentbuilderHelper::getUikitComp($view->$scripter, $this->uikitComp[$view->code]); + $this->uikitComp[$view->code] + = ComponentbuilderHelper::getUikitComp( + $view->$scripter, $this->uikitComp[$view->code] + ); } $this->setTemplateAndLayoutData($view->$scripter, $view->code); // check for footable - if (!isset($this->footableScripts[$this->target][$view->code]) || !$this->footableScripts[$this->target][$view->code]) + if (!isset($this->footableScripts[$this->target][$view->code]) + || !$this->footableScripts[$this->target][$view->code]) { $foundFoo = $this->getFootableScripts($view->$scripter); if ($foundFoo) { - $this->footableScripts[$this->target][$view->code] = true; + $this->footableScripts[$this->target][$view->code] + = true; } if ($foundFoo && !$this->footable) { @@ -2711,7 +3389,8 @@ class Get } } // check for google chart - if (!isset($this->googleChart[$this->target][$view->code]) || !$this->googleChart[$this->target][$view->code]) + if (!isset($this->googleChart[$this->target][$view->code]) + || !$this->googleChart[$this->target][$view->code]) { $found = $this->getGoogleChart($view->$scripter); if ($found) @@ -2724,7 +3403,8 @@ class Get } } // check for get module - if (!isset($this->getModule[$this->target][$view->code]) || !$this->getModule[$this->target][$view->code]) + if (!isset($this->getModule[$this->target][$view->code]) + || !$this->getModule[$this->target][$view->code]) { $found = $this->getGetModule($view->$scripter); if ($found) @@ -2748,10 +3428,13 @@ class Get } $setAjax = false; // check if controller input as been set - $view->ajax_input = (isset($view->ajax_input) && ComponentbuilderHelper::checkJson($view->ajax_input)) ? json_decode($view->ajax_input, true) : null; + $view->ajax_input = (isset($view->ajax_input) + && ComponentbuilderHelper::checkJson($view->ajax_input)) + ? json_decode($view->ajax_input, true) : null; if (ComponentbuilderHelper::checkArray($view->ajax_input)) { - $this->customScriptBuilder[$target]['ajax_controller'][$view->code] = array_values($view->ajax_input); + $this->customScriptBuilder[$target]['ajax_controller'][$view->code] + = array_values($view->ajax_input); $setAjax = true; } unset($view->ajax_input); @@ -2795,18 +3478,25 @@ class Get // set for the code foreach ($button_code_array as $button_code_field) { - if (isset($view->{$button_code_field}) && ComponentbuilderHelper::checkString($view->{$button_code_field})) + if (isset($view->{$button_code_field}) + && ComponentbuilderHelper::checkString( + $view->{$button_code_field} + )) { // set field - $guiMapper['field'] = $button_code_field; + $guiMapper['field'] = $button_code_field; $view->{$button_code_field} = $this->setGuiCodePlaceholder( - $this->setDynamicValues(base64_decode($view->{$button_code_field})), + $this->setDynamicValues( + base64_decode($view->{$button_code_field}) + ), $guiMapper - ); + ); } } // set the button array - $view->custom_button = (isset($view->custom_button) && ComponentbuilderHelper::checkJson($view->custom_button)) ? json_decode($view->custom_button, true) : null; + $view->custom_button = (isset($view->custom_button) + && ComponentbuilderHelper::checkJson($view->custom_button)) + ? json_decode($view->custom_button, true) : null; if (ComponentbuilderHelper::checkArray($view->custom_button)) { $view->custom_buttons = array_values($view->custom_button); @@ -2815,7 +3505,10 @@ class Get } // Trigger Event: jcb_ce_onAfterModelCustomViewData - $this->triggerEvent('jcb_ce_onAfterModelCustomViewData', array(&$this->componentContext, &$view)); + $this->triggerEvent( + 'jcb_ce_onAfterModelCustomViewData', + array(&$this->componentContext, &$view) + ); // return the found view data return $view; @@ -2823,13 +3516,13 @@ class Get /** * Get all Field Data - * - * @param int $id The field ID - * @param string $name_single The view edit or single name - * @param string $name_list The view list name + * + * @param int $id The field ID + * @param string $name_single The view edit or single name + * @param string $name_list The view list name * * @return oject The field data - * + * */ public function getFieldData($id, $name_single = null, $name_list = null) { @@ -2840,13 +3533,28 @@ class Get // Select all the values in the field $query->select('a.*'); - $query->select($this->db->quoteName(array('c.name', 'c.properties'), array('type_name', 'properties'))); + $query->select( + $this->db->quoteName( + array('c.name', 'c.properties'), + array('type_name', 'properties') + ) + ); $query->from('#__componentbuilder_field AS a'); - $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)); + $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) + ); // Trigger Event: jcb_ce_onBeforeQueryFieldData - $this->triggerEvent('jcb_ce_onBeforeQueryFieldData', array(&$this->componentContext, &$id, &$query, &$this->db)); + $this->triggerEvent( + 'jcb_ce_onBeforeQueryFieldData', + array(&$this->componentContext, &$id, &$query, &$this->db) + ); // Reset the query using our newly populated query object. $this->db->setQuery($query); @@ -2857,7 +3565,10 @@ class Get $field = $this->db->loadObject(); // Trigger Event: jcb_ce_onBeforeModelFieldData - $this->triggerEvent('jcb_ce_onBeforeModelFieldData', array(&$this->componentContext, &$field)); + $this->triggerEvent( + 'jcb_ce_onBeforeModelFieldData', + array(&$this->componentContext, &$field) + ); // adding a fix for the changed name of type to fieldtype $field->type = $field->fieldtype; @@ -2870,44 +3581,69 @@ class Get // set upater $updater = array( 'table' => 'fieldtype', - 'key' => 'id', - 'val' => (int) $id + 'key' => 'id', + 'val' => (int) $id ); // update the repeatable fields - $field = ComponentbuilderHelper::convertRepeatableFields($field, $searchRepeatables, $updater); + $field = ComponentbuilderHelper::convertRepeatableFields( + $field, $searchRepeatables, $updater + ); // load the values form params $field->xml = $this->setDynamicValues(json_decode($field->xml)); // check if we have validate (validation rule set) - $validationRule = ComponentbuilderHelper::getBetween($field->xml, 'validate="', '"'); + $validationRule = ComponentbuilderHelper::getBetween( + $field->xml, 'validate="', '"' + ); if (ComponentbuilderHelper::checkString($validationRule)) { // make sure it is lowercase - $validationRule = ComponentbuilderHelper::safeString($validationRule); + $validationRule = ComponentbuilderHelper::safeString( + $validationRule + ); // link this field to this validation $this->validationLinkedFields[$id] = $validationRule; // make sure it is not already set if (!isset($this->validationRules[$validationRule])) { // get joomla core validation names - if ($coreValidationRules = ComponentbuilderHelper::getExistingValidationRuleNames(true)) + if ($coreValidationRules + = ComponentbuilderHelper::getExistingValidationRuleNames( + true + )) { // make sure this rule is not a core validation rule - if (!in_array($validationRule, (array) $coreValidationRules)) + if (!in_array( + $validationRule, (array) $coreValidationRules + )) { // get the class methods for this rule if it exists - if ($this->validationRules[$validationRule] = ComponentbuilderHelper::getVar('validation_rule', $validationRule, 'name', 'php')) + if ($this->validationRules[$validationRule] + = ComponentbuilderHelper::getVar( + 'validation_rule', $validationRule, 'name', + 'php' + )) { // open and set the validation rule - $this->validationRules[$validationRule] = $this->setGuiCodePlaceholder( - $this->setPlaceholders($this->setDynamicValues(base64_decode($this->validationRules[$validationRule])), $this->placeholders), + $this->validationRules[$validationRule] + = $this->setGuiCodePlaceholder( + $this->setPlaceholders( + $this->setDynamicValues( + base64_decode( + $this->validationRules[$validationRule] + ) + ), $this->placeholders + ), array( 'table' => 'validation_rule', 'field' => 'php', - 'id' => ComponentbuilderHelper::getVar('validation_rule', $validationRule, 'name', 'id'), - 'type' => 'php') - ); + 'id' => ComponentbuilderHelper::getVar( + 'validation_rule', + $validationRule, 'name', 'id' + ), + 'type' => 'php') + ); } else { @@ -2925,45 +3661,93 @@ class Get } // load the type values form type params - $field->properties = (isset($field->properties) && ComponentbuilderHelper::checkJson($field->properties)) ? json_decode($field->properties, true) : null; + $field->properties = (isset($field->properties) + && ComponentbuilderHelper::checkJson($field->properties)) + ? json_decode($field->properties, true) : null; if (ComponentbuilderHelper::checkArray($field->properties)) { $field->properties = array_values($field->properties); } // check if we have WHMCS encryption - if (4 == $field->store && (!isset($this->whmcsEncryption) || !$this->whmcsEncryption)) + if (4 == $field->store + && (!isset($this->whmcsEncryption) + || !$this->whmcsEncryption)) { $this->whmcsEncryption = true; } // check if we have basic encryption - elseif (3 == $field->store && (!isset($this->basicEncryption) || !$this->basicEncryption)) + elseif (3 == $field->store + && (!isset($this->basicEncryption) + || !$this->basicEncryption)) { $this->basicEncryption = true; } // check if we have better encryption - elseif (5 == $field->store && (!isset($this->mediumEncryption) || !$this->mediumEncryption)) + elseif (5 == $field->store + && (!isset($this->mediumEncryption) + || !$this->mediumEncryption)) { $this->mediumEncryption = true; } // check if we have better encryption elseif (6 == $field->store - && ComponentbuilderHelper::checkString($field->on_get_model_field) - && ComponentbuilderHelper::checkString($field->on_save_model_field)) + && ComponentbuilderHelper::checkString( + $field->on_get_model_field + ) + && ComponentbuilderHelper::checkString( + $field->on_save_model_field + )) { // add only if string lenght found - if (ComponentbuilderHelper::checkString($field->initiator_on_save_model)) + if (ComponentbuilderHelper::checkString( + $field->initiator_on_save_model + )) { - $field->initiator_save_key = md5($field->initiator_on_save_model); - $field->initiator_save = explode(PHP_EOL, $this->setPlaceholders($this->setDynamicValues(base64_decode($field->initiator_on_save_model)), $this->placeholders)); + $field->initiator_save_key = md5( + $field->initiator_on_save_model + ); + $field->initiator_save = explode( + PHP_EOL, $this->setPlaceholders( + $this->setDynamicValues( + base64_decode( + $field->initiator_on_save_model + ) + ), $this->placeholders + ) + ); } - if (ComponentbuilderHelper::checkString($field->initiator_on_save_model)) + if (ComponentbuilderHelper::checkString( + $field->initiator_on_save_model + )) { - $field->initiator_get_key = md5($field->initiator_on_get_model); - $field->initiator_get = explode(PHP_EOL, $this->setPlaceholders($this->setDynamicValues(base64_decode($field->initiator_on_get_model)), $this->placeholders)); + $field->initiator_get_key = md5( + $field->initiator_on_get_model + ); + $field->initiator_get = explode( + PHP_EOL, $this->setPlaceholders( + $this->setDynamicValues( + base64_decode( + $field->initiator_on_get_model + ) + ), $this->placeholders + ) + ); } // set the field modeling - $field->model_field['save'] = explode(PHP_EOL, $this->setPlaceholders($this->setDynamicValues(base64_decode($field->on_save_model_field)), $this->placeholders)); - $field->model_field['get'] = explode(PHP_EOL, $this->setPlaceholders($this->setDynamicValues(base64_decode($field->on_get_model_field)), $this->placeholders)); + $field->model_field['save'] = explode( + PHP_EOL, $this->setPlaceholders( + $this->setDynamicValues( + base64_decode($field->on_save_model_field) + ), $this->placeholders + ) + ); + $field->model_field['get'] = explode( + PHP_EOL, $this->setPlaceholders( + $this->setDynamicValues( + base64_decode($field->on_get_model_field) + ), $this->placeholders + ) + ); // remove the original values unset($field->on_save_model_field, $field->on_get_model_field, $field->initiator_on_save_model, $field->initiator_on_get_model); } @@ -2972,7 +3756,10 @@ class Get $field->history = $this->getHistoryWatch('field', $id); // Trigger Event: jcb_ce_onAfterModelFieldData - $this->triggerEvent('jcb_ce_onAfterModelFieldData', array(&$this->componentContext, &$field)); + $this->triggerEvent( + 'jcb_ce_onAfterModelFieldData', + array(&$this->componentContext, &$field) + ); $this->_fieldData[$id] = $field; } @@ -2985,10 +3772,14 @@ class Get if ($id > 0 && isset($this->_fieldData[$id])) { // check if we should load scripts for single view - if (ComponentbuilderHelper::checkString($name_single) && !isset($this->customFieldScript[$name_single][$id])) + if (ComponentbuilderHelper::checkString($name_single) + && !isset($this->customFieldScript[$name_single][$id])) { // add_javascript_view_footer - if ($this->_fieldData[$id]->add_javascript_view_footer == 1 && ComponentbuilderHelper::checkString($this->_fieldData[$id]->javascript_view_footer)) + if ($this->_fieldData[$id]->add_javascript_view_footer == 1 + && ComponentbuilderHelper::checkString( + $this->_fieldData[$id]->javascript_view_footer + )) { $convert__ = true; if (isset($this->_fieldData[$id]->javascript_view_footer_decoded) @@ -3002,10 +3793,10 @@ class Get $name_single, false, array( - 'table' => 'field', - 'id' => (int) $id, - 'field' => 'javascript_view_footer', - 'type' => 'js', + 'table' => 'field', + 'id' => (int) $id, + 'field' => 'javascript_view_footer', + 'type' => 'js', 'prefix' => PHP_EOL), $convert__, $convert__, @@ -3013,18 +3804,27 @@ class Get ); if (!isset($this->_fieldData[$id]->javascript_view_footer_decoded)) { - $this->_fieldData[$id]->javascript_view_footer_decoded = true; + $this->_fieldData[$id]->javascript_view_footer_decoded + = true; } - 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) { 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'][$name_single]) + || !$this->customScriptBuilder['token'][$name_single]) { - $this->customScriptBuilder['token'][$name_single] = true; + $this->customScriptBuilder['token'][$name_single] + = true; } } } @@ -3057,10 +3857,14 @@ class Get $this->customFieldScript[$name_single][$id] = true; } // check if we should load scripts for list views - if (ComponentbuilderHelper::checkString($name_list) && !isset($this->customFieldScript[$name_list][$id])) + if (ComponentbuilderHelper::checkString($name_list) + && !isset($this->customFieldScript[$name_list][$id])) { // add_javascript_views_footer - if ($this->_fieldData[$id]->add_javascript_views_footer == 1 && ComponentbuilderHelper::checkString($this->_fieldData[$id]->javascript_views_footer)) + if ($this->_fieldData[$id]->add_javascript_views_footer == 1 + && ComponentbuilderHelper::checkString( + $this->_fieldData[$id]->javascript_views_footer + )) { $convert__ = true; if (isset($this->_fieldData[$id]->javascript_views_footer_decoded) @@ -3074,10 +3878,10 @@ class Get $name_single, false, array( - 'table' => 'field', - 'id' => (int) $id, - 'field' => 'javascript_views_footer', - 'type' => 'js', + 'table' => 'field', + 'id' => (int) $id, + 'field' => 'javascript_views_footer', + 'type' => 'js', 'prefix' => PHP_EOL), $convert__, $convert__, @@ -3085,18 +3889,27 @@ class Get ); if (!isset($this->_fieldData[$id]->javascript_views_footer_decoded)) { - $this->_fieldData[$id]->javascript_views_footer_decoded = true; + $this->_fieldData[$id]->javascript_views_footer_decoded + = true; } - 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) { if (!isset($this->customScriptBuilder['token'])) { $this->customScriptBuilder['token'] = array(); } - if (!isset($this->customScriptBuilder['token'][$name_list]) || !$this->customScriptBuilder['token'][$name_list]) + if (!isset($this->customScriptBuilder['token'][$name_list]) + || !$this->customScriptBuilder['token'][$name_list]) { - $this->customScriptBuilder['token'][$name_list] = true; + $this->customScriptBuilder['token'][$name_list] + = true; } } } @@ -3134,22 +3947,24 @@ class Get // return the found field data return $this->_fieldData[$id]; } + return false; } /** * set Field details - * - * @param object $field The field object - * @param string $singleViewName The single view name - * @param string $listViewName The list view name - * @param string $amicably The peaceful resolve - * + * + * @param object $field The field object + * @param string $singleViewName The single view name + * @param string $listViewName The list view name + * @param string $amicably The peaceful resolve + * * @return void - * + * */ - public function setFieldDetails(&$field, $singleViewName = null, $listViewName = null, $amicably = '') - { + public function setFieldDetails(&$field, $singleViewName = null, + $listViewName = null, $amicably = '' + ) { // set hash static $hash = 123467890; // load hash if not found @@ -3162,7 +3977,9 @@ class Get // set the settings if (!isset($field['settings'])) { - $field['settings'] = $this->getFieldData($field['field'], $singleViewName, $listViewName); + $field['settings'] = $this->getFieldData( + $field['field'], $singleViewName, $listViewName + ); } // set real field name if (!isset($field['base_name'])) @@ -3175,24 +3992,31 @@ class Get $field['type_name'] = $this->getFieldType($field); } // check if value is array - if (isset($field['permission']) && !ComponentbuilderHelper::checkArray($field['permission']) && is_numeric($field['permission']) && $field['permission'] > 0) + if (isset($field['permission']) + && !ComponentbuilderHelper::checkArray( + $field['permission'] + ) + && is_numeric($field['permission']) + && $field['permission'] > 0) { $field['permission'] = array($field['permission']); } // set unigue name keeper if ($listViewName) { - $this->setUniqueNameCounter($field['base_name'], $listViewName . $amicably); + $this->setUniqueNameCounter( + $field['base_name'], $listViewName . $amicably + ); } } /** * Get the field's actual type - * - * @param object $field The field object - * + * + * @param object $field The field object + * * @return string Success returns field type - * + * */ public function getFieldType(&$field) { @@ -3202,38 +4026,62 @@ class Get return $field['type_name']; } // check that we have the poperties - if (isset($field['settings']) && ComponentbuilderHelper::checkObject($field['settings']) && isset($field['settings']->properties) && ComponentbuilderHelper::checkArray($field['settings']->properties)) + if (isset($field['settings']) + && ComponentbuilderHelper::checkObject( + $field['settings'] + ) + && isset($field['settings']->properties) + && ComponentbuilderHelper::checkArray( + $field['settings']->properties + )) { // search for own custom fields if (strpos($field['settings']->type_name, '@') !== false) { // set own custom field $field['settings']->own_custom = $field['settings']->type_name; - $field['settings']->type_name = 'Custom'; + $field['settings']->type_name = 'Custom'; } // set the type name - $type_name = ComponentbuilderHelper::safeTypeName($field['settings']->type_name); + $type_name = ComponentbuilderHelper::safeTypeName( + $field['settings']->type_name + ); // if custom (we must use the xml value) - if (strtolower($type_name) === 'custom' || strtolower($type_name) === 'customuser') + if (strtolower($type_name) === 'custom' + || strtolower($type_name) === 'customuser') { - $type = ComponentbuilderHelper::safeTypeName(ComponentbuilderHelper::getBetween($field['settings']->xml, 'type="', '"')); + $type = ComponentbuilderHelper::safeTypeName( + ComponentbuilderHelper::getBetween( + $field['settings']->xml, 'type="', '"' + ) + ); } else { // loop over properties looking for the type value foreach ($field['settings']->properties as $property) { - if ($property['name'] === 'type') // type field is never ajustable (unless custom) + if ($property['name'] + === 'type') // type field is never ajustable (unless custom) { // force the default value - if (isset($property['example']) && ComponentbuilderHelper::checkString($property['example'])) + if (isset($property['example']) + && ComponentbuilderHelper::checkString( + $property['example'] + )) { - $type = ComponentbuilderHelper::safeTypeName($property['example']); + $type = ComponentbuilderHelper::safeTypeName( + $property['example'] + ); } // fall back on the xml settings (not ideal) else { - $type = ComponentbuilderHelper::safeTypeName(ComponentbuilderHelper::getBetween($field['settings']->xml, 'type="', '"')); + $type = ComponentbuilderHelper::safeTypeName( + ComponentbuilderHelper::getBetween( + $field['settings']->xml, 'type="', '"' + ) + ); } // exit foreach loop break; @@ -3251,34 +4099,44 @@ class Get return $type_name; } } + // fall back to text return 'text'; } /** * Get the field's actual name - * - * @param object $field The field object - * @param string $listViewName The list view name - * @param string $amicably The peaceful resolve (for fields in subforms in same view :) - * + * + * @param object $field The field object + * @param string $listViewName The list view name + * @param string $amicably The peaceful resolve (for fields in subforms in same view :) + * * @return string Success returns field name - * + * */ public function getFieldName(&$field, $listViewName = null, $amicably = '') { // return the unique name if already set - if (ComponentbuilderHelper::checkString($listViewName) && isset($field['hash']) && isset($this->uniqueFieldNames[$listViewName . $amicably . $field['hash']])) + if (ComponentbuilderHelper::checkString($listViewName) + && isset($field['hash']) + && isset( + $this->uniqueFieldNames[$listViewName . $amicably + . $field['hash']] + )) { - return $this->uniqueFieldNames[$listViewName . $amicably . $field['hash']]; + return $this->uniqueFieldNames[$listViewName . $amicably + . $field['hash']]; } // always make sure we have a field name and type - if (!isset($field['settings']) || !isset($field['settings']->type_name) || !isset($field['settings']->name)) + if (!isset($field['settings']) || !isset($field['settings']->type_name) + || !isset($field['settings']->name)) { return 'error'; } // set the type name - $type_name = ComponentbuilderHelper::safeTypeName($field['settings']->type_name); + $type_name = ComponentbuilderHelper::safeTypeName( + $field['settings']->type_name + ); // set the name of the field $name = ComponentbuilderHelper::safeFieldName($field['settings']->name); // check that we have the poperties @@ -3292,11 +4150,16 @@ class Get if ($type_name === 'category') { // quick check if this is a category linked to view page - $requeSt_id = ComponentbuilderHelper::getBetween($field['settings']->xml, 'name="', '"'); - if (strpos($requeSt_id, '_request_id') !== false || strpos($requeSt_id, '_request_catid') !== false) + $requeSt_id = ComponentbuilderHelper::getBetween( + $field['settings']->xml, 'name="', '"' + ); + if (strpos($requeSt_id, '_request_id') !== false + || strpos($requeSt_id, '_request_catid') !== false) { // keep it then, don't change - $name = $this->setPlaceholders($requeSt_id, $this->placeholders); + $name = $this->setPlaceholders( + $requeSt_id, $this->placeholders + ); } else { @@ -3306,17 +4169,41 @@ class Get if (ComponentbuilderHelper::checkString($listViewName)) { // check if we should use another Text Name as this views name - $otherName = $this->setPlaceholders(ComponentbuilderHelper::getBetween($field['settings']->xml, 'othername="', '"'), $this->placeholders); - $otherViews = $this->setPlaceholders(ComponentbuilderHelper::getBetween($field['settings']->xml, 'views="', '"'), $this->placeholders); - $otherView = $this->setPlaceholders(ComponentbuilderHelper::getBetween($field['settings']->xml, 'view="', '"'), $this->placeholders); + $otherName = $this->setPlaceholders( + ComponentbuilderHelper::getBetween( + $field['settings']->xml, 'othername="', '"' + ), $this->placeholders + ); + $otherViews = $this->setPlaceholders( + ComponentbuilderHelper::getBetween( + $field['settings']->xml, 'views="', '"' + ), $this->placeholders + ); + $otherView = $this->setPlaceholders( + ComponentbuilderHelper::getBetween( + $field['settings']->xml, 'view="', '"' + ), $this->placeholders + ); // This is to link other view category - if (ComponentbuilderHelper::checkString($otherName) && ComponentbuilderHelper::checkString($otherViews) && ComponentbuilderHelper::checkString($otherView)) + if (ComponentbuilderHelper::checkString($otherName) + && ComponentbuilderHelper::checkString( + $otherViews + ) + && ComponentbuilderHelper::checkString( + $otherView + )) { // set other category details $this->catOtherName[$listViewName] = array( - 'name' => ComponentbuilderHelper::safeFieldName($otherName), - 'views' => ComponentbuilderHelper::safeString($otherViews), - 'view' => ComponentbuilderHelper::safeString($otherView) + 'name' => ComponentbuilderHelper::safeFieldName( + $otherName + ), + 'views' => ComponentbuilderHelper::safeString( + $otherViews + ), + 'view' => ComponentbuilderHelper::safeString( + $otherView + ) ); } } @@ -3334,7 +4221,13 @@ class Get else { // get value from xml - $xml = ComponentbuilderHelper::safeFieldName($this->setPlaceholders(ComponentbuilderHelper::getBetween($field['settings']->xml, 'name="', '"'), $this->placeholders)); + $xml = ComponentbuilderHelper::safeFieldName( + $this->setPlaceholders( + ComponentbuilderHelper::getBetween( + $field['settings']->xml, 'name="', '"' + ), $this->placeholders + ) + ); // check if a value was found if (ComponentbuilderHelper::checkString($xml)) { @@ -3347,12 +4240,17 @@ class Get } } // return the value unique - if (ComponentbuilderHelper::checkString($listViewName) && isset($field['hash'])) + if (ComponentbuilderHelper::checkString($listViewName) + && isset($field['hash'])) { - $this->uniqueFieldNames[$listViewName . $amicably . $field['hash']] = $this->uniqueName($name, $listViewName . $amicably); + $this->uniqueFieldNames[$listViewName . $amicably . $field['hash']] + = $this->uniqueName($name, $listViewName . $amicably); + // now return the unique name - return $this->uniqueFieldNames[$listViewName . $amicably . $field['hash']]; + return $this->uniqueFieldNames[$listViewName . $amicably + . $field['hash']]; } + // fall back to global return $name; } @@ -3360,8 +4258,8 @@ class Get /** * Count how many times the same field is used per view * - * @param string $name The name of the field - * @param string $view The name of the view + * @param string $name The name of the field + * @param string $view The name of the view * * @return void * @@ -3370,25 +4268,27 @@ class Get { if (!isset($this->uniqueNames[$view])) { - $this->uniqueNames[$view] = array(); + $this->uniqueNames[$view] = array(); $this->uniqueNames[$view]['counter'] = array(); - $this->uniqueNames[$view]['names'] = array(); + $this->uniqueNames[$view]['names'] = array(); } if (!isset($this->uniqueNames[$view]['counter'][$name])) { $this->uniqueNames[$view]['counter'][$name] = 1; + return; } // count how many times the field is used - $this->uniqueNames[$view]['counter'][$name] ++; + $this->uniqueNames[$view]['counter'][$name]++; + return; } /** * Naming each field with an unique name * - * @param string $name The name of the field - * @param string $view The name of the view + * @param string $name The name of the field + * @param string $view The name of the view * * @return string the name * @@ -3396,35 +4296,42 @@ class Get protected function uniqueName($name, $view) { // only increment if the field name is used multiple times - if (isset($this->uniqueNames[$view]['counter'][$name]) && $this->uniqueNames[$view]['counter'][$name] > 1) + if (isset($this->uniqueNames[$view]['counter'][$name]) + && $this->uniqueNames[$view]['counter'][$name] > 1) { $counter = 1; // set the unique name - $uniqueName = ComponentbuilderHelper::safeFieldName($name . '_' . $counter); + $uniqueName = ComponentbuilderHelper::safeFieldName( + $name . '_' . $counter + ); while (isset($this->uniqueNames[$view]['names'][$uniqueName])) { // increment the number $counter++; // try again - $uniqueName = ComponentbuilderHelper::safeFieldName($name . '_' . $counter); + $uniqueName = ComponentbuilderHelper::safeFieldName( + $name . '_' . $counter + ); } // set the new name number $this->uniqueNames[$view]['names'][$uniqueName] = $counter; + // return the unique name return $uniqueName; } + return $name; } /** * Set get Data - * - * @param array $ids The ids of the dynamic get - * @param string $view_code The view code name - * @param string $context The context for events + * + * @param array $ids The ids of the dynamic get + * @param string $view_code The view code name + * @param string $context The context for events * * @return oject the get dynamicGet data - * + * */ public function setGetData($ids, $view_code, $context) { @@ -3442,54 +4349,80 @@ class Get $this->db->execute(); if ($this->db->getNumRows()) { - $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'); - $guiMapper = array( 'table' => 'dynamic_get', 'type' => 'php'); + $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'); + $guiMapper = array('table' => 'dynamic_get', + 'type' => 'php'); foreach ($results as $_nr => &$result) { // set GUI mapper id $guiMapper['id'] = (int) $result->id; // add calculations if set - if ($result->addcalculation == 1 && ComponentbuilderHelper::checkString($result->php_calculation)) + if ($result->addcalculation == 1 + && ComponentbuilderHelper::checkString( + $result->php_calculation + )) { // set GUI mapper field $guiMapper['field'] = 'php_calculation'; - $result->php_calculation = $this->setGuiCodePlaceholder( - $this->setDynamicValues(base64_decode($result->php_calculation)), + $result->php_calculation + = $this->setGuiCodePlaceholder( + $this->setDynamicValues( + base64_decode($result->php_calculation) + ), $guiMapper - ); + ); } // setup the router parse if (isset($result->add_php_router_parse) && $result->add_php_router_parse == 1 && isset($result->php_router_parse) - && ComponentbuilderHelper::checkString($result->php_router_parse)) + && ComponentbuilderHelper::checkString( + $result->php_router_parse + )) { // set GUI mapper field $guiMapper['field'] = 'php_router_parse'; - $result->php_router_parse = $this->setGuiCodePlaceholder( - $this->setDynamicValues(base64_decode($result->php_router_parse)), + $result->php_router_parse + = $this->setGuiCodePlaceholder( + $this->setDynamicValues( + base64_decode($result->php_router_parse) + ), $guiMapper - ); + ); } else { $result->add_php_router_parse = 0; } // The array of the php scripts that should be added to the script builder - $phpSripts = array('php_before_getitem', 'php_after_getitem', 'php_before_getitems', 'php_after_getitems', 'php_getlistquery'); + $phpSripts = array('php_before_getitem', + 'php_after_getitem', + 'php_before_getitems', + 'php_after_getitems', + 'php_getlistquery'); // load the php scripts foreach ($phpSripts as $script) { // add php script to the script builder - if (isset($result->{'add_' . $script}) && $result->{'add_' . $script} == 1 && isset($result->{$script}) && ComponentbuilderHelper::checkString($result->{$script})) + if (isset($result->{'add_' . $script}) + && $result->{'add_' . $script} == 1 + && isset($result->{$script}) + && ComponentbuilderHelper::checkString( + $result->{$script} + )) { // move all main gets out to the customscript builder if ($result->gettype <= 2) { // set GUI mapper field - $guiMapper['field'] = $script; + $guiMapper['field'] = $script; $guiMapper['prefix'] = PHP_EOL . PHP_EOL; $this->setCustomScriptBuilder( $result->{$script}, @@ -3509,11 +4442,14 @@ class Get else { // set GUI mapper field - $guiMapper['field'] = $script; + $guiMapper['field'] = $script; $guiMapper['prefix'] = PHP_EOL; // only for custom gets - $result->{$script} = $this->setGuiCodePlaceholder( - $this->setDynamicValues(base64_decode($result->{$script})), + $result->{$script} + = $this->setGuiCodePlaceholder( + $this->setDynamicValues( + base64_decode($result->{$script}) + ), $guiMapper ); unset($guiMapper['prefix']); @@ -3527,9 +4463,11 @@ class Get } } // set the getmethod code name - $result->key = ComponentbuilderHelper::safeString($view_code . ' ' . $result->name . ' ' . $result->id); + $result->key = ComponentbuilderHelper::safeString( + $view_code . ' ' . $result->name . ' ' . $result->id + ); // reset buckets - $result->main_get = array(); + $result->main_get = array(); $result->custom_get = array(); // should joineds and other weaks be added $addDynamicTweaksJoints = true; @@ -3543,9 +4481,14 @@ class Get $result->view_selection = '*'; } // set the view data - $result->main_get[0]['selection'] = $this->setDataSelection($result->key, $view_code, $result->view_selection, $result->view_table_main, 'a', null, 'view'); - $result->main_get[0]['as'] = 'a'; - $result->main_get[0]['key'] = $result->key; + $result->main_get[0]['selection'] + = $this->setDataSelection( + $result->key, $view_code, + $result->view_selection, + $result->view_table_main, 'a', null, 'view' + ); + $result->main_get[0]['as'] = 'a'; + $result->main_get[0]['key'] = $result->key; $result->main_get[0]['context'] = $context; unset($result->view_selection); break; @@ -3556,9 +4499,14 @@ class Get $result->db_selection = '*'; } // set the database data - $result->main_get[0]['selection'] = $this->setDataSelection($result->key, $view_code, $result->db_selection, $result->db_table_main, 'a', null, 'db'); - $result->main_get[0]['as'] = 'a'; - $result->main_get[0]['key'] = $result->key; + $result->main_get[0]['selection'] + = $this->setDataSelection( + $result->key, $view_code, + $result->db_selection, + $result->db_table_main, 'a', null, 'db' + ); + $result->main_get[0]['as'] = 'a'; + $result->main_get[0]['key'] = $result->key; $result->main_get[0]['context'] = $context; unset($result->db_selection); break; @@ -3566,32 +4514,54 @@ class Get // set GUI mapper field $guiMapper['field'] = 'php_custom_get'; // get the custom query - $customQueryString = $this->setGuiCodePlaceholder( - $this->setDynamicValues(base64_decode($result->php_custom_get)), + $customQueryString + = $this->setGuiCodePlaceholder( + $this->setDynamicValues( + base64_decode($result->php_custom_get) + ), $guiMapper - ); + ); // get the table name - $_searchQuery = ComponentbuilderHelper::getBetween($customQueryString, '$query->from(', ')'); - if (ComponentbuilderHelper::checkString($_searchQuery) && strpos($_searchQuery, '#__') !== false) + $_searchQuery + = ComponentbuilderHelper::getBetween( + $customQueryString, '$query->from(', ')' + ); + if (ComponentbuilderHelper::checkString( + $_searchQuery + ) + && strpos($_searchQuery, '#__') !== false) { - $_queryName = ComponentbuilderHelper::getBetween($_searchQuery, '#__', "'"); - if (!ComponentbuilderHelper::checkString($_queryName)) + $_queryName + = ComponentbuilderHelper::getBetween( + $_searchQuery, '#__', "'" + ); + if (!ComponentbuilderHelper::checkString( + $_queryName + )) { - $_queryName = ComponentbuilderHelper::getBetween($_searchQuery, '#__', '"'); + $_queryName + = ComponentbuilderHelper::getBetween( + $_searchQuery, '#__', '"' + ); } } // set to blank if not found - if (!isset($_queryName) || !ComponentbuilderHelper::checkString($_queryName)) + if (!isset($_queryName) + || !ComponentbuilderHelper::checkString( + $_queryName + )) { $_queryName = ''; } // set custom script $result->main_get[0]['selection'] = array( 'select' => $customQueryString, - 'from' => '', 'table' => '', 'type' => '', 'name' => $_queryName); - $result->main_get[0]['as'] = 'a'; - $result->main_get[0]['key'] = $result->key; - $result->main_get[0]['context'] = $context; + 'from' => '', 'table' => '', 'type' => '', + 'name' => $_queryName); + $result->main_get[0]['as'] = 'a'; + $result->main_get[0]['key'] + = $result->key; + $result->main_get[0]['context'] = $context; // do not add $addDynamicTweaksJoints = false; break; @@ -3600,55 +4570,88 @@ class Get if ($addDynamicTweaksJoints) { // set join_view_table details - $result->join_view_table = json_decode($result->join_view_table, true); - if (ComponentbuilderHelper::checkArray($result->join_view_table)) + $result->join_view_table = json_decode( + $result->join_view_table, true + ); + if (ComponentbuilderHelper::checkArray( + $result->join_view_table + )) { // start the part of a table bucket $_part_of_a = array(); // build relationship - $_relationship = array_map(function($op) use(&$_part_of_a){ - $bucket = array(); - // array(on_field_as, on_field) - $bucket['on_field'] = array_map('trim', explode('.', $op['on_field'])); - // array(join_field_as, join_field) - $bucket['join_field'] = array_map('trim', explode('.', $op['join_field'])); - // triget filed that has table a relationship - if ($op['row_type'] == 1 && ($bucket['on_field'][0] === 'a' || - isset($_part_of_a[$bucket['on_field'][0]]) || - isset($_part_of_a[$bucket['join_field'][0]]))) - { - $_part_of_a[$op['as']] = $op['as']; - } - return $bucket; - }, $result->join_view_table); + $_relationship = array_map( + function ($op) use (&$_part_of_a) { + $bucket = array(); + // array(on_field_as, on_field) + $bucket['on_field'] = array_map( + 'trim', + explode('.', $op['on_field']) + ); + // array(join_field_as, join_field) + $bucket['join_field'] = array_map( + 'trim', + explode('.', $op['join_field']) + ); + // triget filed that has table a relationship + if ($op['row_type'] == 1 + && ($bucket['on_field'][0] === 'a' + || isset($_part_of_a[$bucket['on_field'][0]]) + || isset($_part_of_a[$bucket['join_field'][0]]))) + { + $_part_of_a[$op['as']] = $op['as']; + } + + return $bucket; + }, $result->join_view_table + ); // loop joints - foreach ($result->join_view_table as $nr => &$option) + foreach ( + $result->join_view_table as $nr => &$option + ) { - if (ComponentbuilderHelper::checkString($option['selection'])) + if (ComponentbuilderHelper::checkString( + $option['selection'] + )) { // convert the type - $option['type'] = $typeArray[$option['type']]; + $option['type'] + = $typeArray[$option['type']]; // convert the operator - $option['operator'] = $operatorArray[$option['operator']]; + $option['operator'] + = $operatorArray[$option['operator']]; // get the on field values - $on_field = $_relationship[$nr]['on_field']; + $on_field + = $_relationship[$nr]['on_field']; // get the join field values - $join_field = $_relationship[$nr]['join_field']; + $join_field + = $_relationship[$nr]['join_field']; // set selection - $option['selection'] = $this->setDataSelection($result->key, $view_code, $option['selection'], $option['view_table'], $option['as'], $option['row_type'], 'view'); - $option['key'] = $result->key; + $option['selection'] + = $this->setDataSelection( + $result->key, $view_code, + $option['selection'], + $option['view_table'], + $option['as'], $option['row_type'], + 'view' + ); + $option['key'] = $result->key; $option['context'] = $context; // load to the getters if ($option['row_type'] == 1) { $result->main_get[] = $option; - if ($on_field[0] === 'a' || isset($_part_of_a[$join_field[0]]) || isset($_part_of_a[$on_field[0]])) + if ($on_field[0] === 'a' + || isset($_part_of_a[$join_field[0]]) + || isset($_part_of_a[$on_field[0]])) { - $this->siteMainGet[$this->target][$view_code][$option['as']] = $option['as']; + $this->siteMainGet[$this->target][$view_code][$option['as']] + = $option['as']; } else { - $this->siteDynamicGet[$this->target][$view_code][$option['as']][$join_field[1]] = $on_field[0]; + $this->siteDynamicGet[$this->target][$view_code][$option['as']][$join_field[1]] + = $on_field[0]; } } elseif ($option['row_type'] == 2) @@ -3656,7 +4659,8 @@ class Get $result->custom_get[] = $option; if ($on_field[0] != 'a') { - $this->siteDynamicGet[$this->target][$view_code][$option['as']][$join_field[1]] = $on_field[0]; + $this->siteDynamicGet[$this->target][$view_code][$option['as']][$join_field[1]] + = $on_field[0]; } } } @@ -3665,56 +4669,89 @@ class Get } unset($result->join_view_table); // set join_db_table details - $result->join_db_table = json_decode($result->join_db_table, true); - if (ComponentbuilderHelper::checkArray($result->join_db_table)) + $result->join_db_table = json_decode( + $result->join_db_table, true + ); + if (ComponentbuilderHelper::checkArray( + $result->join_db_table + )) { // start the part of a table bucket $_part_of_a = array(); // build relationship - $_relationship = array_map(function($op) use(&$_part_of_a){ - $bucket = array(); - // array(on_field_as, on_field) - $bucket['on_field'] = array_map('trim', explode('.', $op['on_field'])); - // array(join_field_as, join_field) - $bucket['join_field'] = array_map('trim', explode('.', $op['join_field'])); - // triget filed that has table a relationship - if ($op['row_type'] == 1 && ($bucket['on_field'][0] === 'a' || - isset($_part_of_a[$bucket['on_field'][0]]) || - isset($_part_of_a[$bucket['join_field'][0]]))) - { - $_part_of_a[$op['as']] = $op['as']; - } - return $bucket; - }, $result->join_db_table); + $_relationship = array_map( + function ($op) use (&$_part_of_a) { + $bucket = array(); + // array(on_field_as, on_field) + $bucket['on_field'] = array_map( + 'trim', + explode('.', $op['on_field']) + ); + // array(join_field_as, join_field) + $bucket['join_field'] = array_map( + 'trim', + explode('.', $op['join_field']) + ); + // triget filed that has table a relationship + if ($op['row_type'] == 1 + && ($bucket['on_field'][0] === 'a' + || isset($_part_of_a[$bucket['on_field'][0]]) + || isset($_part_of_a[$bucket['join_field'][0]]))) + { + $_part_of_a[$op['as']] = $op['as']; + } + + return $bucket; + }, $result->join_db_table + ); // loop joints - foreach ($result->join_db_table as $nr => &$option1) + foreach ( + $result->join_db_table as $nr => &$option1 + ) { - if (ComponentbuilderHelper::checkString($option1['selection'])) + if (ComponentbuilderHelper::checkString( + $option1['selection'] + )) { // convert the type - $option1['type'] = $typeArray[$option1['type']]; + $option1['type'] + = $typeArray[$option1['type']]; // convert the operator - $option1['operator'] = $operatorArray[$option1['operator']]; + $option1['operator'] + = $operatorArray[$option1['operator']]; // get the on field values - $on_field = $_relationship[$nr]['on_field']; + $on_field + = $_relationship[$nr]['on_field']; // get the join field values - $join_field = $_relationship[$nr]['join_field']; + $join_field + = $_relationship[$nr]['join_field']; // set selection - $option1['selection'] = $this->setDataSelection($result->key, $view_code, $option1['selection'], $option1['db_table'], $option1['as'], $option1['row_type'], 'db'); - $option1['key'] = $result->key; + $option1['selection'] + = $this->setDataSelection( + $result->key, $view_code, + $option1['selection'], + $option1['db_table'], + $option1['as'], + $option1['row_type'], 'db' + ); + $option1['key'] = $result->key; $option1['context'] = $context; // load to the getters if ($option1['row_type'] == 1) { $result->main_get[] = $option1; - if ($on_field[0] === 'a' || isset($_part_of_a[$join_field[0]]) || isset($_part_of_a[$on_field[0]])) + if ($on_field[0] === 'a' + || isset($_part_of_a[$join_field[0]]) + || isset($_part_of_a[$on_field[0]])) { - $this->siteMainGet[$this->target][$view_code][$option1['as']] = $option1['as']; + $this->siteMainGet[$this->target][$view_code][$option1['as']] + = $option1['as']; } else { - $this->siteDynamicGet[$this->target][$view_code][$option1['as']][$join_field[1]] = $on_field[0]; + $this->siteDynamicGet[$this->target][$view_code][$option1['as']][$join_field[1]] + = $on_field[0]; } } elseif ($option1['row_type'] == 2) @@ -3722,7 +4759,8 @@ class Get $result->custom_get[] = $option1; if ($on_field[0] != 'a') { - $this->siteDynamicGet[$this->target][$view_code][$option1['as']][$join_field[1]] = $on_field[0]; + $this->siteDynamicGet[$this->target][$view_code][$option1['as']][$join_field[1]] + = $on_field[0]; } } } @@ -3731,15 +4769,25 @@ class Get } unset($result->join_db_table); // set filter details - $result->filter = json_decode($result->filter, true); - if (ComponentbuilderHelper::checkArray($result->filter)) + $result->filter = json_decode( + $result->filter, true + ); + if (ComponentbuilderHelper::checkArray( + $result->filter + )) { foreach ($result->filter as $nr => &$option2) { if (isset($option2['operator'])) { - $option2['operator'] = $operatorArray[$option2['operator']]; - $option2['state_key'] = $this->setPlaceholders($this->setDynamicValues($option2['state_key']), $this->placeholders); + $option2['operator'] + = $operatorArray[$option2['operator']]; + $option2['state_key'] + = $this->setPlaceholders( + $this->setDynamicValues( + $option2['state_key'] + ), $this->placeholders + ); $option2['key'] = $result->key; } else @@ -3750,13 +4798,16 @@ class Get } // set where details $result->where = json_decode($result->where, true); - if (ComponentbuilderHelper::checkArray($result->where)) + if (ComponentbuilderHelper::checkArray( + $result->where + )) { foreach ($result->where as $nr => &$option3) { if (isset($option3['operator'])) { - $option3['operator'] = $operatorArray[$option3['operator']]; + $option3['operator'] + = $operatorArray[$option3['operator']]; } else { @@ -3770,19 +4821,27 @@ class Get } // set order details $result->order = json_decode($result->order, true); - if (!ComponentbuilderHelper::checkArray($result->order)) + if (!ComponentbuilderHelper::checkArray( + $result->order + )) { unset($result->order); } // set grouping $result->group = json_decode($result->group, true); - if (!ComponentbuilderHelper::checkArray($result->group)) + if (!ComponentbuilderHelper::checkArray( + $result->group + )) { unset($result->group); } // set global details - $result->global = json_decode($result->global, true); - if (!ComponentbuilderHelper::checkArray($result->global)) + $result->global = json_decode( + $result->global, true + ); + if (!ComponentbuilderHelper::checkArray( + $result->global + )) { unset($result->global); } @@ -3799,70 +4858,85 @@ class Get unset($result->global); } // load the events if any is set - if ($result->gettype == 1 && ComponentbuilderHelper::checkJson($result->plugin_events)) + if ($result->gettype == 1 + && ComponentbuilderHelper::checkJson( + $result->plugin_events + )) { - $result->plugin_events = json_decode($result->plugin_events, true); + $result->plugin_events = json_decode( + $result->plugin_events, true + ); } else { $result->plugin_events = ''; } } + return $results; } } } + return false; } /** * set the script for the custom script builder * - * @param string $script The script - * @param string $first The first key - * @param string $second The second key (if not set we use only first key) - * @param string $third The third key (if not set we use only first and second key) - * @param array $config The config options - * @param bool $base64 The switch to decode base64 the script - * default: true - * @param bool $dynamic The switch to dynamic update the script - * default: true - * @param bool $add The switch to add to exiting instead of replace - * default: false + * @param string $script The script + * @param string $first The first key + * @param string $second The second key (if not set we use only first key) + * @param string $third The third key (if not set we use only first and second key) + * @param array $config The config options + * @param bool $base64 The switch to decode base64 the script + * default: true + * @param bool $dynamic The switch to dynamic update the script + * default: true + * @param bool $add The switch to add to exiting instead of replace + * default: false * * @return boolean true on success * */ - public function setCustomScriptBuilder(&$script, $first, $second = false, $third = false, $config = array(), $base64 = true, $dynamic = true, $add = false) - { + public function setCustomScriptBuilder(&$script, $first, $second = false, + $third = false, $config = array(), $base64 = true, $dynamic = true, + $add = false + ) { // only load if we have a string if (!ComponentbuilderHelper::checkString($script)) { return false; } // this needs refactoring (TODO) - if (!isset($this->customScriptBuilder[$first]) || ($second && !isset($this->customScriptBuilder[$first][$second]))) + if (!isset($this->customScriptBuilder[$first]) + || ($second + && !isset($this->customScriptBuilder[$first][$second]))) { // check if the script first key is set if ($second && !isset($this->customScriptBuilder[$first])) { $this->customScriptBuilder[$first] = array(); } - elseif ($add && !$second && !isset($this->customScriptBuilder[$first])) + elseif ($add && !$second + && !isset($this->customScriptBuilder[$first])) { $this->customScriptBuilder[$first] = ''; } // check if the script second key is set - if ($second && $third && !isset($this->customScriptBuilder[$first][$second])) + if ($second && $third + && !isset($this->customScriptBuilder[$first][$second])) { $this->customScriptBuilder[$first][$second] = array(); } - elseif ($add && $second && !$third && !isset($this->customScriptBuilder[$first][$second])) + elseif ($add && $second && !$third + && !isset($this->customScriptBuilder[$first][$second])) { $this->customScriptBuilder[$first][$second] = ''; } // check if the script third key is set - if ($add && $second && $third && !isset($this->customScriptBuilder[$first][$second][$third])) + if ($add && $second && $third + && !isset($this->customScriptBuilder[$first][$second][$third])) { $this->customScriptBuilder[$first][$second][$third] = ''; } @@ -3894,11 +4968,13 @@ class Get // now act on loading option if ($add) { - $this->customScriptBuilder[$first][$second][$third] .= $script; + $this->customScriptBuilder[$first][$second][$third] + .= $script; } else { - $this->customScriptBuilder[$first][$second][$third] = $script; + $this->customScriptBuilder[$first][$second][$third] + = $script; } } elseif ($first && $second) @@ -3925,18 +5001,20 @@ class Get $this->customScriptBuilder[$first] = $script; } } + return true; } + return false; } /** * To limit the SQL Demo date build in the views - * - * @param array $settings Tweaking array. + * + * @param array $settings Tweaking array. * * @return void - * + * */ public function setSqlTweaking($settings) { @@ -3950,14 +5028,16 @@ class Get // add sql (by option) if (2 == $setting['add_sql_options']) { - // rest always + // rest always $id_array = array(); // by id (first remove backups) $ids = $setting['ids']; // now get the ids if (strpos($ids, ',') !== false) { - $id_array = (array) array_map('trim', explode(',', $ids)); + $id_array = (array) array_map( + 'trim', explode(',', $ids) + ); } else { @@ -3969,13 +5049,19 @@ class Get { if (strpos($id, '=>') !== false) { - $id_range = (array) array_map('trim', explode('=>', $id)); + $id_range = (array) array_map( + 'trim', explode('=>', $id) + ); unset($id_array[$key]); // build range if (count((array) $id_range) == 2) { - $range = range($id_range[0], $id_range[1]); - $id_array_new = array_merge($id_array_new, $range); + $range = range( + $id_range[0], $id_range[1] + ); + $id_array_new = array_merge( + $id_array_new, $range + ); } } } @@ -3991,14 +5077,16 @@ class Get // sort sort($id_array, SORT_NUMERIC); // now set it to global - $this->sqlTweak[(int) $setting['adminview']]['where'] = implode(',', $id_array); + $this->sqlTweak[(int) $setting['adminview']]['where'] + = implode(',', $id_array); } } } else { // remove all sql dump options - $this->sqlTweak[(int) $setting['adminview']]['remove'] = true; + $this->sqlTweak[(int) $setting['adminview']]['remove'] + = true; } } } @@ -4006,20 +5094,22 @@ class Get /** * check if an update SQL is needed - * - * @param mix $old The old values - * @param mix $new The new values - * @param string $type The type of values - * @param int $key The id/key where values changed - * @param array $ignore The ids to ignore + * + * @param mix $old The old values + * @param mix $new The new values + * @param string $type The type of values + * @param int $key The id/key where values changed + * @param array $ignore The ids to ignore * * @return void - * + * */ - protected function setUpdateSQL($old, $new, $type, $key = null, $ignore = null) - { + protected function setUpdateSQL($old, $new, $type, $key = null, + $ignore = null + ) { // check if there were new items added - if (ComponentbuilderHelper::checkArray($new) && ComponentbuilderHelper::checkArray($old)) + if (ComponentbuilderHelper::checkArray($new) + && ComponentbuilderHelper::checkArray($old)) { // check if this is old repeatable field if (isset($new[$type])) @@ -4028,13 +5118,17 @@ class Get { $newItem = true; // check if this is an id to ignore - if (ComponentbuilderHelper::checkArray($ignore) && in_array($item, $ignore)) + if (ComponentbuilderHelper::checkArray($ignore) + && in_array( + $item, $ignore + )) { // don't add ignored ids $newItem = false; } // check if this is old repeatable field - elseif (isset($old[$type]) && ComponentbuilderHelper::checkArray($old[$type])) + elseif (isset($old[$type]) + && ComponentbuilderHelper::checkArray($old[$type])) { if (!in_array($item, $old[$type])) { @@ -4085,13 +5179,15 @@ class Get // search to see if this is a new value $newItem = true; // check if this is an id to ignore - if (ComponentbuilderHelper::checkArray($ignore) && in_array($item[$type], $ignore)) + if (ComponentbuilderHelper::checkArray($ignore) + && in_array($item[$type], $ignore)) { // don't add ignored ids $newItem = false; } // check if this is old repeatable field - elseif (isset($old[$type]) && ComponentbuilderHelper::checkArray($old[$type])) + elseif (isset($old[$type]) + && ComponentbuilderHelper::checkArray($old[$type])) { if (in_array($item[$type], $old[$type])) { @@ -4132,10 +5228,15 @@ class Get } } } - elseif ($key && ((ComponentbuilderHelper::checkString($new) && ComponentbuilderHelper::checkString($old)) || (is_numeric($new) && is_numeric($old))) && $new !== $old) + elseif ($key + && ((ComponentbuilderHelper::checkString($new) + && ComponentbuilderHelper::checkString($old)) + || (is_numeric($new) && is_numeric($old))) + && $new !== $old) { // the string changed, lets add to SQL update - if (!isset($this->updateSQL[$type]) || !ComponentbuilderHelper::checkArray($this->updateSQL[$type])) + if (!isset($this->updateSQL[$type]) + || !ComponentbuilderHelper::checkArray($this->updateSQL[$type])) { $this->updateSQL[$type] = array(); } @@ -4146,24 +5247,30 @@ class Get /** * Set the add sql - * - * @param string $type The type of values - * @param int $item The item id to add - * @param int $key The id/key where values changed - * + * + * @param string $type The type of values + * @param int $item The item id to add + * @param int $key The id/key where values changed + * * @return void */ protected function setAddSQL($type, $item, $key) { // we have a new item, lets add to SQL - if (!isset($this->addSQL[$type]) || !ComponentbuilderHelper::checkArray($this->addSQL[$type])) + if (!isset($this->addSQL[$type]) + || !ComponentbuilderHelper::checkArray( + $this->addSQL[$type] + )) { $this->addSQL[$type] = array(); } // add key if found if ($key) { - if (!isset($this->addSQL[$type][$key]) || !ComponentbuilderHelper::checkArray($this->addSQL[$type][$key])) + if (!isset($this->addSQL[$type][$key]) + || !ComponentbuilderHelper::checkArray( + $this->addSQL[$type][$key] + )) { $this->addSQL[$type][$key] = array(); } @@ -4174,7 +5281,9 @@ class Get // convert adminview id to name if ('adminview' === $type) { - $this->addSQL[$type][] = ComponentbuilderHelper::safeString($this->getAdminViewData($item)->name_single); + $this->addSQL[$type][] = ComponentbuilderHelper::safeString( + $this->getAdminViewData($item)->name_single + ); } else { @@ -4185,12 +5294,12 @@ class Get /** * Get Item History values - * - * @param string $type The type of item - * @param int $id The item ID + * + * @param string $type The type of item + * @param int $id The item ID * * @return oject The history - * + * */ protected function getHistoryWatch($type, $id) { @@ -4201,10 +5310,18 @@ class Get $query->select('h.*'); $query->from('#__ucm_history AS h'); - $query->where($this->db->quoteName('h.ucm_item_id') . ' = ' . (int) $id); + $query->where( + $this->db->quoteName('h.ucm_item_id') . ' = ' . (int) $id + ); // Join over the content type for the type id - $query->join('LEFT', '#__content_types AS ct ON ct.type_id = h.ucm_type_id'); - $query->where('ct.type_alias = ' . $this->db->quote('com_componentbuilder.' . $type)); + $query->join( + 'LEFT', '#__content_types AS ct ON ct.type_id = h.ucm_type_id' + ); + $query->where( + 'ct.type_alias = ' . $this->db->quote( + 'com_componentbuilder.' . $type + ) + ); $query->order('h.save_date DESC'); $this->db->setQuery($query, 0, 1); $this->db->execute(); @@ -4221,7 +5338,9 @@ class Get $query->select('h.*'); $query->from('#__ucm_history AS h'); - $query->where($this->db->quoteName('h.ucm_item_id') . ' = ' . (int) $id); + $query->where( + $this->db->quoteName('h.ucm_item_id') . ' = ' . (int) $id + ); $query->where('h.keep_forever = 1'); $query->where('h.version_note LIKE ' . $this->db->quote('%component%')); // make sure it does not return the active version @@ -4230,8 +5349,14 @@ class Get $query->where('h.version_id != ' . (int) $newActive->version_id); } // Join over the content type for the type id - $query->join('LEFT', '#__content_types AS ct ON ct.type_id = h.ucm_type_id'); - $query->where('ct.type_alias = ' . $this->db->quote('com_componentbuilder.' . $type)); + $query->join( + 'LEFT', '#__content_types AS ct ON ct.type_id = h.ucm_type_id' + ); + $query->where( + 'ct.type_alias = ' . $this->db->quote( + 'com_componentbuilder.' . $type + ) + ); $query->order('h.save_date DESC'); $this->db->setQuery($query); $this->db->execute(); @@ -4247,21 +5372,22 @@ class Get $this->setHistoryWatch($oldActive, 0); } } + // return the last used history record or null. return $this->tmpHistory; } /** * Set Item History Watch - * - * @param Object $object The history object - * @param int $action The action to take - * 0 = remove watch - * 1 = add watch - * @param string $type The type of item + * + * @param Object $object The history object + * @param int $action The action to take + * 0 = remove watch + * 1 = add watch + * @param string $type The type of item * * @return bool - * + * */ protected function setHistoryWatch($object, $action) { @@ -4279,11 +5405,14 @@ class Get { case 0: // remove watch - if (isset($version_note['component']) && ($key = array_search($this->componentID, $version_note['component'])) !== false) + if (isset($version_note['component']) + && ($key = array_search( + $this->componentID, $version_note['component'] + )) !== false) { // last version that was used to build/compile $this->tmpHistory = json_decode($object->version_data); - // remove it from this component + // remove it from this component unset($version_note['component'][$key]); } else @@ -4306,10 +5435,13 @@ class Get break; } // check if we need to still keep this locked - if (isset($version_note['component']) && ComponentbuilderHelper::checkArray($version_note['component'])) + if (isset($version_note['component']) + && ComponentbuilderHelper::checkArray($version_note['component'])) { // insure component ids are only added once per item - $version_note['component'] = array_unique($version_note['component']); + $version_note['component'] = array_unique( + $version_note['component'] + ); // we may change this, little risky (but since JCB does not have history notes it should be okay for now) $object->version_note = json_encode($version_note); $object->keep_forever = '1'; @@ -4319,27 +5451,33 @@ class Get $object->version_note = ''; $object->keep_forever = '0'; } + // run the update return $this->db->updateObject('#__ucm_history', $object, 'version_id'); } /** * Set Template and Layout Data - * - * @param string $default The content to check - * @param string $view The view code name + * + * @param string $default The content to check + * @param string $view The view code name * * @return void - * + * */ public function setTemplateAndLayoutData($default, $view) { // set the Tempale date - $temp1 = ComponentbuilderHelper::getAllBetween($default, "\$this->loadTemplate('", "')"); - $temp2 = ComponentbuilderHelper::getAllBetween($default, '$this->loadTemplate("', '")'); + $temp1 = ComponentbuilderHelper::getAllBetween( + $default, "\$this->loadTemplate('", "')" + ); + $temp2 = ComponentbuilderHelper::getAllBetween( + $default, '$this->loadTemplate("', '")' + ); $templates = array(); - $again = array(); - if (ComponentbuilderHelper::checkArray($temp1) && ComponentbuilderHelper::checkArray($temp2)) + $again = array(); + if (ComponentbuilderHelper::checkArray($temp1) + && ComponentbuilderHelper::checkArray($temp2)) { $templates = array_merge($temp1, $temp2); } @@ -4358,12 +5496,18 @@ class Get { foreach ($templates as $template) { - if (!isset($this->templateData[$this->target][$view]) || !array_key_exists($template, $this->templateData[$this->target][$view])) + if (!isset($this->templateData[$this->target][$view]) + || !array_key_exists( + $template, $this->templateData[$this->target][$view] + )) { - $data = $this->getDataWithAlias($template, 'template', $view); + $data = $this->getDataWithAlias( + $template, 'template', $view + ); if (ComponentbuilderHelper::checkArray($data)) { - $this->templateData[$this->target][$view][$template] = $data; + $this->templateData[$this->target][$view][$template] + = $data; // call self to get child data $again[] = array($data['html'], $view); $again[] = array($data['php_view'], $view); @@ -4372,10 +5516,14 @@ class Get } } // set the layout data - $lay1 = ComponentbuilderHelper::getAllBetween($default, "JLayoutHelper::render('", "',"); - $lay2 = ComponentbuilderHelper::getAllBetween($default, 'JLayoutHelper::render("', '",'); - ; - if (ComponentbuilderHelper::checkArray($lay1) && ComponentbuilderHelper::checkArray($lay2)) + $lay1 = ComponentbuilderHelper::getAllBetween( + $default, "JLayoutHelper::render('", "'," + ); + $lay2 = ComponentbuilderHelper::getAllBetween( + $default, 'JLayoutHelper::render("', '",' + );; + if (ComponentbuilderHelper::checkArray($lay1) + && ComponentbuilderHelper::checkArray($lay2)) { $layouts = array_merge($lay1, $lay2); } @@ -4394,7 +5542,13 @@ class Get { foreach ($layouts as $layout) { - if (!isset($this->layoutData[$this->target]) || !ComponentbuilderHelper::checkArray($this->layoutData[$this->target]) || !array_key_exists($layout, $this->layoutData[$this->target])) + if (!isset($this->layoutData[$this->target]) + || !ComponentbuilderHelper::checkArray( + $this->layoutData[$this->target] + ) + || !array_key_exists( + $layout, $this->layoutData[$this->target] + )) { $data = $this->getDataWithAlias($layout, 'layout', $view); if (ComponentbuilderHelper::checkArray($data)) @@ -4418,13 +5572,13 @@ class Get /** * Get Data With Alias - * - * @param string $n_ame The alias name - * @param string $table The table where to find the alias - * @param string $view The view code name + * + * @param string $n_ame The alias name + * @param string $table The table where to find the alias + * @param string $view The view code name * * @return array The data found with the alias - * + * */ public function getDataWithAlias($n_ame, $table, $view) { @@ -4437,30 +5591,31 @@ class Get foreach ($rows as $row) { $k_ey = ComponentbuilderHelper::safeString($row->alias); - $key = preg_replace("/[^A-Za-z]/", '', $k_ey); + $key = preg_replace("/[^A-Za-z]/", '', $k_ey); $name = preg_replace("/[^A-Za-z]/", '', $n_ame); if ($k_ey == $n_ame || $key == $name) { $php_view = ''; - if ($row->add_php_view == 1 && ComponentbuilderHelper::checkString($row->php_view)) + if ($row->add_php_view == 1 + && ComponentbuilderHelper::checkString($row->php_view)) { $php_view = $this->setGuiCodePlaceholder( $this->setDynamicValues(base64_decode($row->php_view)), array( 'table' => $table, 'field' => 'php_view', - 'id' => (int) $row->id, - 'type' => 'php') - ); + 'id' => (int) $row->id, + 'type' => 'php') + ); } $contnent = $this->setGuiCodePlaceholder( - $this->setDynamicValues(base64_decode($row->{$table})), - array( - 'table' => $table, - 'field' => $table, - 'id' => (int) $row->id, - 'type' => 'html') - ); + $this->setDynamicValues(base64_decode($row->{$table})), + array( + 'table' => $table, + 'field' => $table, + 'id' => (int) $row->id, + 'type' => 'html') + ); // load the library if (!isset($this->libManager[$this->target])) { @@ -4484,16 +5639,19 @@ class Get { if ($this->getMediaLibrary((int) $library)) { - $this->libManager[$this->target][$view][(int) $library] = true; + $this->libManager[$this->target][$view][(int) $library] + = true; } } } } - elseif (is_numeric($row->libraries) && !isset($this->libManager[$this->target][$view][(int) $row->libraries])) + elseif (is_numeric($row->libraries) + && !isset($this->libManager[$this->target][$view][(int) $row->libraries])) { if ($this->getMediaLibrary((int) $row->libraries)) { - $this->libManager[$this->target][$view][(int) $row->libraries] = true; + $this->libManager[$this->target][$view][(int) $row->libraries] + = true; } } // load UIKIT if needed @@ -4504,10 +5662,14 @@ class Get $this->uikitComp[$view] = array(); } // set uikit to views - $this->uikitComp[$view] = ComponentbuilderHelper::getUikitComp($contnent, $this->uikitComp[$view]); + $this->uikitComp[$view] + = ComponentbuilderHelper::getUikitComp( + $contnent, $this->uikitComp[$view] + ); } // set footable to views and turn it on - if (!isset($this->footableScripts[$this->target][$view]) || !$this->footableScripts[$this->target][$view]) + if (!isset($this->footableScripts[$this->target][$view]) + || !$this->footableScripts[$this->target][$view]) { $foundFoo = $this->getFootableScripts($contnent); if ($foundFoo) @@ -4520,7 +5682,8 @@ class Get } } // set google charts to views and turn it on - if (!isset($this->googleChart[$this->target][$view]) || !$this->googleChart[$this->target][$view]) + if (!isset($this->googleChart[$this->target][$view]) + || !$this->googleChart[$this->target][$view]) { $foundA = $this->getGoogleChart($php_view); $foundB = $this->getGoogleChart($contnent); @@ -4534,7 +5697,8 @@ class Get } } // check for get module - if (!isset($this->getModule[$this->target][$view]) || !$this->getModule[$this->target][$view]) + if (!isset($this->getModule[$this->target][$view]) + || !$this->getModule[$this->target][$view]) { $foundA = $this->getGetModule($php_view); $foundB = $this->getGetModule($contnent); @@ -4543,39 +5707,41 @@ class Get $this->getModule[$this->target][$view] = true; } } + return array( - 'id' => $row->id, - 'html' => $this->setGuiCodePlaceholder( + 'id' => $row->id, + 'html' => $this->setGuiCodePlaceholder( $contnent, array( 'table' => $table, 'field' => $table, - 'id' => $row->id, - 'type' => 'html' - ) - ), + 'id' => $row->id, + 'type' => 'html' + ) + ), 'php_view' => $this->setGuiCodePlaceholder( $php_view, array( 'table' => $table, 'field' => 'php_view', - 'id' => $row->id, - 'type' => 'php' - ) + 'id' => $row->id, + 'type' => 'php' ) - ); + ) + ); } } + return false; } /** * Get Media Library Data and store globally - * - * @param string $id the library id + * + * @param string $id the library id * * @return bool true on success - * + * */ protected function getMediaLibrary($id) { @@ -4604,7 +5770,8 @@ class Get } break; case 5: // FooTable v2 - if (!isset($this->footableVersion) || 2 == $this->footableVersion) + if (!isset($this->footableVersion) + || 2 == $this->footableVersion) { // already being loaded $this->libraries[$id] = false; @@ -4628,38 +5795,48 @@ class Get $query->select( $this->db->quoteName( array( - 'a.id', - 'a.name', - 'a.how', - 'a.type', - 'a.addconditions', - 'b.addconfig', - 'c.addfiles', - 'c.addfolders', - 'c.addfilesfullpath', - 'c.addfoldersfullpath', - 'c.addurls', - 'a.php_setdocument' + 'a.id', + 'a.name', + 'a.how', + 'a.type', + 'a.addconditions', + 'b.addconfig', + 'c.addfiles', + 'c.addfolders', + 'c.addfilesfullpath', + 'c.addfoldersfullpath', + 'c.addurls', + 'a.php_setdocument' ), array( - 'id', - 'name', - 'how', - 'type', - 'addconditions', - 'addconfig', - 'addfiles', - 'addfolders', - 'addfilesfullpath', - 'addfoldersfullpath', - 'addurls', - 'php_setdocument' + 'id', + 'name', + 'how', + 'type', + 'addconditions', + 'addconfig', + 'addfiles', + 'addfolders', + 'addfilesfullpath', + 'addfoldersfullpath', + 'addurls', + 'php_setdocument' ) ) ); // from these tables $query->from('#__componentbuilder_library AS a'); - $query->join('LEFT', $this->db->quoteName('#__componentbuilder_library_config', 'b') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('b.library') . ')'); - $query->join('LEFT', $this->db->quoteName('#__componentbuilder_library_files_folders_urls', 'c') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('c.library') . ')'); + $query->join( + 'LEFT', + $this->db->quoteName('#__componentbuilder_library_config', 'b') + . ' ON (' . $this->db->quoteName('a.id') . ' = ' + . $this->db->quoteName('b.library') . ')' + ); + $query->join( + 'LEFT', $this->db->quoteName( + '#__componentbuilder_library_files_folders_urls', 'c' + ) . ' ON (' . $this->db->quoteName('a.id') . ' = ' + . $this->db->quoteName('c.library') . ')' + ); $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); $query->where($this->db->quoteName('a.target') . ' = 1'); @@ -4673,8 +5850,16 @@ class Get if ($library->how == 4) { // fall back on build-in features - $buildin = array(3 => array('uikit' => 3), 4 => array('uikit' => 1), 5 => array('footableVersion' => 2, 'footable' => true), 6 => array('footableVersion' => 3, 'footable' => true)); - if (isset($buildin[$library->id]) && ComponentbuilderHelper::checkArray($buildin[$library->id])) + $buildin = array(3 => array('uikit' => 3), + 4 => array('uikit' => 1), + 5 => array('footableVersion' => 2, + 'footable' => true), + 6 => array('footableVersion' => 3, + 'footable' => true)); + if (isset($buildin[$library->id]) + && ComponentbuilderHelper::checkArray( + $buildin[$library->id] + )) { // set the lib switch foreach ($buildin[$library->id] as $lib => $val) @@ -4694,14 +5879,29 @@ class Get if ($library->how > 0) { // set the add targets - $addArray = array('files' => 'files', 'folders' => 'folders', 'urls' => 'urls', 'filesfullpath' => 'files', 'foldersfullpath' => 'folders'); + $addArray = array('files' => 'files', + 'folders' => 'folders', + 'urls' => 'urls', + 'filesfullpath' => 'files', + 'foldersfullpath' => 'folders'); foreach ($addArray as $addTarget => $targetHere) { // set the add target data - $library->{'add' . $addTarget} = (isset($library->{'add' . $addTarget}) && ComponentbuilderHelper::checkJson($library->{'add' . $addTarget})) ? json_decode($library->{'add' . $addTarget}, true) : null; - if (ComponentbuilderHelper::checkArray($library->{'add' . $addTarget})) + $library->{'add' . $addTarget} = (isset( + $library->{'add' . $addTarget} + ) + && ComponentbuilderHelper::checkJson( + $library->{'add' . $addTarget} + )) ? json_decode($library->{'add' . $addTarget}, true) + : null; + if (ComponentbuilderHelper::checkArray( + $library->{'add' . $addTarget} + )) { - if (isset($library->{$targetHere}) && ComponentbuilderHelper::checkArray($library->{$targetHere})) + if (isset($library->{$targetHere}) + && ComponentbuilderHelper::checkArray( + $library->{$targetHere} + )) { foreach ($library->{'add' . $addTarget} as $taget) { @@ -4710,7 +5910,9 @@ class Get } else { - $library->{$targetHere} = array_values($library->{'add' . $addTarget}); + $library->{$targetHere} = array_values( + $library->{'add' . $addTarget} + ); } } unset($library->{'add' . $addTarget}); @@ -4719,42 +5921,61 @@ class Get if ($library->how > 1) { // set the config data - $library->addconfig = (isset($library->addconfig) && ComponentbuilderHelper::checkJson($library->addconfig)) ? json_decode($library->addconfig, true) : null; + $library->addconfig = (isset($library->addconfig) + && ComponentbuilderHelper::checkJson( + $library->addconfig + )) ? json_decode($library->addconfig, true) : null; if (ComponentbuilderHelper::checkArray($library->addconfig)) { - $library->config = array_map(function($array) - { - $array['alias'] = 0; - $array['title'] = 0; - $array['settings'] = $this->getFieldData($array['field']); - return $array; - }, array_values($library->addconfig)); + $library->config = array_map( + function ($array) { + $array['alias'] = 0; + $array['title'] = 0; + $array['settings'] = $this->getFieldData( + $array['field'] + ); + + return $array; + }, array_values($library->addconfig) + ); } } // if this lib is controlled by custom script if (3 == $library->how) { // set Needed PHP - if (isset($library->php_setdocument) && ComponentbuilderHelper::checkString($library->php_setdocument)) + if (isset($library->php_setdocument) + && ComponentbuilderHelper::checkString( + $library->php_setdocument + )) { $library->document = $this->setGuiCodePlaceholder( - $this->setDynamicValues(base64_decode($library->php_setdocument)), + $this->setDynamicValues( + base64_decode($library->php_setdocument) + ), array( 'table' => 'library', 'field' => 'php_setdocument', - 'id' => (int) $id, - 'type' => 'php') - ); + 'id' => (int) $id, + 'type' => 'php') + ); } } // if this lib is controlled by conditions elseif (2 == $library->how) { // set the addconditions data - $library->addconditions = (isset($library->addconditions) && ComponentbuilderHelper::checkJson($library->addconditions)) ? json_decode($library->addconditions, true) : null; - if (ComponentbuilderHelper::checkArray($library->addconditions)) + $library->addconditions = (isset($library->addconditions) + && ComponentbuilderHelper::checkJson( + $library->addconditions + )) ? json_decode($library->addconditions, true) : null; + if (ComponentbuilderHelper::checkArray( + $library->addconditions + )) { - $library->conditions = array_values($library->addconditions); + $library->conditions = array_values( + $library->addconditions + ); } } unset($library->php_setdocument); @@ -4773,13 +5994,14 @@ class Get { return $this->libraries[$id]; } + return false; } /** * Set Language Place Holders * - * @param string $content The content + * @param string $content The content * * @return string The content with the updated Language place holder * @@ -4788,14 +6010,15 @@ class Get { // get targets to search for $langStringTargets = array_filter( - $this->langStringTargets, function($get) use($content) - { + $this->langStringTargets, function ($get) use ($content) { if (strpos($content, $get) !== false) { return true; } + return false; - }); + } + ); // check if we should continue if (ComponentbuilderHelper::checkArray($langStringTargets)) { @@ -4803,45 +6026,63 @@ class Get $content = $this->setPlaceholders($content, $this->placeholders); // reset some buckets $langHolders = array(); - $langCheck = array(); - $langOnly = array(); - $jsTEXT = array(); - $scTEXT = array(); + $langCheck = array(); + $langOnly = array(); + $jsTEXT = array(); + $scTEXT = array(); // first get the Joomla .JText._() if (in_array('Joomla' . '.JText._(', $langStringTargets)) { - $jsTEXT[] = ComponentbuilderHelper::getAllBetween($content, "Joomla" . ".JText._('", "'"); - $jsTEXT[] = ComponentbuilderHelper::getAllBetween($content, 'Joomla' . '.JText._("', '"'); + $jsTEXT[] = ComponentbuilderHelper::getAllBetween( + $content, "Joomla" . ".JText._('", "'" + ); + $jsTEXT[] = ComponentbuilderHelper::getAllBetween( + $content, 'Joomla' . '.JText._("', '"' + ); // combine into one array $jsTEXT = ComponentbuilderHelper::mergeArrays($jsTEXT); // we need to add a check to insure these JavaScript lang matchup - if (ComponentbuilderHelper::checkArray($jsTEXT)) //<-- not really needed hmmm + if (ComponentbuilderHelper::checkArray( + $jsTEXT + )) //<-- not really needed hmmm { // load the JS text to mismatch array - $langCheck[] = $jsTEXT; - $this->langMismatch = ComponentbuilderHelper::mergeArrays(array($jsTEXT, $this->langMismatch)); + $langCheck[] = $jsTEXT; + $this->langMismatch = ComponentbuilderHelper::mergeArrays( + array($jsTEXT, $this->langMismatch) + ); } } // now get the JText: :script() if (in_array('JText:' . ':script(', $langStringTargets)) { - $scTEXT[] = ComponentbuilderHelper::getAllBetween($content, "JText:" . ":script('", "'"); - $scTEXT[] = ComponentbuilderHelper::getAllBetween($content, 'JText:' . ':script("', '"'); + $scTEXT[] = ComponentbuilderHelper::getAllBetween( + $content, "JText:" . ":script('", "'" + ); + $scTEXT[] = ComponentbuilderHelper::getAllBetween( + $content, 'JText:' . ':script("', '"' + ); // combine into one array $scTEXT = ComponentbuilderHelper::mergeArrays($scTEXT); // we need to add a check to insure these JavaScript lang matchup if (ComponentbuilderHelper::checkArray($scTEXT)) { // load the Script text to match array - $langCheck[] = $scTEXT; - $this->langMatch = ComponentbuilderHelper::mergeArrays(array($scTEXT, $this->langMatch)); + $langCheck[] = $scTEXT; + $this->langMatch = ComponentbuilderHelper::mergeArrays( + array($scTEXT, $this->langMatch) + ); } } // now do the little trick for JustTEXT: :_('Just uppercase text'); if (in_array('JustTEXT:' . ':_(', $langStringTargets)) { - $langOnly[] = ComponentbuilderHelper::getAllBetween($content, "JustTEXT:" . ":_('", "')"); - $langOnly[] = ComponentbuilderHelper::getAllBetween($content, 'JustTEXT:' . ':_("', '")'); + $langOnly[] = ComponentbuilderHelper::getAllBetween( + $content, "JustTEXT:" . ":_('", "')" + ); + $langOnly[] = ComponentbuilderHelper::getAllBetween( + $content, 'JustTEXT:' . ':_("', '")' + ); // merge lang only $langOnly = ComponentbuilderHelper::mergeArrays($langOnly); } @@ -4849,18 +6090,24 @@ class Get foreach ($langStringTargets as $langStringTarget) { // need some special treatment here - if ($langStringTarget === 'Joomla' . '.JText._(' || - $langStringTarget === 'JText:' . ':script(' || - $langStringTarget === 'JustTEXT:' . ':_(') + if ($langStringTarget === 'Joomla' . '.JText._(' + || $langStringTarget === 'JText:' . ':script(' + || $langStringTarget === 'JustTEXT:' . ':_(') { continue; } - $langCheck[] = ComponentbuilderHelper::getAllBetween($content, $langStringTarget . "'", "'"); - $langCheck[] = ComponentbuilderHelper::getAllBetween($content, $langStringTarget . '"', '"'); + $langCheck[] = ComponentbuilderHelper::getAllBetween( + $content, $langStringTarget . "'", "'" + ); + $langCheck[] = ComponentbuilderHelper::getAllBetween( + $content, $langStringTarget . '"', '"' + ); } // the normal loading of the language strings $langCheck = ComponentbuilderHelper::mergeArrays($langCheck); - if (ComponentbuilderHelper::checkArray($langCheck)) //<-- not really needed hmmm + if (ComponentbuilderHelper::checkArray( + $langCheck + )) //<-- not really needed hmmm { foreach ($langCheck as $string) { @@ -4874,8 +6121,12 @@ class Get { continue; } - $langHolders[$langStringTarget . "'" . $string . "'"] = $langStringTarget . "'" . $keyLang . "'"; - $langHolders[$langStringTarget . '"' . $string . '"'] = $langStringTarget . '"' . $keyLang . '"'; + $langHolders[$langStringTarget . "'" . $string + . "'"] + = $langStringTarget . "'" . $keyLang . "'"; + $langHolders[$langStringTarget . '"' . $string + . '"'] + = $langStringTarget . '"' . $keyLang . '"'; } } } @@ -4888,8 +6139,10 @@ class Get if ($keyLang = $this->setLang($string)) { // load the language targets - $langHolders["JustTEXT:" . ":_('" . $string . "')"] = "'" . $keyLang . "'"; - $langHolders['JustTEXT:' . ':_("' . $string . '")'] = '"' . $keyLang . '"'; + $langHolders["JustTEXT:" . ":_('" . $string . "')"] + = "'" . $keyLang . "'"; + $langHolders['JustTEXT:' . ':_("' . $string . '")'] + = '"' . $keyLang . '"'; } } } @@ -4899,16 +6152,17 @@ class Get $content = $this->setPlaceholders($content, $langHolders); } } + return $content; } /** * Set the language String - * - * @param string $string The plan text string (English) + * + * @param string $string The plan text string (English) * * @return string The key language string (all uppercase) - * + * */ public function setLang($string) { @@ -4918,7 +6172,9 @@ class Get return false; } // build lang key - $keyLang = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($string, 'U'); + $keyLang = $this->langPrefix . '_' . ComponentbuilderHelper::safeString( + $string, 'U' + ); // set the language string $this->setLangContent($this->lang, $keyLang, $string); @@ -4927,32 +6183,33 @@ class Get /** * Set Data Selection of the dynamic get - * - * @param string $method_key The method unique key - * @param string $view_code The code name of the view - * @param string $string The data string - * @param string $asset The asset in question - * @param string $as The as string - * @param int $row_type The row type - * @param string $type The target type (db||view) + * + * @param string $method_key The method unique key + * @param string $view_code The code name of the view + * @param string $string The data string + * @param string $asset The asset in question + * @param string $as The as string + * @param int $row_type The row type + * @param string $type The target type (db||view) * * @return array the select query - * + * */ - public function setDataSelection($method_key, $view_code, $string, $asset, $as, $row_type, $type) - { + public function setDataSelection($method_key, $view_code, $string, $asset, + $as, $row_type, $type + ) { if (ComponentbuilderHelper::checkString($string)) { if ('db' === $type) { - $table = '#__' . $asset; + $table = '#__' . $asset; $queryName = $asset; - $view = ''; + $view = ''; } elseif ('view' === $type) { - $view = $this->getViewTableName($asset); - $table = '#__' . $this->componentCodeName . '_' . $view; + $view = $this->getViewTableName($asset); + $table = '#__' . $this->componentCodeName . '_' . $view; $queryName = $view; } // just get all values from table if * is found @@ -4960,11 +6217,15 @@ class Get { if ($type == 'view') { - $_string = ComponentbuilderHelper::getViewTableColumns($asset, $as, $row_type); + $_string = ComponentbuilderHelper::getViewTableColumns( + $asset, $as, $row_type + ); } else { - $_string = ComponentbuilderHelper::getDbTableColumns($asset, $as, $row_type); + $_string = ComponentbuilderHelper::getDbTableColumns( + $asset, $as, $row_type + ); } // get only selected values $lines = explode(PHP_EOL, $_string); @@ -5000,7 +6261,11 @@ class Get $get = trim($lineArray[0]); $key = trim($lineArray[1]); // only add the view (we must adapt this) - if (isset($this->getAsLookup[$method_key][$get]) && 'a' != $as && 1 == $row_type && 'view' === $type && strpos('#' . $key, '#' . $view . '_') === false) + if (isset($this->getAsLookup[$method_key][$get]) + && 'a' != $as + && 1 == $row_type + && 'view' === $type + && strpos('#' . $key, '#' . $view . '_') === false) { // this is a problem (TODO) since we may want to not add the view name. $key = $view . '_' . trim($key); @@ -5012,13 +6277,21 @@ class Get if (ComponentbuilderHelper::checkString($key)) { $this->getAsLookup[$method_key][$get] = $key; - $keys[] = $this->db->quote($key); + $keys[] + = $this->db->quote( + $key + ); } else { - $key = str_replace($as . '.', '', $get); + $key = str_replace( + $as . '.', '', $get + ); $this->getAsLookup[$method_key][$get] = $key; - $keys[] = $this->db->quote($key); + $keys[] + = $this->db->quote( + $key + ); } // make sure we have the view name if (ComponentbuilderHelper::checkString($view)) @@ -5031,11 +6304,15 @@ class Get $this->siteFields[$view][$field] = array(); } // load to the site fields memory bucket - $this->siteFields[$view][$field][$method_key . '___' . $as] = array('site' => $view_code, 'get' => $get, 'as' => $as, 'key' => $key); + $this->siteFields[$view][$field][$method_key . '___' + . $as] + = array('site' => $view_code, 'get' => $get, + 'as' => $as, 'key' => $key); } } } - if (ComponentbuilderHelper::checkArray($gets) && ComponentbuilderHelper::checkArray($keys)) + if (ComponentbuilderHelper::checkArray($gets) + && ComponentbuilderHelper::checkArray($keys)) { // single joined selection needs the prefix to the values to avoid conflict in the names // so we must still add then AS @@ -5045,50 +6322,66 @@ class Get } else { - $querySelect = '$query->select($db->quoteName(' . PHP_EOL . $this->_t(3) . 'array(' . implode(',', $gets) . '),' . PHP_EOL . $this->_t(3) . 'array(' . implode(',', $keys) . ')));'; + $querySelect = '$query->select($db->quoteName(' + . PHP_EOL . $this->_t(3) . 'array(' . implode( + ',', $gets + ) . '),' . PHP_EOL . $this->_t(3) . 'array(' + . implode(',', $keys) . ')));'; } - $queryFrom = '$db->quoteName(' . $this->db->quote($table) . ', ' . $this->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); + return array('select' => $querySelect, + 'from' => $queryFrom, + 'name' => $queryName, 'table' => $table, + 'type' => $type, 'select_gets' => $gets, + 'select_keys' => $keys); } } } + return false; } /** * Get the View Table Name - * - * @param int $id The admin view in + * + * @param int $id The admin view in * * @return string view code name - * + * */ public function getViewTableName($id) { // Create a new query object. $query = $this->db->getQuery(true); $query->select($this->db->quoteName(array('a.name_single'))); - $query->from($this->db->quoteName('#__componentbuilder_admin_view', 'a')); + $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()); } /** * Build the SQL dump String for a view - * - * @param string $tables The tables to use in build - * @param string $view The target view/table to dump in - * @param int $view_id The id of the target view + * + * @param string $tables The tables to use in build + * @param string $view The target view/table to dump in + * @param int $view_id The id of the target view * * @return string on success with the Dump SQL - * + * */ public function buildSqlDump($tables, $view, $view_id) { // first build a query statment to get all the data (insure it must be added - check the tweaking) - if (ComponentbuilderHelper::checkArray($tables) && (!isset($this->sqlTweak[$view_id]['remove']) || !$this->sqlTweak[$view_id]['remove'])) + if (ComponentbuilderHelper::checkArray($tables) + && (!isset($this->sqlTweak[$view_id]['remove']) + || !$this->sqlTweak[$view_id]['remove'])) { $counter = 'a'; // Create a new query object. @@ -5114,23 +6407,42 @@ class Get { if (strpos($field, "=>") !== false) { - list($source, $target) = explode("=>", $field); - $sourceArray[] = $counter . '.' . trim($source); + list($source, $target) = explode( + "=>", $field + ); + $sourceArray[] = $counter . '.' . trim( + $source + ); $targetArray[] = trim($target); } } - if (ComponentbuilderHelper::checkArray($sourceArray) && ComponentbuilderHelper::checkArray($targetArray)) + if (ComponentbuilderHelper::checkArray( + $sourceArray + ) + && ComponentbuilderHelper::checkArray( + $targetArray + )) { // add to query - $query->select($this->db->quoteName($sourceArray, $targetArray)); - $query->from('#__' . $table['table'] . ' AS a'); + $query->select( + $this->db->quoteName( + $sourceArray, $targetArray + ) + ); + $query->from( + '#__' . $table['table'] . ' AS a' + ); $runQuery = true; } // we may need to filter the selection if (isset($this->sqlTweak[$view_id]['where'])) { // add to query the where filter - $query->where('a.id IN (' . $this->sqlTweak[$view_id]['where'] . ')'); + $query->where( + 'a.id IN (' + . $this->sqlTweak[$view_id]['where'] + . ')' + ); } } } @@ -5150,21 +6462,45 @@ class Get { if (strpos($field, "=>") !== false) { - list($source, $target) = explode("=>", $field); - $sourceArray[] = $counter . '.' . trim($source); + list($source, $target) = explode( + "=>", $field + ); + $sourceArray[] = $counter . '.' . trim( + $source + ); $targetArray[] = trim($target); } if (strpos($field, "==") !== false) { - list($aKey, $bKey) = explode("==", $field); + list($aKey, $bKey) = explode( + "==", $field + ); // add to query - $query->join('LEFT', $this->db->quoteName('#__' . $table['table'], $counter) . ' ON (' . $this->db->quoteName('a.' . trim($aKey)) . ' = ' . $this->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)) + if (ComponentbuilderHelper::checkArray( + $sourceArray + ) + && ComponentbuilderHelper::checkArray( + $targetArray + )) { // add to query - $query->select($this->db->quoteName($sourceArray, $targetArray)); + $query->select( + $this->db->quoteName( + $sourceArray, $targetArray + ) + ); } } } @@ -5190,9 +6526,12 @@ class Get $data = $this->db->loadObjectList(); // start building the MySql dump $dump = "--"; - $dump .= PHP_EOL . "-- Dumping data for table `#__" . $this->bbb . "component" . $this->ddd . "_" . $view . "`"; + $dump .= PHP_EOL . "-- Dumping data for table `#__" + . $this->bbb . "component" . $this->ddd . "_" . $view + . "`"; $dump .= PHP_EOL . "--"; - $dump .= PHP_EOL . PHP_EOL . "INSERT INTO `#__" . $this->bbb . "component" . $this->ddd . "_" . $view . "` ("; + $dump .= PHP_EOL . PHP_EOL . "INSERT INTO `#__" . $this->bbb + . "component" . $this->ddd . "_" . $view . "` ("; foreach ($data as $line) { $comaSet = 0; @@ -5204,7 +6543,9 @@ class Get } else { - $dump .= ", " . $this->db->quoteName($fieldName); + $dump .= ", " . $this->db->quoteName( + $fieldName + ); } $comaSet++; } @@ -5231,7 +6572,9 @@ class Get } else { - $dump .= ", " . $this->mysql_escape($fieldValue); + $dump .= ", " . $this->mysql_escape( + $fieldValue + ); } $comaSet++; } @@ -5239,21 +6582,23 @@ class Get $coma++; } $dump .= ";"; + // return build dump query return $dump; } } } + return false; } /** * Escape the values for a SQL dump - * - * @param string $value the value to escape + * + * @param string $value the value to escape * * @return string on success with escaped string - * + * */ public function mysql_escape($value) { @@ -5272,52 +6617,60 @@ class Get { return "''"; } + // if not array or string then return number return $value; } /** * Creating an uniqueCode - * - * @param string $code The planed code + * + * @param string $code The planed code * * @return string The unique code - * + * */ public function uniqueCode($code) { - if (!isset($this->uniquecodes[$this->target]) || !in_array($code, $this->uniquecodes[$this->target])) + if (!isset($this->uniquecodes[$this->target]) + || !in_array( + $code, $this->uniquecodes[$this->target] + )) { $this->uniquecodes[$this->target][] = $code; + return $code; } + // make sure it is unique return $this->uniqueCode($code . $this->uniquekey(1)); } /** * Creating an unique local key - * - * @param int $size The key size + * + * @param int $size The key size * * @return string The unique localkey - * + * */ - public function uniquekey($size, $random = false, $newBag = "vvvvvvvvvvvvvvvvvvv") - { + public function uniquekey($size, $random = false, + $newBag = "vvvvvvvvvvvvvvvvvvv" + ) { if ($random) { - $bag = "abcefghijknopqrstuwxyzABCDDEFGHIJKLLMMNOPQRSTUVVWXYZabcddefghijkllmmnopqrstuvvwxyzABCEFGHIJKNOPQRSTUWXYZ"; + $bag + = "abcefghijknopqrstuwxyzABCDDEFGHIJKLLMMNOPQRSTUVVWXYZabcddefghijkllmmnopqrstuvvwxyzABCEFGHIJKNOPQRSTUWXYZ"; } else { $bag = $newBag; } - $key = array(); + $key = array(); $bagsize = strlen($bag) - 1; for ($i = 0; $i < $size; $i++) { - $get = rand(0, $bagsize); + $get = rand(0, $bagsize); $key[] = $bag[$get]; } $key = implode($key); @@ -5326,16 +6679,17 @@ class Get $key++; } $this->uniquekeys[] = $key; + return $key; } /** * Check for footable scripts - * - * @param string $content The content to check + * + * @param string $content The content to check * * @return boolean True if found - * + * */ public function getFootableScripts($content) { @@ -5343,16 +6697,17 @@ class Get { return true; } + return false; } /** * Check for getModules script - * - * @param string $content The content to check + * + * @param string $content The content to check * * @return boolean True if found - * + * */ public function getGetModule($content) { @@ -5360,16 +6715,17 @@ class Get { return true; } + return false; } /** * Check for get Google Chart script - * - * @param string $content The content to check + * + * @param string $content The content to check * * @return boolean True if found - * + * */ public function getGoogleChart($content) { @@ -5377,42 +6733,48 @@ class Get { return true; } + return false; } /** * Set the dynamic values in strings here - * - * @param string $string The content to check - * @param int $debug The switch to debug the update - * We can now at any time debug the - * dynamic build values if it gets broken + * + * @param string $string The content to check + * @param int $debug The switch to debug the update + * We can now at any time debug the + * dynamic build values if it gets broken * * @return string - * + * */ public function setDynamicValues($string, $debug = 0) { if (ComponentbuilderHelper::checkString($string)) { - $string = $this->setLangStrings($this->setCustomCodeData($this->setExternalCodeString($string, $debug), $debug)); + $string = $this->setLangStrings( + $this->setCustomCodeData( + $this->setExternalCodeString($string, $debug), $debug + ) + ); } // if debug if ($debug) { jexit(); } + return $string; } /** * Set the external code string & load it in to string - * - * @param string $string The content to check - * @param int $debug The switch to debug the update + * + * @param string $string The content to check + * @param int $debug The switch to debug the update * * @return string - * + * */ public function setExternalCodeString($string, $debug = 0) { @@ -5427,17 +6789,24 @@ class Get } // target content $bucket = array(); - $found = ComponentbuilderHelper::getAllBetween($string, '[EXTERNA' . 'LCODE=', ']'); + $found = ComponentbuilderHelper::getAllBetween( + $string, '[EXTERNA' . 'LCODE=', ']' + ); if (ComponentbuilderHelper::checkArray($found)) { // build local bucket foreach ($found as $target) { // check if user has permission to use EXTERNAL code (we may add a custom access switch - use ADMIN for now) - if ($this->user->authorise('core.admin', 'com_componentbuilder')) + if ($this->user->authorise( + 'core.admin', 'com_componentbuilder' + )) { // check if the target is valid URL or path - if ((!filter_var($target, FILTER_VALIDATE_URL) === false && ComponentbuilderHelper::urlExists($target)) || (JPath::clean($target) === $target && JFile::exists($target))) + if ((!filter_var($target, FILTER_VALIDATE_URL) === false + && ComponentbuilderHelper::urlExists($target)) + || (JPath::clean($target) === $target + && JFile::exists($target))) { $this->getExternalCodeString($target, $bucket); } @@ -5447,8 +6816,17 @@ class Get // set key $key = '[EXTERNA' . 'LCODE=' . $target . ']'; // set the notice - $this->app->enqueueMessage(JText::_('

External Code Warning

'), 'Warning'); - $this->app->enqueueMessage(JText::sprintf('The %s is not a valid url/path!', $key), 'Warning'); + $this->app->enqueueMessage( + JText::_( + '

External Code Warning

' + ), 'Warning' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'The %s is not a valid url/path!', + $key + ), 'Warning' + ); // remove the placeholder $bucket[$key] = ''; } @@ -5458,8 +6836,16 @@ class Get // set key $key = '[EXTERNA' . 'LCODE=' . $target . ']'; // set the notice - $this->app->enqueueMessage(JText::_('

External Code Error

'), 'Error'); - $this->app->enqueueMessage(JText::sprintf('%s, you do not have permission to use EXTERNALCODE feature (so %s was removed from the compilation), please contact you system administrator for more info!
(admin access required)', $this->user->get('name'), $key), 'Error'); + $this->app->enqueueMessage( + JText::_('

External Code Error

'), + 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + '%s, you do not have permission to use EXTERNALCODE feature (so %s was removed from the compilation), please contact you system administrator for more info!
(admin access required)', + $this->user->get('name'), $key + ), 'Error' + ); // remove the placeholder $bucket[$key] = ''; } @@ -5477,17 +6863,18 @@ class Get var_dump($string); } } + return $string; } /** * Get the External Code/String - * - * @param string $string The content to check - * @param array $bucket The Placeholders bucket + * + * @param string $string The content to check + * @param array $bucket The Placeholders bucket * * @return void - * + * */ protected function getExternalCodeString($target, &$bucket) { @@ -5499,46 +6886,78 @@ class Get if (!isset($this->externalCodeString[$targetKey])) { // get the data string (code) - $this->externalCodeString[$targetKey] = ComponentbuilderHelper::getFileContents($targetKey); + $this->externalCodeString[$targetKey] + = ComponentbuilderHelper::getFileContents($targetKey); // did we get any value - if (ComponentbuilderHelper::checkString($this->externalCodeString[$targetKey])) + if (ComponentbuilderHelper::checkString( + $this->externalCodeString[$targetKey] + )) { // check for changes $liveHash = md5($this->externalCodeString[$targetKey]); // check if it exist local - if ($hash = ComponentbuilderHelper::getVar('external_code', $targetKey, 'target', 'hash')) + if ($hash = ComponentbuilderHelper::getVar( + 'external_code', $targetKey, 'target', 'hash' + )) { if ($hash !== $liveHash) { // update the hash since it changed - $object = new stdClass(); + $object = new stdClass(); $object->target = $targetKey; - $object->hash = $liveHash; + $object->hash = $liveHash; // update local hash - $this->db->updateObject('#__componentbuilder_external_code', $object, 'target'); + $this->db->updateObject( + '#__componentbuilder_external_code', $object, + 'target' + ); // give notice of the change - $this->app->enqueueMessage(JText::_('

External Code Warning

'), 'Warning'); - $this->app->enqueueMessage(JText::sprintf('The code/string from %s has been changed since the last compilation, please investigate to insure the changes are safe!', $key), 'Warning'); + $this->app->enqueueMessage( + JText::_('

External Code Warning

'), + 'Warning' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'The code/string from %s has been changed since the last compilation, please investigate to insure the changes are safe!', + $key + ), 'Warning' + ); } } else { // add the hash to track changes - $object = new stdClass(); + $object = new stdClass(); $object->target = $targetKey; - $object->hash = $liveHash; + $object->hash = $liveHash; // insert local hash - $this->db->insertObject('#__componentbuilder_external_code', $object); + $this->db->insertObject( + '#__componentbuilder_external_code', $object + ); // give notice the first time this is added - $this->app->enqueueMessage(JText::_('

External Code Notice

'), 'Notice'); - $this->app->enqueueMessage(JText::sprintf('The code/string from %s has been added for the first time, please investigate to insure the correct code/string was used!', $key), 'Notice'); + $this->app->enqueueMessage( + JText::_('

External Code Notice

'), + 'Notice' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'The code/string from %s has been added for the first time, please investigate to insure the correct code/string was used!', + $key + ), 'Notice' + ); } } else { // set notice that we could not get a valid string from the target - $this->app->enqueueMessage(JText::_('

External Code Warning

'), 'Warning'); - $this->app->enqueueMessage(JText::sprintf('The %s returned an invalid string!', $key), 'Warning'); + $this->app->enqueueMessage( + JText::_('

External Code Warning

'), 'Warning' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'The %s returned an invalid string!', $key + ), 'Warning' + ); } } // add to local bucket @@ -5550,12 +6969,12 @@ class Get /** * We start set the custom code data & can load it in to string - * - * @param string $string The content to check - * @param int $debug The switch to debug the update + * + * @param string $string The content to check + * @param int $debug The switch to debug the update * * @return string - * + * */ public function setCustomCodeData($string, $debug = 0, $not = null) { @@ -5572,7 +6991,9 @@ class Get } // the ids found in this content $bucket = array(); - $found = ComponentbuilderHelper::getAllBetween($string, '[CUSTO' . 'MCODE=', ']'); + $found = ComponentbuilderHelper::getAllBetween( + $string, '[CUSTO' . 'MCODE=', ']' + ); if (ComponentbuilderHelper::checkArray($found)) { foreach ($found as $key) @@ -5588,20 +7009,30 @@ class Get { $id = (int) $key; } - elseif (ComponentbuilderHelper::checkString($key) && strpos($key, '+') === false) + elseif (ComponentbuilderHelper::checkString($key) + && strpos( + $key, '+' + ) === false) { $getFuncName = trim($key); if (!isset($this->functionNameMemory[$getFuncName])) { - if (!$found_local = ComponentbuilderHelper::getVar('custom_code', $getFuncName, 'function_name', 'id')) + if (!$found_local = ComponentbuilderHelper::getVar( + 'custom_code', $getFuncName, 'function_name', + 'id' + )) { continue; } - $this->functionNameMemory[$getFuncName] = $found_local; + $this->functionNameMemory[$getFuncName] + = $found_local; } $id = (int) $this->functionNameMemory[$getFuncName]; } - elseif (ComponentbuilderHelper::checkString($key) && strpos($key, '+') !== false) + elseif (ComponentbuilderHelper::checkString($key) + && strpos( + $key, '+' + ) !== false) { $array = explode('+', $key); // set ID @@ -5614,11 +7045,16 @@ class Get $getFuncName = trim($array[0]); if (!isset($this->functionNameMemory[$getFuncName])) { - if (!$found_local = ComponentbuilderHelper::getVar('custom_code', $getFuncName, 'function_name', 'id')) + if (!$found_local + = ComponentbuilderHelper::getVar( + 'custom_code', $getFuncName, + 'function_name', 'id' + )) { continue; } - $this->functionNameMemory[$getFuncName] = $found_local; + $this->functionNameMemory[$getFuncName] + = $found_local; } $id = (int) $this->functionNameMemory[$getFuncName]; } @@ -5639,15 +7075,28 @@ class Get if (strpos($array[1], ',') !== false) { // update the function values with the custom code key placholdres (this allow the use of [] + and , in the values) - $this->customCodeData[$id]['args'][$key] = array_map(function($_key) { - return $this->setPlaceholders($_key, $this->customCodeKeyPlacholders); - }, (array) explode(',', $array[1])); + $this->customCodeData[$id]['args'][$key] + = array_map( + function ($_key) { + return $this->setPlaceholders( + $_key, + $this->customCodeKeyPlacholders + ); + }, (array) explode(',', $array[1]) + ); } - elseif (ComponentbuilderHelper::checkString($array[1])) + elseif (ComponentbuilderHelper::checkString( + $array[1] + )) { - $this->customCodeData[$id]['args'][$key] = array(); + $this->customCodeData[$id]['args'][$key] + = array(); // update the function values with the custom code key placholdres (this allow the use of [] + and , in the values) - $this->customCodeData[$id]['args'][$key][] = $this->setPlaceholders($array[1], $this->customCodeKeyPlacholders); + $this->customCodeData[$id]['args'][$key][] + = $this->setPlaceholders( + $array[1], + $this->customCodeKeyPlacholders + ); } } } @@ -5699,17 +7148,18 @@ class Get var_dump($string); } } + return $string; } /** * Insert the custom code into the string - * - * @param string $string The content to check - * @param int $debug The switch to debug the update + * + * @param string $string The content to check + * @param int $debug The switch to debug the update * * @return string on success - * + * */ protected function insertCustomCode($ids, $string, $debug = 0) { @@ -5717,7 +7167,9 @@ class Get // load the code foreach ($ids as $id) { - $this->buildCustomCodePlaceholders($this->customCodeMemory[$id], $code, $debug); + $this->buildCustomCodePlaceholders( + $this->customCodeMemory[$id], $code, $debug + ); } // if debug if ($debug) @@ -5727,23 +7179,27 @@ class Get echo 'Custom Code String Before Update:'; var_dump($string); } + // now update the string return $this->setPlaceholders($string, $code); } /** * Insert the custom code into the string - * - * @param string $string The content to check - * @param int $debug The switch to debug the update + * + * @param string $string The content to check + * @param int $debug The switch to debug the update * * @return string on success - * + * */ protected function buildCustomCodePlaceholders($item, &$code, $debug = 0) { // check if there is args for this code - if (isset($this->customCodeData[$item['id']]['args']) && ComponentbuilderHelper::checkArray($this->customCodeData[$item['id']]['args'])) + 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); @@ -5754,7 +7210,9 @@ class Get var_dump($placeholder); } // we have args and so need to load each - foreach ($this->customCodeData[$item['id']]['args'] as $key => $args) + foreach ( + $this->customCodeData[$item['id']]['args'] as $key => $args + ) { $this->setThesePlaceHolders('arg', $args); // if debug @@ -5763,20 +7221,27 @@ class Get echo 'Custom Code Global Placholders:'; var_dump($this->placeholders); } - $code['[CUSTOM' . 'CODE=' . $key . ']'] = $placeholder['start'] . PHP_EOL . $this->setPlaceholders($item['code'], $this->placeholders) . $placeholder['end']; + $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)) === false) + if (($keyPlaceholder = array_search( + $item['id'], $this->functionNameMemory + )) === false) { $keyPlaceholder = $item['id']; } // check what type of place holders we should load here $placeholderType = (int) $item['comment_type'] . '2'; - if (stripos($item['code'], $this->bbb . 'view') !== false || stripos($item['code'], $this->bbb . 'sview') !== false || stripos($item['code'], $this->bbb . 'arg') !== false) + if (stripos($item['code'], $this->bbb . 'view') !== false + || stripos($item['code'], $this->bbb . 'sview') !== false + || stripos($item['code'], $this->bbb . 'arg') !== false) { // if view is being set dynamicly then we can't update this code via IDE (TODO) $placeholderType = 3; @@ -5784,16 +7249,22 @@ class Get // 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']; + $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 + * + * @param string $key The main string for placeholder key + * @param array $values The values to add * * @return void */ @@ -5806,7 +7277,8 @@ class Get $number = 0; foreach ($values as $value) { - $this->placeholders[$this->bbb . $key . $number . $this->ddd] = $value; + $this->placeholders[$this->bbb . $key . $number . $this->ddd] + = $value; $number++; } } @@ -5814,8 +7286,8 @@ class Get /** * Remove a type of placeholder by main string - * - * @param string $like The main string for placeholder key + * + * @param string $like The main string for placeholder key * * @return void */ @@ -5832,7 +7304,7 @@ class Get /** * to unset stuff that are private or protected - * + * */ public function unsetNow($remove) { @@ -5841,25 +7313,39 @@ class Get /** * Get the other languages - * - * @param array $values The lang strings to get - * + * + * @param array $values The lang strings to get + * * * @return void - * + * */ public function getMultiLangStrings($values) { // Create a new query object. $query = $this->db->getQuery(true); - $query->from($this->db->quoteName('#__componentbuilder_language_translation', 'a')); + $query->from( + $this->db->quoteName( + '#__componentbuilder_language_translation', 'a' + ) + ); if (ComponentbuilderHelper::checkArray($values)) { - $query->select($this->db->quoteName(array('a.id', 'a.translation', 'a.source', 'a.components', 'a.modules', 'a.plugins', 'a.published'))); - $query->where($this->db->quoteName('a.source') . ' IN (' . implode(',', array_map(function($a) - { - return $this->db->quote($a); - }, $values)) . ')'); + $query->select( + $this->db->quoteName( + array('a.id', 'a.translation', 'a.source', 'a.components', + 'a.modules', 'a.plugins', 'a.published') + ) + ); + $query->where( + $this->db->quoteName('a.source') . ' IN (' . implode( + ',', array_map( + function ($a) { + return $this->db->quote($a); + }, $values + ) + ) . ')' + ); $this->db->setQuery($query); $this->db->execute(); if ($this->db->getNumRows()) @@ -5867,6 +7353,7 @@ class Get return $this->db->loadAssocList('source'); } } + return false; } @@ -5877,43 +7364,63 @@ class Get * @return void * */ - public function setLangPlaceholders($strings, $target_id, $target = 'components') - { + public function setLangPlaceholders($strings, int $target_id, + $target = 'components' + ) { $counterInsert = 0; $counterUpdate = 0; - $today = JFactory::getDate()->toSql(); - foreach ($this->languages[$this->langTag] as $area => $placeholders) + $today = JFactory::getDate()->toSql(); + foreach ( + $this->languages[$target][$this->langTag] as $area => $placeholders + ) { foreach ($placeholders as $placeholder => $string) { // to keep or remove $remove = false; // build the translations - if (ComponentbuilderHelper::checkString($string) && isset($this->multiLangString[$string])) + if (ComponentbuilderHelper::checkString($string) + && isset($this->multiLangString[$string])) { // make sure we have converted the string to array - if (isset($this->multiLangString[$string]['translation']) && ComponentbuilderHelper::checkJson($this->multiLangString[$string]['translation'])) + if (isset($this->multiLangString[$string]['translation']) + && ComponentbuilderHelper::checkJson( + $this->multiLangString[$string]['translation'] + )) { - $this->multiLangString[$string]['translation'] = json_decode($this->multiLangString[$string]['translation'], true); + $this->multiLangString[$string]['translation'] + = json_decode( + $this->multiLangString[$string]['translation'], true + ); } // if we have an array continue - if (isset($this->multiLangString[$string]['translation']) && ComponentbuilderHelper::checkArray($this->multiLangString[$string]['translation'])) + if (isset($this->multiLangString[$string]['translation']) + && ComponentbuilderHelper::checkArray( + $this->multiLangString[$string]['translation'] + )) { // great lets build the multi languages strings - foreach ($this->multiLangString[$string]['translation'] as $translations) + foreach ( + $this->multiLangString[$string]['translation'] as + $translations + ) { - if (isset($translations['language']) && isset($translations['translation'])) + if (isset($translations['language']) + && isset($translations['translation'])) { // build arrays - if (!isset($this->languages[$translations['language']])) + if (!isset($this->languages[$target][$translations['language']])) { - $this->languages[$translations['language']] = array(); + $this->languages[$target][$translations['language']] + = array(); } - if (!isset($this->languages[$translations['language']][$area])) + if (!isset($this->languages[$target][$translations['language']][$area])) { - $this->languages[$translations['language']][$area] = array(); + $this->languages[$target][$translations['language']][$area] + = array(); } - $this->languages[$translations['language']][$area][$placeholder] = $translations['translation']; + $this->languages[$target][$translations['language']][$area][$placeholder] + = $translations['translation']; } } } @@ -5924,20 +7431,26 @@ class Get } } // do the database management - if (ComponentbuilderHelper::checkString($string) && ($key = array_search($string, $strings)) !== false) + if (ComponentbuilderHelper::checkString($string) + && ($key = array_search($string, $strings)) !== false) { if (isset($this->multiLangString[$string])) { // update the existing placeholder in db $id = $this->multiLangString[$string]['id']; - if (ComponentbuilderHelper::checkJson($this->multiLangString[$string][$target])) + if (ComponentbuilderHelper::checkJson( + $this->multiLangString[$string][$target] + )) { - $targets = (array) json_decode($this->multiLangString[$string][$target], true); + $targets = (array) json_decode( + $this->multiLangString[$string][$target], true + ); // check if we should add the target ID if (in_array($target_id, $targets)) { - // only skip the update if the string is published and has the component ID - if ($this->multiLangString[$string]['published'] == 1) + // only skip the update if the string is published and has the target ID + if ($this->multiLangString[$string]['published'] + == 1) { continue; } @@ -5952,7 +7465,9 @@ class Get $targets = array($target_id); } // start the bucket for this lang - $this->setUpdateExistingLangStrings($id, $target, $targets, 1, $today, $counterUpdate); + $this->setUpdateExistingLangStrings( + $id, $target, $targets, 1, $today, $counterUpdate + ); $counterUpdate++; @@ -5971,14 +7486,36 @@ class Get { $this->newLangStrings[$target] = array(); } - $this->newLangStrings[$target][$counterInsert] = array(); - $this->newLangStrings[$target][$counterInsert][] = $this->db->quote(json_encode(array([$target_id]))); // 'target' - $this->newLangStrings[$target][$counterInsert][] = $this->db->quote($string); // 'source' - $this->newLangStrings[$target][$counterInsert][] = $this->db->quote(1); // 'published' - $this->newLangStrings[$target][$counterInsert][] = $this->db->quote($today); // 'created' - $this->newLangStrings[$target][$counterInsert][] = $this->db->quote((int) $this->user->id); // 'created_by' - $this->newLangStrings[$target][$counterInsert][] = $this->db->quote(1); // 'version' - $this->newLangStrings[$target][$counterInsert][] = $this->db->quote(1); // 'access' + $this->newLangStrings[$target][$counterInsert] + = array(); + $this->newLangStrings[$target][$counterInsert][] + = $this->db->quote( + json_encode(array($target_id)) + ); // 'target' + $this->newLangStrings[$target][$counterInsert][] + = $this->db->quote( + $string + ); // 'source' + $this->newLangStrings[$target][$counterInsert][] + = $this->db->quote( + 1 + ); // 'published' + $this->newLangStrings[$target][$counterInsert][] + = $this->db->quote( + $today + ); // 'created' + $this->newLangStrings[$target][$counterInsert][] + = $this->db->quote( + (int) $this->user->id + ); // 'created_by' + $this->newLangStrings[$target][$counterInsert][] + = $this->db->quote( + 1 + ); // 'version' + $this->newLangStrings[$target][$counterInsert][] + = $this->db->quote( + 1 + ); // 'access' $counterInsert++; @@ -5998,23 +7535,29 @@ class Get /** * store the language placeholders * - * @param string $target The target extention type - * @param int $when To set when to update + * @param string $target The target extention type + * @param int $when To set when to update * * @return void - * + * */ protected function setNewLangStrings($target, $when = 1) { - if (isset($this->newLangStrings[$target]) && count((array) $this->newLangStrings[$target]) >= $when) + if (isset($this->newLangStrings[$target]) + && count( + (array) $this->newLangStrings[$target] + ) >= $when) { // Create a new query object. - $query = $this->db->getQuery(true); + $query = $this->db->getQuery(true); $continue = false; // Insert columns. - $columns = array('components', 'source', 'published', 'created', 'created_by', 'version', 'access'); + $columns = array($target, 'source', 'published', 'created', + 'created_by', 'version', 'access'); // Prepare the insert query. - $query->insert($this->db->quoteName('#__componentbuilder_language_translation')); + $query->insert( + $this->db->quoteName('#__componentbuilder_language_translation') + ); $query->columns($this->db->quoteName($columns)); foreach ($this->newLangStrings[$target] as $values) { @@ -6042,11 +7585,11 @@ class Get /** * update the language placeholders - * - * @param int $when To set when to update + * + * @param int $when To set when to update * * @return void - * + * */ protected function setExistingLangStrings($when = 1) { @@ -6057,7 +7600,11 @@ class Get // Create a new query object. $query = $this->db->getQuery(true); // Prepare the update query. - $query->update($this->db->quoteName('#__componentbuilder_language_translation'))->set($values['fields'])->where($values['conditions']); + $query->update( + $this->db->quoteName( + '#__componentbuilder_language_translation' + ) + )->set($values['fields'])->where($values['conditions']); // Set the query using our newly populated query object and execute it. $this->db->setQuery($query); $this->db->execute(); @@ -6069,11 +7616,11 @@ class Get /** * Remove exiting language translation stings - * - * @param int $id To string ID to remove + * + * @param int $id To string ID to remove * * @return void - * + * */ protected function removeExitingLangString($id) { @@ -6085,7 +7632,9 @@ class Get $this->db->quoteName('id') . ' = ' . (int) $id ); - $query->delete($this->db->quoteName('#__componentbuilder_language_translation')); + $query->delete( + $this->db->quoteName('#__componentbuilder_language_translation') + ); $query->where($conditions); $this->db->setQuery($query); @@ -6094,131 +7643,191 @@ class Get /** * Function to purge the unused languge strings - * - * @param string $values the active strings + * + * @param string $values the active strings * * @return void - * + * */ - public function purgeLanuageStrings($values, $target_id, $target = 'components') - { + public function purgeLanuageStrings($values, $target_id, + $target = 'components' + ) { // the target types are - $target_types = array('components' => 'components', 'modules' => 'modules', 'plugins' => 'plugins'); - // remove the current target - unset($target_types[$target]); - // Create a new query object. - $query = $this->db->getQuery(true); - $query->from($this->db->quoteName('#__componentbuilder_language_translation', 'a')); - $query->select($this->db->quoteName(array('a.id', 'a.translation', 'a.components', 'a.modules', 'a.plugins'))); - // get all string that are not linked to this component - $query->where($this->db->quoteName('a.source') . ' NOT IN (' . implode(',', array_map(function($a) - { - return $this->db->quote($a); - }, $values)) . ')'); - $query->where($this->db->quoteName('a.published') . ' = 1'); - $this->db->setQuery($query); - $this->db->execute(); - if ($this->db->getNumRows()) + $target_types = array('components' => 'components', + 'modules' => 'modules', + 'plugins' => 'plugins'); + // make sure we only work with preset targets + if (isset($target_types[$target])) { - $counterUpdate = 0; - $otherStrings = $this->db->loadAssocList(); - $today = JFactory::getDate()->toSql(); - foreach ($otherStrings as $item) + // remove the current target + unset($target_types[$target]); + // Create a new query object. + $query = $this->db->getQuery(true); + $query->from( + $this->db->quoteName( + '#__componentbuilder_language_translation', 'a' + ) + ); + $query->select( + $this->db->quoteName( + array('a.id', 'a.translation', 'a.components', 'a.modules', + 'a.plugins') + ) + ); + // get all string that are not linked to this component + $query->where( + $this->db->quoteName('a.source') . ' NOT IN (' . implode( + ',', array_map( + function ($a) { + return $this->db->quote($a); + }, $values + ) + ) . ')' + ); + $query->where($this->db->quoteName('a.published') . ' = 1'); + $this->db->setQuery($query); + $this->db->execute(); + if ($this->db->getNumRows()) { - if (ComponentbuilderHelper::checkJson($item[$target])) + $counterUpdate = 0; + $otherStrings = $this->db->loadAssocList(); + $today = JFactory::getDate()->toSql(); + foreach ($otherStrings as $item) { - $targets = (array) json_decode($item[$target], true); - // if component is not found ignore this string, and do nothing - if (($key = array_search($target_id, $targets)) !== false) + if (ComponentbuilderHelper::checkJson($item[$target])) { - // first remove the component from the string - unset($targets[$key]); - // check if there are more components - if (ComponentbuilderHelper::checkArray($targets)) + $targets = (array) json_decode($item[$target], true); + // if component is not found ignore this string, and do nothing + if (($key = array_search($target_id, $targets)) + !== false) { - // just update the string to unlink the current component - $this->setUpdateExistingLangStrings($item['id'], $target, $targets, 1, $today, $counterUpdate); - - $counterUpdate++; - - // load to db - $this->setExistingLangStrings(50); - } - // check if this string has been worked on or is linked to other extensions - else - { - // the action (1 = remove, 2 = archive, 0 = do nothing) - $action_with_string = 1; - // now check if it is linked to other extensions - foreach($target_types as $other_target) + // first remove the component from the string + unset($targets[$key]); + // check if there are more components + if (ComponentbuilderHelper::checkArray($targets)) { - // just one linked extension type is enough to stop the search - if ($action_with_string && ComponentbuilderHelper::checkJson($item[$other_target])) + // just update the string to unlink the current component + $this->setUpdateExistingLangStrings( + $item['id'], $target, $targets, 1, $today, + $counterUpdate + ); + + $counterUpdate++; + + // load to db + $this->setExistingLangStrings(50); + } + // check if this string has been worked on or is linked to other extensions + else + { + // the action (1 = remove, 2 = archive, 0 = do nothing) + $action_with_string = 1; + // now check if it is linked to other extensions + foreach ($target_types as $other_target) { - $other_targets = (array)json_decode($item[$other_target], true); - // check if linked to other extensions - if (ComponentbuilderHelper::checkArray($other_targets)) + // just one linked extension type is enough to stop the search + if ($action_with_string + && ComponentbuilderHelper::checkJson( + $item[$other_target] + )) { - $action_with_string = 0; // do nothing + $other_targets = (array) json_decode( + $item[$other_target], true + ); + // check if linked to other extensions + if (ComponentbuilderHelper::checkArray( + $other_targets + )) + { + $action_with_string + = 0; // do nothing + } } } - } - // check we should just archive or remove string - if ($action_with_string && ComponentbuilderHelper::checkJson($item['translation'])) - { - $translation = json_decode($item['translation'], true); - if (ComponentbuilderHelper::checkArray($translation)) + // check we should just archive or remove string + if ($action_with_string + && ComponentbuilderHelper::checkJson( + $item['translation'] + )) { - // only archive the item and update the string to unlink the current component - $this->setUpdateExistingLangStrings($item['id'], $target, $targets, 2, $today, $counterUpdate); + $translation = json_decode( + $item['translation'], true + ); + if (ComponentbuilderHelper::checkArray( + $translation + )) + { + // only archive the item and update the string to unlink the current component + $this->setUpdateExistingLangStrings( + $item['id'], $target, $targets, 2, + $today, $counterUpdate + ); - $counterUpdate++; + $counterUpdate++; - // load to db - $this->setExistingLangStrings(50); + // load to db + $this->setExistingLangStrings(50); - $action_with_string = 2; // we archived it + $action_with_string + = 2; // we archived it + } + } + // remove the string since no translation found and not linked to any other extensions + if ($action_with_string == 1) + { + $this->removeExitingLangString($item['id']); } - } - // remove the string since no translation found and not linked to any other extensions - if ($action_with_string == 1) - { - $this->removeExitingLangString($item['id']); } } } } + // load to db + $this->setExistingLangStrings(); } - // load to db - $this->setExistingLangStrings(); } } /** * just to add lang string to the existing Lang Strings array - * + * * @return void - * + * */ - protected function setUpdateExistingLangStrings($id, $target, $targets, $published, $today, $counterUpdate) - { + protected function setUpdateExistingLangStrings($id, $target, $targets, + $published, $today, $counterUpdate + ) { // start the bucket for this lang - $this->existingLangStrings[$counterUpdate] = array(); - $this->existingLangStrings[$counterUpdate]['id'] = (int) $id; + $this->existingLangStrings[$counterUpdate] = array(); + $this->existingLangStrings[$counterUpdate]['id'] = (int) $id; $this->existingLangStrings[$counterUpdate]['conditions'] = array(); - $this->existingLangStrings[$counterUpdate]['conditions'][] = $this->db->quoteName('id') . ' = ' . $this->db->quote($id); - $this->existingLangStrings[$counterUpdate]['fields'] = array(); - $this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName($target) . ' = ' . $this->db->quote(json_encode($targets)); - $this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName('published') . ' = ' . $this->db->quote($published); - $this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName('modified') . ' = ' . $this->db->quote($today); - $this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName('modified_by') . ' = ' . $this->db->quote((int) $this->user->id); + $this->existingLangStrings[$counterUpdate]['conditions'][] + = $this->db->quoteName( + 'id' + ) . ' = ' . $this->db->quote($id); + $this->existingLangStrings[$counterUpdate]['fields'] = array(); + $this->existingLangStrings[$counterUpdate]['fields'][] + = $this->db->quoteName( + $target + ) . ' = ' . $this->db->quote(json_encode($targets)); + $this->existingLangStrings[$counterUpdate]['fields'][] + = $this->db->quoteName( + 'published' + ) . ' = ' . $this->db->quote($published); + $this->existingLangStrings[$counterUpdate]['fields'][] + = $this->db->quoteName( + 'modified' + ) . ' = ' . $this->db->quote($today); + $this->existingLangStrings[$counterUpdate]['fields'][] + = $this->db->quoteName( + 'modified_by' + ) . ' = ' . $this->db->quote((int) $this->user->id); } /** * get the custom code from the system - * + * * @return void - * + * */ public function getCustomCode($ids = null, $setLang = true, $debug = 0) { @@ -6226,14 +7835,26 @@ class Get $loadInMemory = false; // Create a new query object. $query = $this->db->getQuery(true); - $query->from($this->db->quoteName('#__componentbuilder_custom_code', 'a')); + $query->from( + $this->db->quoteName('#__componentbuilder_custom_code', 'a') + ); if (ComponentbuilderHelper::checkArray($ids)) { if ($idArray = $this->checkCustomCodeMemory($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 + $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 @@ -6244,10 +7865,23 @@ class Get } else { - $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 + $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' + ); // <--- insure we always add code from top of file // reset custom code $this->customCode = array(); } @@ -6262,30 +7896,45 @@ class Get { $customCode['code'] = base64_decode($customCode['code']); // always insure that the external code is loaded - $customCode['code'] = $this->setExternalCodeString($customCode['code']); + $customCode['code'] = $this->setExternalCodeString( + $customCode['code'] + ); // set the lang only if needed if ($setLang) { - $customCode['code'] = $this->setLangStrings($customCode['code']); + $customCode['code'] = $this->setLangStrings( + $customCode['code'] + ); } // check for more custom code (since this is a custom code placeholder) else { - $customCode['code'] = $this->setCustomCodeData($customCode['code'], $debug, $nr); + $customCode['code'] = $this->setCustomCodeData( + $customCode['code'], $debug, $nr + ); } // build the hash array if (isset($customCode['hashtarget'])) { - $customCode['hashtarget'] = explode("__", $customCode['hashtarget']); + $customCode['hashtarget'] = explode( + "__", $customCode['hashtarget'] + ); // is this a replace code, set end has array - if ($customCode['type'] == 1 && strpos($customCode['hashendtarget'], '__') !== false) + if ($customCode['type'] == 1 + && strpos( + $customCode['hashendtarget'], '__' + ) !== false) { - $customCode['hashendtarget'] = explode("__", $customCode['hashendtarget']); + $customCode['hashendtarget'] = explode( + "__", $customCode['hashendtarget'] + ); // NOW see if this is an end of page target (TODO not sure if the string is always d41d8cd98f00b204e9800998ecf8427e) // I know this fix is not air-tight, but it should work as the value of an empty line when md5'ed is ^^^^ // Then if the line number is only >>>one<<< it is almost always end of the page. // So I am using those two values to detect end of page replace ending, to avoid mismatching the ending target hash. - if ($customCode['hashendtarget'][0] == 1 && 'd41d8cd98f00b204e9800998ecf8427e' === $customCode['hashendtarget'][1]) + if ($customCode['hashendtarget'][0] == 1 + && 'd41d8cd98f00b204e9800998ecf8427e' + === $customCode['hashendtarget'][1]) { // unset since this will force the replacement unto end of page. unset($customCode['hashendtarget']); @@ -6299,8 +7948,10 @@ class Get $this->customCodeMemory = $this->customCodeMemory + $bucket; } $this->customCode = array_merge($this->customCode, $bucket); + return true; } + return false; } @@ -6339,18 +7990,26 @@ class Get // get the module data $module = $this->db->loadObject(); // update the name if it has dynamic values - $module->name = $this->setPlaceholders($this->setDynamicValues($module->name), $this->globalPlaceholders); + $module->name = $this->setPlaceholders( + $this->setDynamicValues($module->name), + $this->globalPlaceholders + ); // set safe class function name - $module->code_name = ComponentbuilderHelper::safeClassFunctionName($module->name); + $module->code_name + = ComponentbuilderHelper::safeClassFunctionName( + $module->name + ); // set module folder name $module->folder_name = 'mod_' . strtolower($module->code_name); // set the lang key - $this->langKeys[strtoupper($module->folder_name)] = $module->id . '_M0dU|3'; + $this->langKeys[strtoupper($module->folder_name)] = $module->id + . '_M0dU|3'; // return the path if ($module->target == 2) { // administrator client area - return JPATH_ADMINISTRATOR . '/modules/' . $module->folder_name; + return JPATH_ADMINISTRATOR . '/modules/' + . $module->folder_name; } else { @@ -6359,6 +8018,7 @@ class Get } } } + return false; } @@ -6370,30 +8030,40 @@ class Get */ protected function getModuleIDs() { - if (($addjoomla_modules = ComponentbuilderHelper::getVar('component_modules', $this->componentID, 'joomla_component', 'addjoomla_modules')) !== false) + if (($addjoomla_modules = ComponentbuilderHelper::getVar( + 'component_modules', $this->componentID, 'joomla_component', + 'addjoomla_modules' + )) !== false) { - $addjoomla_modules = (ComponentbuilderHelper::checkJson($addjoomla_modules)) ? json_decode($addjoomla_modules, true) : null; + $addjoomla_modules = (ComponentbuilderHelper::checkJson( + $addjoomla_modules + )) ? json_decode($addjoomla_modules, true) : null; if (ComponentbuilderHelper::checkArray($addjoomla_modules)) { $joomla_modules = array_filter( array_values($addjoomla_modules), - function($array){ + function ($array) { // only load the modules whose target association call for it if (!isset($array['target']) || $array['target'] != 2) { return true; } + return false; - }); + } + ); // if we have values we return IDs if (ComponentbuilderHelper::checkArray($joomla_modules)) { - return array_map(function($array){ - return (int) $array['module']; - }, $joomla_modules); + return array_map( + function ($array) { + return (int) $array['module']; + }, $joomla_modules + ); } } } + return false; } @@ -6438,8 +8108,18 @@ class Get ); // from these tables $query->from('#__componentbuilder_joomla_module AS a'); - $query->join('LEFT', $this->db->quoteName('#__componentbuilder_joomla_module_updates', 'u') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('u.joomla_module') . ')'); - $query->join('LEFT', $this->db->quoteName('#__componentbuilder_joomla_module_files_folders_urls', 'f') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('f.joomla_module') . ')'); + $query->join( + 'LEFT', $this->db->quoteName( + '#__componentbuilder_joomla_module_updates', 'u' + ) . ' ON (' . $this->db->quoteName('a.id') . ' = ' + . $this->db->quoteName('u.joomla_module') . ')' + ); + $query->join( + 'LEFT', $this->db->quoteName( + '#__componentbuilder_joomla_module_files_folders_urls', 'f' + ) . ' ON (' . $this->db->quoteName('a.id') . ' = ' + . $this->db->quoteName('f.joomla_module') . ')' + ); $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); $query->where($this->db->quoteName('a.published') . ' >= 1'); $this->db->setQuery($query); @@ -6449,15 +8129,15 @@ class Get // get the module data $module = $this->db->loadObject(); // tweak system to set stuff to the module domain - $_backup_target = $this->target; - $_backup_lang = $this->lang; + $_backup_target = $this->target; + $_backup_lang = $this->lang; $_backup_langPrefix = $this->langPrefix; // set some keys $module->target_type = 'M0dU|3'; - $module->key = $module->id . '_' . $module->target_type; + $module->key = $module->id . '_' . $module->target_type; // update to point to module $this->target = $module->key; - $this->lang = $module->key; + $this->lang = $module->key; // set version if not set if (empty($module->module_version)) { @@ -6475,54 +8155,108 @@ class Get } unset($module->target); // set GUI mapper - $guiMapper = array( 'table' => 'joomla_module', 'id' => (int) $id, 'type' => 'php'); + $guiMapper = array('table' => 'joomla_module', + 'id' => (int) $id, 'type' => 'php'); // update the name if it has dynamic values - $module->name = $this->setPlaceholders($this->setDynamicValues($module->name), $this->placeholders); + $module->name = $this->setPlaceholders( + $this->setDynamicValues($module->name), $this->placeholders + ); // set safe class function name - $module->code_name = ComponentbuilderHelper::safeClassFunctionName($module->name); + $module->code_name + = ComponentbuilderHelper::safeClassFunctionName( + $module->name + ); // set official name - $module->official_name = ComponentbuilderHelper::safeString($module->name, 'W'); + $module->official_name = ComponentbuilderHelper::safeString( + $module->name, 'W' + ); // set langPrefix $this->langPrefix = 'MOD_' . strtoupper($module->code_name); // set lang prefix $module->lang_prefix = $this->langPrefix; // set module class name - $module->class_helper_name = 'Mod' . ucfirst($module->code_name) . 'Helper'; - $module->class_data_name = 'Mod' . ucfirst($module->code_name) . 'Data'; - // set module install class name - $module->installer_class_name = 'mod_' . ucfirst($module->code_name) . 'InstallerScript'; + $module->class_helper_name = 'Mod' . ucfirst($module->code_name) + . 'Helper'; + $module->class_data_name = 'Mod' . ucfirst($module->code_name) + . 'Data'; + // set module install class name + $module->installer_class_name = 'mod_' . ucfirst( + $module->code_name + ) . 'InstallerScript'; // set module folder name $module->folder_name = 'mod_' . strtolower($module->code_name); // set the zip name - $module->zip_name = $module->folder_name . '_v' . str_replace('.', '_', $module->module_version). '__J' . $this->joomlaVersion; + $module->zip_name = $module->folder_name . '_v' . str_replace( + '.', '_', $module->module_version + ) . '__J' . $this->joomlaVersion; // set module file name $module->file_name = $module->folder_name; + // set module context + $module->context = $module->file_name . '.' . $module->id; // set official_name lang strings - $this->setLangContent($module->key, $this->langPrefix, $module->official_name); + $this->setLangContent( + $module->key, $this->langPrefix, $module->official_name + ); // set some placeholder for this module - $this->placeholders[$this->bbb . 'Module_name' . $this->ddd] = $module->official_name; - $this->placeholders[$this->bbb . 'Module' . $this->ddd] = ucfirst($module->code_name); - $this->placeholders[$this->bbb . 'module' . $this->ddd] = strtolower($module->code_name); - $this->placeholders[$this->bbb . 'module.version' . $this->ddd] = $module->module_version; - $this->placeholders[$this->bbb . 'module_version' . $this->ddd] = str_replace('.', '_', $module->module_version); + $this->placeholders[$this->bbb . 'Module_name' . $this->ddd] + = $module->official_name; + $this->placeholders[$this->bbb . 'Module' . $this->ddd] + = ucfirst( + $module->code_name + ); + $this->placeholders[$this->bbb . 'module' . $this->ddd] + = strtolower( + $module->code_name + ); + $this->placeholders[$this->bbb . 'module.version' . $this->ddd] + = $module->module_version; + $this->placeholders[$this->bbb . 'module_version' . $this->ddd] + = str_replace( + '.', '_', $module->module_version + ); // set description (TODO) add description field to module - if (!isset($module->description) || !ComponentbuilderHelper::checkString($module->description)) + if (!isset($module->description) + || !ComponentbuilderHelper::checkString( + $module->description + )) { $module->description = ''; } else { - $module->description = $this->setPlaceholders($this->setDynamicValues($module->description), $this->placeholders); - $this->setLangContent($module->key, $module->lang_prefix . '_DESCRIPTION', $module->description); - $module->description = '

' . $module->description . '

'; + $module->description = $this->setPlaceholders( + $this->setDynamicValues($module->description), + $this->placeholders + ); + $this->setLangContent( + $module->key, $module->lang_prefix . '_DESCRIPTION', + $module->description + ); + $module->description = '

' . $module->description + . '

'; } - $module->xml_description = "

" . $module->official_name . " (v." . $module->module_version . ")

" . $module->description . "

Created by " . trim(JFilterOutput::cleanText($component->author)) . "
Development started " . JFactory::getDate($module->created)->format("jS F, Y") . "

"; + $module->xml_description = "

" . $module->official_name + . " (v." . $module->module_version + . ")

" + . $module->description . "

Created by " . trim( + JFilterOutput::cleanText($component->author) + ) . "
Development started " + . JFactory::getDate($module->created)->format("jS F, Y") + . "

"; // set xml description - $this->setLangContent($module->key, $module->lang_prefix . '_XML_DESCRIPTION', $module->xml_description); + $this->setLangContent( + $module->key, $module->lang_prefix . '_XML_DESCRIPTION', + $module->xml_description + ); // update the readme if set if ($module->addreadme == 1 && !empty($module->readme)) { - $module->readme = $this->setPlaceholders($this->setDynamicValues(base64_decode($module->readme)), $this->placeholders); + $module->readme = $this->setPlaceholders( + $this->setDynamicValues(base64_decode($module->readme)), + $this->placeholders + ); } else { @@ -6530,38 +8264,59 @@ class Get unset($module->readme); } // get the custom_get - $module->custom_get = (isset($module->custom_get) && ComponentbuilderHelper::checkJson($module->custom_get)) ? json_decode($module->custom_get, true) : null; + $module->custom_get = (isset($module->custom_get) + && ComponentbuilderHelper::checkJson($module->custom_get)) + ? json_decode($module->custom_get, true) : null; if (ComponentbuilderHelper::checkArray($module->custom_get)) { - $module->custom_get = $this->setGetData($module->custom_get, $module->key, $module->key); + $module->custom_get = $this->setGetData( + $module->custom_get, $module->key, $module->key + ); } else { $module->custom_get = false; } // set helper class details - if ($module->add_class_helper >= 1 && ComponentbuilderHelper::checkString($module->class_helper_code)) + if ($module->add_class_helper >= 1 + && ComponentbuilderHelper::checkString( + $module->class_helper_code + )) { - if ($module->add_class_helper_header == 1 && ComponentbuilderHelper::checkString($module->class_helper_header)) + if ($module->add_class_helper_header == 1 + && ComponentbuilderHelper::checkString( + $module->class_helper_header + )) { // set GUI mapper field $guiMapper['field'] = 'class_helper_header'; // base64 Decode code - $module->class_helper_header = PHP_EOL . $this->setGuiCodePlaceholder( - $this->setPlaceholders($this->setDynamicValues(base64_decode($module->class_helper_header)), $this->placeholders), - $guiMapper - ) . PHP_EOL; + $module->class_helper_header = PHP_EOL + . $this->setGuiCodePlaceholder( + $this->setPlaceholders( + $this->setDynamicValues( + base64_decode( + $module->class_helper_header + ) + ), $this->placeholders + ), + $guiMapper + ) . PHP_EOL; } else { $module->add_class_helper_header = 0; - $module->class_helper_header = ''; + $module->class_helper_header = ''; } // set GUI mapper field $guiMapper['field'] = 'class_helper_code'; // base64 Decode code $module->class_helper_code = $this->setGuiCodePlaceholder( - $this->setPlaceholders($this->setDynamicValues(base64_decode($module->class_helper_code)), $this->placeholders), + $this->setPlaceholders( + $this->setDynamicValues( + base64_decode($module->class_helper_code) + ), $this->placeholders + ), $guiMapper ); // set class type @@ -6576,34 +8331,50 @@ class Get } else { - $module->add_class_helper = 0; - $module->class_helper_code = ''; + $module->add_class_helper = 0; + $module->class_helper_code = ''; $module->class_helper_header = ''; } // base64 Decode mod_code - if (isset($module->mod_code) && ComponentbuilderHelper::checkString($module->mod_code)) + if (isset($module->mod_code) + && ComponentbuilderHelper::checkString($module->mod_code)) { // set GUI mapper field $guiMapper['field'] = 'mod_code'; - $module->mod_code = $this->setGuiCodePlaceholder( - $this->setPlaceholders($this->setDynamicValues(base64_decode($module->mod_code)), $this->placeholders), + $module->mod_code = $this->setGuiCodePlaceholder( + $this->setPlaceholders( + $this->setDynamicValues( + base64_decode($module->mod_code) + ), $this->placeholders + ), $guiMapper ); } else { $module->mod_code = "// get the module class sfx"; - $module->mod_code .= PHP_EOL . "\$moduleclass_sfx = htmlspecialchars(\$params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');"; + $module->mod_code .= PHP_EOL + . "\$moduleclass_sfx = htmlspecialchars(\$params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');"; $module->mod_code .= PHP_EOL . "// load the default Tmpl"; - $module->mod_code .= PHP_EOL . "require JModuleHelper::getLayoutPath('mod_" . strtolower($module->code_name) . "', \$params->get('layout', 'default'));"; + $module->mod_code .= PHP_EOL + . "require JModuleHelper::getLayoutPath('mod_" + . strtolower($module->code_name) + . "', \$params->get('layout', 'default'));"; } // base64 Decode default header - if (isset($module->default_header) && ComponentbuilderHelper::checkString($module->default_header)) + if (isset($module->default_header) + && ComponentbuilderHelper::checkString( + $module->default_header + )) { // set GUI mapper field - $guiMapper['field'] = 'default_header'; + $guiMapper['field'] = 'default_header'; $module->default_header = $this->setGuiCodePlaceholder( - $this->setPlaceholders($this->setDynamicValues(base64_decode($module->default_header)), $this->placeholders), + $this->setPlaceholders( + $this->setDynamicValues( + base64_decode($module->default_header) + ), $this->placeholders + ), $guiMapper ); } @@ -6612,13 +8383,18 @@ class Get $module->default_header = ''; } // base64 Decode default - if (isset($module->default) && ComponentbuilderHelper::checkString($module->default)) + if (isset($module->default) + && ComponentbuilderHelper::checkString($module->default)) { // set GUI mapper field $guiMapper['field'] = 'default'; - $guiMapper['type'] = 'html'; - $module->default = $this->setGuiCodePlaceholder( - $this->setPlaceholders($this->setDynamicValues(base64_decode($module->default)), $this->placeholders), + $guiMapper['type'] = 'html'; + $module->default = $this->setGuiCodePlaceholder( + $this->setPlaceholders( + $this->setDynamicValues( + base64_decode($module->default) + ), $this->placeholders + ), $guiMapper ); } @@ -6629,38 +8405,57 @@ class Get // start the config array $module->config_fields = array(); // create the form arrays - $module->form_files = array(); + $module->form_files = array(); $module->fieldsets_label = array(); $module->fieldsets_paths = array(); // set global fields rule to default component path $module->fields_rules_paths = 1; // set the fields data - $module->fields = (isset($module->fields) && ComponentbuilderHelper::checkJson($module->fields)) ? json_decode($module->fields, true) : null; + $module->fields = (isset($module->fields) + && ComponentbuilderHelper::checkJson($module->fields)) + ? json_decode($module->fields, true) : null; if (ComponentbuilderHelper::checkArray($module->fields)) { // ket global key - $key = $module->key; - $dynamic_fields = array('fieldset' => 'basic', 'fields_name' => 'params', 'file' => 'config'); + $key = $module->key; + $dynamic_fields = array('fieldset' => 'basic', + 'fields_name' => 'params', + 'file' => 'config'); foreach ($module->fields as $n => &$form) { - if (isset($form['fields']) && ComponentbuilderHelper::checkArray($form['fields'])) + if (isset($form['fields']) + && ComponentbuilderHelper::checkArray( + $form['fields'] + )) { // make sure the dynamic_field is set to dynamic_value by default - foreach ($dynamic_fields as $dynamic_field => $dynamic_value) + foreach ( + $dynamic_fields as $dynamic_field => + $dynamic_value + ) { - if (!isset($form[$dynamic_field]) || !ComponentbuilderHelper::checkString($form[$dynamic_field])) + if (!isset($form[$dynamic_field]) + || !ComponentbuilderHelper::checkString( + $form[$dynamic_field] + )) { $form[$dynamic_field] = $dynamic_value; } else { - if ('fields_name' === $dynamic_field && strpos($form[$dynamic_field], '.') !== false) + if ('fields_name' === $dynamic_field + && strpos($form[$dynamic_field], '.') + !== false) { - $form[$dynamic_field] = $form[$dynamic_field]; + $form[$dynamic_field] + = $form[$dynamic_field]; } else { - $form[$dynamic_field] = ComponentbuilderHelper::safeString($form[$dynamic_field]); + $form[$dynamic_field] + = ComponentbuilderHelper::safeString( + $form[$dynamic_field] + ); } } } @@ -6668,73 +8463,109 @@ class Get if (!isset($form['module']) || $form['module'] != 1) { // now build the form key - $unique = $form['file'] . $form['fields_name'] . $form['fieldset']; + $unique = $form['file'] . $form['fields_name'] + . $form['fieldset']; } else { // now build the form key - $unique = $form['fields_name'] . $form['fieldset']; + $unique = $form['fields_name'] + . $form['fieldset']; } // set global fields rule path switchs - if ($module->fields_rules_paths == 1 && isset($form['fields_rules_paths']) && $form['fields_rules_paths'] == 2) + if ($module->fields_rules_paths == 1 + && isset($form['fields_rules_paths']) + && $form['fields_rules_paths'] == 2) { $module->fields_rules_paths = 2; } // set where to path is pointing - $module->fieldsets_paths[$unique] = $form['fields_rules_paths']; + $module->fieldsets_paths[$unique] + = $form['fields_rules_paths']; // add the label if set to lang - if (isset($form['label']) && ComponentbuilderHelper::checkString($form['label'])) + if (isset($form['label']) + && ComponentbuilderHelper::checkString( + $form['label'] + )) { - $module->fieldsets_label[$unique] = $this->setLang($form['label']); + $module->fieldsets_label[$unique] + = $this->setLang($form['label']); } // build the fields - $form['fields'] = array_map(function($field) use ($key, $unique){ - // make sure the alias and title is 0 - $field['alias'] = 0; - $field['title'] = 0; - // set the field details - $this->setFieldDetails($field, $key, $key, $unique); - // update the default if set - if (ComponentbuilderHelper::checkString($field['custom_value']) && isset($field['settings'])) - { - if (($old_default = ComponentbuilderHelper::getBetween($field['settings']->xml, 'default="', '"', false)) !== false) + $form['fields'] = array_map( + function ($field) use ($key, $unique) { + // make sure the alias and title is 0 + $field['alias'] = 0; + $field['title'] = 0; + // set the field details + $this->setFieldDetails( + $field, $key, $key, $unique + ); + // update the default if set + if (ComponentbuilderHelper::checkString( + $field['custom_value'] + ) + && isset($field['settings'])) { - // replace old default - $field['settings']->xml = str_replace('default="' . $old_default . '"', 'default="' . $field['custom_value'] . '"', $field['settings']->xml); + if (($old_default + = ComponentbuilderHelper::getBetween( + $field['settings']->xml, + 'default="', '"', false + )) !== false) + { + // replace old default + $field['settings']->xml + = str_replace( + 'default="' . $old_default + . '"', 'default="' + . $field['custom_value'] . '"', + $field['settings']->xml + ); + } + else + { + // add the default (hmmm not ideal but okay it should work) + $field['settings']->xml + = 'default="' + . $field['custom_value'] . '" ' + . $field['settings']->xml; + } } - else - { - // add the default (hmmm not ideal but okay it should work) - $field['settings']->xml = 'default="' . $field['custom_value'] . '" ' . $field['settings']->xml; - } - } - unset($field['custom_value']); - // return field - return $field; - }, array_values($form['fields'])); + unset($field['custom_value']); + + // return field + return $field; + }, array_values($form['fields']) + ); // check if field is external form file if (!isset($form['module']) || $form['module'] != 1) { // load the form file if (!isset($module->form_files[$form['file']])) { - $module->form_files[$form['file']] = array(); + $module->form_files[$form['file']] + = array(); } if (!isset($module->form_files[$form['file']][$form['fields_name']])) { - $module->form_files[$form['file']][$form['fields_name']] = array(); + $module->form_files[$form['file']][$form['fields_name']] + = array(); } if (!isset($module->form_files[$form['file']][$form['fields_name']][$form['fieldset']])) { - $module->form_files[$form['file']][$form['fields_name']][$form['fieldset']] = array(); + $module->form_files[$form['file']][$form['fields_name']][$form['fieldset']] + = array(); } // do some house cleaning (for fields) foreach ($form['fields'] as $field) { // so first we lock the field name in - $this->getFieldName($field, $module->key, $unique); + $this->getFieldName( + $field, $module->key, $unique + ); // add the fields to the global form file builder - $module->form_files[$form['file']][$form['fields_name']][$form['fieldset']][] = $field; + $module->form_files[$form['file']][$form['fields_name']][$form['fieldset']][] + = $field; } // remove form unset($module->fields[$n]); @@ -6744,19 +8575,24 @@ class Get // load the config form if (!isset($module->config_fields[$form['fields_name']])) { - $module->config_fields[$form['fields_name']] = array(); + $module->config_fields[$form['fields_name']] + = array(); } if (!isset($module->config_fields[$form['fields_name']][$form['fieldset']])) { - $module->config_fields[$form['fields_name']][$form['fieldset']] = array(); + $module->config_fields[$form['fields_name']][$form['fieldset']] + = array(); } // do some house cleaning (for fields) foreach ($form['fields'] as $field) { // so first we lock the field name in - $this->getFieldName($field, $module->key, $unique); + $this->getFieldName( + $field, $module->key, $unique + ); // add the fields to the config builder - $module->config_fields[$form['fields_name']][$form['fieldset']][] = $field; + $module->config_fields[$form['fields_name']][$form['fieldset']][] + = $field; } // remove form unset($module->fields[$n]); @@ -6770,14 +8606,29 @@ class Get } unset($module->fields); // set the add targets - $addArray = array('files' => 'files', 'folders' => 'folders', 'urls' => 'urls', 'filesfullpath' => 'files', 'foldersfullpath' => 'folders'); + $addArray = array('files' => 'files', + 'folders' => 'folders', + 'urls' => 'urls', + 'filesfullpath' => 'files', + 'foldersfullpath' => 'folders'); foreach ($addArray as $addTarget => $targetHere) { // set the add target data - $module->{'add' . $addTarget} = (isset($module->{'add' . $addTarget}) && ComponentbuilderHelper::checkJson($module->{'add' . $addTarget})) ? json_decode($module->{'add' . $addTarget}, true) : null; - if (ComponentbuilderHelper::checkArray($module->{'add' . $addTarget})) + $module->{'add' . $addTarget} = (isset( + $module->{'add' . $addTarget} + ) + && ComponentbuilderHelper::checkJson( + $module->{'add' . $addTarget} + )) ? json_decode($module->{'add' . $addTarget}, true) + : null; + if (ComponentbuilderHelper::checkArray( + $module->{'add' . $addTarget} + )) { - if (isset($module->{$targetHere}) && ComponentbuilderHelper::checkArray($module->{$targetHere})) + if (isset($module->{$targetHere}) + && ComponentbuilderHelper::checkArray( + $module->{$targetHere} + )) { foreach ($module->{'add' . $addTarget} as $taget) { @@ -6786,7 +8637,9 @@ class Get } else { - $module->{$targetHere} = array_values($module->{'add' . $addTarget}); + $module->{$targetHere} = array_values( + $module->{'add' . $addTarget} + ); } } unset($module->{'add' . $addTarget}); @@ -6798,7 +8651,8 @@ class Get } if (!isset($this->libManager[$this->target][$module->code_name])) { - $this->libManager[$this->target][$module->code_name] = array(); + $this->libManager[$this->target][$module->code_name] + = array(); } // make sure json become array if (ComponentbuilderHelper::checkJson($module->libraries)) @@ -6814,32 +8668,55 @@ class Get { if ($this->getMediaLibrary((int) $library)) { - $this->libManager[$this->target][$module->code_name][(int) $library] = true; + $this->libManager[$this->target][$module->code_name][(int) $library] + = true; } } } } - elseif (is_numeric($module->libraries) && !isset($this->libManager[$this->target][$module->code_name][(int) $module->libraries])) + elseif (is_numeric($module->libraries) + && !isset($this->libManager[$this->target][$module->code_name][(int) $module->libraries])) { if ($this->getMediaLibrary((int) $module->libraries)) { - $this->libManager[$this->target][$module->code_name][(int) $module->libraries] = true; + $this->libManager[$this->target][$module->code_name][(int) $module->libraries] + = true; } } // add PHP in module install $module->add_install_script = false; - $addScriptMethods = array('php_preflight', 'php_postflight', 'php_method'); - $addScriptTypes = array('install', 'update', 'uninstall'); + $addScriptMethods = array('php_preflight', + 'php_postflight', + 'php_method'); + $addScriptTypes = array('install', 'update', + 'uninstall'); foreach ($addScriptMethods as $scriptMethod) { foreach ($addScriptTypes as $scriptType) { - if (isset($module->{'add_' . $scriptMethod . '_' . $scriptType}) && $module->{'add_' . $scriptMethod . '_' . $scriptType} == 1 && ComponentbuilderHelper::checkString($module->{$scriptMethod . '_' . $scriptType})) + if (isset( + $module->{'add_' . $scriptMethod . '_' + . $scriptType} + ) + && $module->{'add_' . $scriptMethod . '_' + . $scriptType} == 1 + && ComponentbuilderHelper::checkString( + $module->{$scriptMethod . '_' . $scriptType} + )) { // set GUI mapper field - $guiMapper['field'] = $scriptMethod . '_' . $scriptType; - $module->{$scriptMethod . '_' . $scriptType} = $this->setGuiCodePlaceholder( - $this->setPlaceholders($this->setDynamicValues(base64_decode($module->{$scriptMethod . '_' . $scriptType})), $this->placeholders), + $guiMapper['field'] = $scriptMethod . '_' + . $scriptType; + $module->{$scriptMethod . '_' . $scriptType} + = $this->setGuiCodePlaceholder( + $this->setPlaceholders( + $this->setDynamicValues( + base64_decode( + $module->{$scriptMethod . '_' + . $scriptType} + ) + ), $this->placeholders + ), $guiMapper ); $module->add_install_script = true; @@ -6847,14 +8724,20 @@ class Get else { unset($module->{$scriptMethod . '_' . $scriptType}); - $module->{'add_' . $scriptMethod . '_' . $scriptType} = 0; + $module->{'add_' . $scriptMethod . '_' + . $scriptType} + = 0; } } } // add_sql - if ($module->add_sql == 1 && ComponentbuilderHelper::checkString($module->sql)) + if ($module->add_sql == 1 + && ComponentbuilderHelper::checkString($module->sql)) { - $module->sql = $this->setPlaceholders($this->setDynamicValues(base64_decode($module->sql)), $this->placeholders); + $module->sql = $this->setPlaceholders( + $this->setDynamicValues(base64_decode($module->sql)), + $this->placeholders + ); } else { @@ -6862,9 +8745,16 @@ class Get $module->add_sql = 0; } // add_sql_uninstall - if ($module->add_sql_uninstall == 1 && ComponentbuilderHelper::checkString($module->sql_uninstall)) + if ($module->add_sql_uninstall == 1 + && ComponentbuilderHelper::checkString( + $module->sql_uninstall + )) { - $module->sql_uninstall = $this->setPlaceholders($this->setDynamicValues(base64_decode($module->sql_uninstall)), $this->placeholders); + $module->sql_uninstall = $this->setPlaceholders( + $this->setDynamicValues( + base64_decode($module->sql_uninstall) + ), $this->placeholders + ); } else { @@ -6872,18 +8762,31 @@ class Get $module->add_sql_uninstall = 0; } // update the URL of the update_server if set - if ($module->add_update_server == 1 && ComponentbuilderHelper::checkString($module->update_server_url)) + if ($module->add_update_server == 1 + && ComponentbuilderHelper::checkString( + $module->update_server_url + )) { - $module->update_server_url = $this->setPlaceholders($this->setDynamicValues($module->update_server_url), $this->placeholders); + $module->update_server_url = $this->setPlaceholders( + $this->setDynamicValues($module->update_server_url), + $this->placeholders + ); } // add the update/sales server FTP details if that is the expected protocol $serverArray = array('update_server', 'sales_server'); foreach ($serverArray as $server) { - if ($module->{'add_' . $server} == 1 && is_numeric($module->{$server}) && $module->{$server} > 0) + if ($module->{'add_' . $server} == 1 + && is_numeric( + $module->{$server} + ) + && $module->{$server} > 0) { // get the server protocol - $module->{$server . '_protocol'} = ComponentbuilderHelper::getVar('server', (int) $module->{$server}, 'id', 'protocol'); + $module->{$server . '_protocol'} + = ComponentbuilderHelper::getVar( + 'server', (int) $module->{$server}, 'id', 'protocol' + ); } else { @@ -6901,21 +8804,30 @@ class Get // update_server_xml_file_name // rest globals - $this->target = $_backup_target; - $this->lang = $_backup_lang; + $this->target = $_backup_target; + $this->lang = $_backup_lang; $this->langPrefix = $_backup_langPrefix; - unset($this->placeholders[$this->bbb . 'Module_name' . $this->ddd]); + unset( + $this->placeholders[$this->bbb . 'Module_name' . $this->ddd] + ); unset($this->placeholders[$this->bbb . 'Module' . $this->ddd]); unset($this->placeholders[$this->bbb . 'module' . $this->ddd]); - unset($this->placeholders[$this->bbb . 'module.version' . $this->ddd]); - unset($this->placeholders[$this->bbb . 'module_version' . $this->ddd]); + unset( + $this->placeholders[$this->bbb . 'module.version' + . $this->ddd] + ); + unset( + $this->placeholders[$this->bbb . 'module_version' + . $this->ddd] + ); $this->joomlaModules[$id] = $module; return true; } } + return false; } @@ -6928,16 +8840,26 @@ class Get public function getModuleXMLTemplate(&$module) { $xml = ''; - $xml .= PHP_EOL . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $module->lang_prefix . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'BUILDDATE' . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'AUTHOR' . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'AUTHOREMAIL' . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'AUTHORWEBSITE' . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'COPYRIGHT' . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'LICENSE' . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $module->module_version . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $module->lang_prefix . '_XML_DESCRIPTION'; + $xml .= PHP_EOL . ''; + $xml .= PHP_EOL . $this->_t(1) . '' . $module->lang_prefix + . ''; + $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh + . 'BUILDDATE' . $this->hhh . ''; + $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'AUTHOR' + . $this->hhh . ''; + $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh + . 'AUTHOREMAIL' . $this->hhh . ''; + $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh + . 'AUTHORWEBSITE' . $this->hhh . ''; + $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh + . 'COPYRIGHT' . $this->hhh . ''; + $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'LICENSE' + . $this->hhh . ''; + $xml .= PHP_EOL . $this->_t(1) . '' . $module->module_version + . ''; + $xml .= PHP_EOL . $this->_t(1) . '' . $module->lang_prefix + . '_XML_DESCRIPTION'; $xml .= $this->hhh . 'MAINXML' . $this->hhh; $xml .= PHP_EOL . ''; @@ -6946,44 +8868,54 @@ class Get /** * get the Joomla plugins IDs - * + * * @return array of IDs on success - * + * */ protected function getPluginIDs() { - if (($addjoomla_plugins = ComponentbuilderHelper::getVar('component_plugins', $this->componentID, 'joomla_component', 'addjoomla_plugins')) !== false) + if (($addjoomla_plugins = ComponentbuilderHelper::getVar( + 'component_plugins', $this->componentID, 'joomla_component', + 'addjoomla_plugins' + )) !== false) { - $addjoomla_plugins = (ComponentbuilderHelper::checkJson($addjoomla_plugins)) ? json_decode($addjoomla_plugins, true) : null; + $addjoomla_plugins = (ComponentbuilderHelper::checkJson( + $addjoomla_plugins + )) ? json_decode($addjoomla_plugins, true) : null; if (ComponentbuilderHelper::checkArray($addjoomla_plugins)) { $joomla_plugins = array_filter( array_values($addjoomla_plugins), - function($array){ - // only load the plugins whose target association call for it - if (!isset($array['target']) || $array['target'] != 2) - { - return true; + function ($array) { + // only load the plugins whose target association call for it + if (!isset($array['target']) || $array['target'] != 2) + { + return true; + } + + return false; } - return false; - }); + ); // if we have values we return IDs if (ComponentbuilderHelper::checkArray($joomla_plugins)) { - return array_map(function($array){ - return (int) $array['plugin']; - }, $joomla_plugins); + return array_map( + function ($array) { + return (int) $array['plugin']; + }, $joomla_plugins + ); } } } + return false; } /** * get the Joomla plugin path - * + * * @return string of plugin path on success - * + * */ protected function getPluginPath($id) { @@ -7006,7 +8938,12 @@ class Get ); // from these tables $query->from('#__componentbuilder_joomla_plugin AS a'); - $query->join('LEFT', $this->db->quoteName('#__componentbuilder_joomla_plugin_group', 'g') . ' ON (' . $this->db->quoteName('a.joomla_plugin_group') . ' = ' . $this->db->quoteName('g.id') . ')'); + $query->join( + 'LEFT', $this->db->quoteName( + '#__componentbuilder_joomla_plugin_group', 'g' + ) . ' ON (' . $this->db->quoteName('a.joomla_plugin_group') + . ' = ' . $this->db->quoteName('g.id') . ')' + ); $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); $this->db->setQuery($query); $this->db->execute(); @@ -7015,27 +8952,38 @@ class Get // get the plugin data $plugin = $this->db->loadObject(); // update the name if it has dynamic values - $plugin->name = $this->setPlaceholders($this->setDynamicValues($plugin->name), $this->globalPlaceholders); + $plugin->name = $this->setPlaceholders( + $this->setDynamicValues($plugin->name), + $this->globalPlaceholders + ); // update the name if it has dynamic values - $plugin->code_name = ComponentbuilderHelper::safeClassFunctionName($plugin->name); + $plugin->code_name + = ComponentbuilderHelper::safeClassFunctionName( + $plugin->name + ); // set plugin folder name $plugin->group = strtolower($plugin->group); // set plugin file name $plugin->file_name = strtolower($plugin->code_name); // set the lang key - $this->langKeys['PLG_' . strtoupper($plugin->group . '_' . $plugin->file_name)] = $plugin->id . '_P|uG!n'; + $this->langKeys['PLG_' . strtoupper( + $plugin->group . '_' . $plugin->file_name + )] + = $plugin->id . '_P|uG!n'; + // return the path return $plugin->group . '/' . $plugin->file_name; } } + return false; } /** * set the Joomla plugins - * + * * @return true - * + * */ public function setJoomlaPlugin($id, &$component) { @@ -7082,10 +9030,30 @@ class Get ); // from these tables $query->from('#__componentbuilder_joomla_plugin AS a'); - $query->join('LEFT', $this->db->quoteName('#__componentbuilder_joomla_plugin_group', 'g') . ' ON (' . $this->db->quoteName('a.joomla_plugin_group') . ' = ' . $this->db->quoteName('g.id') . ')'); - $query->join('LEFT', $this->db->quoteName('#__componentbuilder_class_extends', 'e') . ' ON (' . $this->db->quoteName('a.class_extends') . ' = ' . $this->db->quoteName('e.id') . ')'); - $query->join('LEFT', $this->db->quoteName('#__componentbuilder_joomla_plugin_updates', 'u') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('u.joomla_plugin') . ')'); - $query->join('LEFT', $this->db->quoteName('#__componentbuilder_joomla_plugin_files_folders_urls', 'f') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('f.joomla_plugin') . ')'); + $query->join( + 'LEFT', $this->db->quoteName( + '#__componentbuilder_joomla_plugin_group', 'g' + ) . ' ON (' . $this->db->quoteName('a.joomla_plugin_group') + . ' = ' . $this->db->quoteName('g.id') . ')' + ); + $query->join( + 'LEFT', + $this->db->quoteName('#__componentbuilder_class_extends', 'e') + . ' ON (' . $this->db->quoteName('a.class_extends') . ' = ' + . $this->db->quoteName('e.id') . ')' + ); + $query->join( + 'LEFT', $this->db->quoteName( + '#__componentbuilder_joomla_plugin_updates', 'u' + ) . ' ON (' . $this->db->quoteName('a.id') . ' = ' + . $this->db->quoteName('u.joomla_plugin') . ')' + ); + $query->join( + 'LEFT', $this->db->quoteName( + '#__componentbuilder_joomla_plugin_files_folders_urls', 'f' + ) . ' ON (' . $this->db->quoteName('a.id') . ' = ' + . $this->db->quoteName('f.joomla_plugin') . ')' + ); $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); $query->where($this->db->quoteName('a.published') . ' >= 1'); $this->db->setQuery($query); @@ -7095,70 +9063,131 @@ class Get // get the plugin data $plugin = $this->db->loadObject(); // tweak system to set stuff to the plugin domain - $_backup_target = $this->target; - $_backup_lang = $this->lang; + $_backup_target = $this->target; + $_backup_lang = $this->lang; $_backup_langPrefix = $this->langPrefix; // set some keys $plugin->target_type = 'P|uG!n'; - $plugin->key = $plugin->id . '_' . $plugin->target_type; + $plugin->key = $plugin->id . '_' . $plugin->target_type; // update to point to plugin $this->target = $plugin->key; - $this->lang = $plugin->key; + $this->lang = $plugin->key; // set version if not set if (empty($plugin->plugin_version)) { $plugin->plugin_version = '1.0.0'; } // set GUI mapper - $guiMapper = array( 'table' => 'joomla_plugin', 'id' => (int) $id, 'type' => 'php'); + $guiMapper = array('table' => 'joomla_plugin', + 'id' => (int) $id, 'type' => 'php'); // update the name if it has dynamic values - $plugin->name = $this->setPlaceholders($this->setDynamicValues($plugin->name), $this->placeholders); + $plugin->name = $this->setPlaceholders( + $this->setDynamicValues($plugin->name), $this->placeholders + ); // update the name if it has dynamic values - $plugin->code_name = ComponentbuilderHelper::safeClassFunctionName($plugin->name); + $plugin->code_name + = ComponentbuilderHelper::safeClassFunctionName( + $plugin->name + ); // set official name - $plugin->official_name = ucwords($plugin->group . ' - ' . $plugin->name); + $plugin->official_name = ucwords( + $plugin->group . ' - ' . $plugin->name + ); // set langPrefix - $this->langPrefix = 'PLG_' . strtoupper($plugin->group) . '_' . strtoupper($plugin->code_name); + $this->langPrefix = 'PLG_' . strtoupper($plugin->group) . '_' + . strtoupper($plugin->code_name); // set lang prefix $plugin->lang_prefix = $this->langPrefix; // set plugin class name - $plugin->class_name = 'Plg' . ucfirst($plugin->group) . ucfirst($plugin->code_name); + $plugin->class_name = 'Plg' . ucfirst($plugin->group) . ucfirst( + $plugin->code_name + ); // set plugin install class name - $plugin->installer_class_name = 'plg' . ucfirst($plugin->group) . ucfirst($plugin->code_name) . 'InstallerScript'; + $plugin->installer_class_name = 'plg' . ucfirst($plugin->group) + . ucfirst($plugin->code_name) . 'InstallerScript'; // set plugin folder name - $plugin->folder_name = 'plg_' . strtolower($plugin->group) . '_' . strtolower($plugin->code_name); + $plugin->folder_name = 'plg_' . strtolower($plugin->group) . '_' + . strtolower($plugin->code_name); // set the zip name - $plugin->zip_name = $plugin->folder_name . '_v' . str_replace('.', '_', $plugin->plugin_version). '__J' . $this->joomlaVersion; + $plugin->zip_name = $plugin->folder_name . '_v' . str_replace( + '.', '_', $plugin->plugin_version + ) . '__J' . $this->joomlaVersion; // set plugin file name $plugin->file_name = strtolower($plugin->code_name); + // set plugin context + $plugin->context = $plugin->folder_name . '.' . $plugin->id; // set official_name lang strings - $this->setLangContent($plugin->key, $this->langPrefix, $plugin->official_name); + $this->setLangContent( + $plugin->key, $this->langPrefix, $plugin->official_name + ); // set some placeholder for this plugin - $this->placeholders[$this->bbb . 'Plugin_name' . $this->ddd] = $plugin->official_name; - $this->placeholders[$this->bbb . 'Plugin' . $this->ddd] = ucfirst($plugin->code_name); - $this->placeholders[$this->bbb . 'plugin' . $this->ddd] = strtolower($plugin->code_name); - $this->placeholders[$this->bbb . 'Plugin_group' . $this->ddd] = ucfirst($plugin->group); - $this->placeholders[$this->bbb . 'plugin_group' . $this->ddd] = strtolower($plugin->group); - $this->placeholders[$this->bbb . 'plugin.version' . $this->ddd] = $plugin->plugin_version; - $this->placeholders[$this->bbb . 'plugin_version' . $this->ddd] = str_replace('.', '_', $plugin->plugin_version); + $this->placeholders[$this->bbb . 'Plugin_name' . $this->ddd] + = $plugin->official_name; + $this->placeholders[$this->bbb . 'Plugin' . $this->ddd] + = ucfirst( + $plugin->code_name + ); + $this->placeholders[$this->bbb . 'plugin' . $this->ddd] + = strtolower( + $plugin->code_name + ); + $this->placeholders[$this->bbb . 'Plugin_group' . $this->ddd] + = ucfirst( + $plugin->group + ); + $this->placeholders[$this->bbb . 'plugin_group' . $this->ddd] + = strtolower( + $plugin->group + ); + $this->placeholders[$this->bbb . 'plugin.version' . $this->ddd] + = $plugin->plugin_version; + $this->placeholders[$this->bbb . 'plugin_version' . $this->ddd] + = str_replace( + '.', '_', $plugin->plugin_version + ); // set description (TODO) add description field to plugin - if (!isset($plugin->description) || !ComponentbuilderHelper::checkString($plugin->description)) + if (!isset($plugin->description) + || !ComponentbuilderHelper::checkString( + $plugin->description + )) { $plugin->description = ''; } else { - $plugin->description = $this->setPlaceholders($this->setDynamicValues($plugin->description), $this->placeholders); - $this->setLangContent($plugin->key, $plugin->lang_prefix . '_DESCRIPTION', $plugin->description); - $plugin->description = '

' . $plugin->description . '

'; + $plugin->description = $this->setPlaceholders( + $this->setDynamicValues($plugin->description), + $this->placeholders + ); + $this->setLangContent( + $plugin->key, $plugin->lang_prefix . '_DESCRIPTION', + $plugin->description + ); + $plugin->description = '

' . $plugin->description + . '

'; } - $plugin->xml_description = "

" . $plugin->official_name . " (v." . $plugin->plugin_version . ")

" . $plugin->description . "

Created by " . trim(JFilterOutput::cleanText($component->author)) . "
Development started " . JFactory::getDate($plugin->created)->format("jS F, Y") . "

"; + $plugin->xml_description = "

" . $plugin->official_name + . " (v." . $plugin->plugin_version + . ")

" + . $plugin->description . "

Created by " . trim( + JFilterOutput::cleanText($component->author) + ) . "
Development started " + . JFactory::getDate($plugin->created)->format("jS F, Y") + . "

"; // set xml discription - $this->setLangContent($plugin->key, $plugin->lang_prefix . '_XML_DESCRIPTION', $plugin->xml_description); + $this->setLangContent( + $plugin->key, $plugin->lang_prefix . '_XML_DESCRIPTION', + $plugin->xml_description + ); // update the readme if set if ($plugin->addreadme == 1 && !empty($plugin->readme)) { - $plugin->readme = $this->setPlaceholders($this->setDynamicValues(base64_decode($plugin->readme)), $this->placeholders); + $plugin->readme = $this->setPlaceholders( + $this->setDynamicValues(base64_decode($plugin->readme)), + $this->placeholders + ); } else { @@ -7172,9 +9201,13 @@ class Get $guiMapper['field'] = 'main_class_code'; // base64 Decode main_class_code. $plugin->main_class_code = $this->setGuiCodePlaceholder( - $this->setPlaceholders($this->setDynamicValues(base64_decode($plugin->main_class_code)), $this->placeholders), + $this->setPlaceholders( + $this->setDynamicValues( + base64_decode($plugin->main_class_code) + ), $this->placeholders + ), $guiMapper - ); + ); } // set the head :) if ($plugin->add_head == 1 && !empty($plugin->head)) @@ -7183,21 +9216,29 @@ class Get $guiMapper['field'] = 'head'; // base64 Decode head. $plugin->head = $this->setGuiCodePlaceholder( - $this->setPlaceholders($this->setDynamicValues(base64_decode($plugin->head)), $this->placeholders), + $this->setPlaceholders( + $this->setDynamicValues( + base64_decode($plugin->head) + ), $this->placeholders + ), $guiMapper - ); + ); } elseif (!empty($plugin->class_head)) { // base64 Decode head. $plugin->head = $this->setGuiCodePlaceholder( - $this->setPlaceholders($this->setDynamicValues(base64_decode($plugin->class_head)), $this->placeholders), + $this->setPlaceholders( + $this->setDynamicValues( + base64_decode($plugin->class_head) + ), $this->placeholders + ), array( 'table' => 'class_extends', 'field' => 'head', - 'id' => (int) $plugin->class_id, - 'type' => 'php') - ); + 'id' => (int) $plugin->class_id, + 'type' => 'php') + ); } unset($plugin->class_head); // set the comment @@ -7205,49 +9246,72 @@ class Get { // base64 Decode comment. $plugin->comment = $this->setGuiCodePlaceholder( - $this->setPlaceholders($this->setDynamicValues(base64_decode($plugin->comment)), $this->placeholders), + $this->setPlaceholders( + $this->setDynamicValues( + base64_decode($plugin->comment) + ), $this->placeholders + ), array( 'table' => 'class_extends', 'field' => 'comment', - 'id' => (int) $plugin->class_id, - 'type' => 'php') - ); + 'id' => (int) $plugin->class_id, + 'type' => 'php') + ); } // start the config array $plugin->config_fields = array(); // create the form arrays - $plugin->form_files = array(); + $plugin->form_files = array(); $plugin->fieldsets_label = array(); $plugin->fieldsets_paths = array(); // set global fields rule to default component path $plugin->fields_rules_paths = 1; // set the fields data - $plugin->fields = (isset($plugin->fields) && ComponentbuilderHelper::checkJson($plugin->fields)) ? json_decode($plugin->fields, true) : null; + $plugin->fields = (isset($plugin->fields) + && ComponentbuilderHelper::checkJson($plugin->fields)) + ? json_decode($plugin->fields, true) : null; if (ComponentbuilderHelper::checkArray($plugin->fields)) { // ket global key - $key = $plugin->key; - $dynamic_fields = array('fieldset' => 'basic', 'fields_name' => 'params', 'file' => 'config'); + $key = $plugin->key; + $dynamic_fields = array('fieldset' => 'basic', + 'fields_name' => 'params', + 'file' => 'config'); foreach ($plugin->fields as $n => &$form) { - if (isset($form['fields']) && ComponentbuilderHelper::checkArray($form['fields'])) + if (isset($form['fields']) + && ComponentbuilderHelper::checkArray( + $form['fields'] + )) { // make sure the dynamic_field is set to dynamic_value by default - foreach ($dynamic_fields as $dynamic_field => $dynamic_value) + foreach ( + $dynamic_fields as $dynamic_field => + $dynamic_value + ) { - if (!isset($form[$dynamic_field]) || !ComponentbuilderHelper::checkString($form[$dynamic_field])) + if (!isset($form[$dynamic_field]) + || !ComponentbuilderHelper::checkString( + $form[$dynamic_field] + )) { $form[$dynamic_field] = $dynamic_value; } else { - if ('fields_name' === $dynamic_field && strpos($form[$dynamic_field], '.') !== false) + if ('fields_name' === $dynamic_field + && strpos($form[$dynamic_field], '.') + !== false) { - $form[$dynamic_field] = $form[$dynamic_field]; + $form[$dynamic_field] + = $form[$dynamic_field]; } else { - $form[$dynamic_field] = ComponentbuilderHelper::safeString($form[$dynamic_field]); + $form[$dynamic_field] + = ComponentbuilderHelper::safeString( + $form[$dynamic_field] + ); } } } @@ -7255,73 +9319,109 @@ class Get if (!isset($form['plugin']) || $form['plugin'] != 1) { // now build the form key - $unique = $form['file'] . $form['fields_name'] . $form['fieldset']; + $unique = $form['file'] . $form['fields_name'] + . $form['fieldset']; } else { // now build the form key - $unique = $form['fields_name'] . $form['fieldset']; + $unique = $form['fields_name'] + . $form['fieldset']; } // set global fields rule path switchs - if ($plugin->fields_rules_paths == 1 && isset($form['fields_rules_paths']) && $form['fields_rules_paths'] == 2) + if ($plugin->fields_rules_paths == 1 + && isset($form['fields_rules_paths']) + && $form['fields_rules_paths'] == 2) { $plugin->fields_rules_paths = 2; } // set where to path is pointing - $plugin->fieldsets_paths[$unique] = $form['fields_rules_paths']; + $plugin->fieldsets_paths[$unique] + = $form['fields_rules_paths']; // add the label if set to lang - if (isset($form['label']) && ComponentbuilderHelper::checkString($form['label'])) + if (isset($form['label']) + && ComponentbuilderHelper::checkString( + $form['label'] + )) { - $plugin->fieldsets_label[$unique] = $this->setLang($form['label']); + $plugin->fieldsets_label[$unique] + = $this->setLang($form['label']); } // build the fields - $form['fields'] = array_map(function($field) use ($key, $unique){ - // make sure the alias and title is 0 - $field['alias'] = 0; - $field['title'] = 0; - // set the field details - $this->setFieldDetails($field, $key, $key, $unique); - // update the default if set - if (ComponentbuilderHelper::checkString($field['custom_value']) && isset($field['settings'])) - { - if (($old_default = ComponentbuilderHelper::getBetween($field['settings']->xml, 'default="', '"', false)) !== false) + $form['fields'] = array_map( + function ($field) use ($key, $unique) { + // make sure the alias and title is 0 + $field['alias'] = 0; + $field['title'] = 0; + // set the field details + $this->setFieldDetails( + $field, $key, $key, $unique + ); + // update the default if set + if (ComponentbuilderHelper::checkString( + $field['custom_value'] + ) + && isset($field['settings'])) { - // replace old default - $field['settings']->xml = str_replace('default="' . $old_default . '"', 'default="' . $field['custom_value'] . '"', $field['settings']->xml); + if (($old_default + = ComponentbuilderHelper::getBetween( + $field['settings']->xml, + 'default="', '"', false + )) !== false) + { + // replace old default + $field['settings']->xml + = str_replace( + 'default="' . $old_default + . '"', 'default="' + . $field['custom_value'] . '"', + $field['settings']->xml + ); + } + else + { + // add the default (hmmm not ideal but okay it should work) + $field['settings']->xml + = 'default="' + . $field['custom_value'] . '" ' + . $field['settings']->xml; + } } - else - { - // add the default (hmmm not ideal but okay it should work) - $field['settings']->xml = 'default="' . $field['custom_value'] . '" ' . $field['settings']->xml; - } - } - unset($field['custom_value']); - // return field - return $field; - }, array_values($form['fields'])); + unset($field['custom_value']); + + // return field + return $field; + }, array_values($form['fields']) + ); // check if field is external form file if (!isset($form['plugin']) || $form['plugin'] != 1) { // load the form file if (!isset($plugin->form_files[$form['file']])) { - $plugin->form_files[$form['file']] = array(); + $plugin->form_files[$form['file']] + = array(); } if (!isset($plugin->form_files[$form['file']][$form['fields_name']])) { - $plugin->form_files[$form['file']][$form['fields_name']] = array(); + $plugin->form_files[$form['file']][$form['fields_name']] + = array(); } if (!isset($plugin->form_files[$form['file']][$form['fields_name']][$form['fieldset']])) { - $plugin->form_files[$form['file']][$form['fields_name']][$form['fieldset']] = array(); + $plugin->form_files[$form['file']][$form['fields_name']][$form['fieldset']] + = array(); } // do some house cleaning (for fields) foreach ($form['fields'] as $field) { // so first we lock the field name in - $this->getFieldName($field, $plugin->key, $unique); + $this->getFieldName( + $field, $plugin->key, $unique + ); // add the fields to the global form file builder - $plugin->form_files[$form['file']][$form['fields_name']][$form['fieldset']][] = $field; + $plugin->form_files[$form['file']][$form['fields_name']][$form['fieldset']][] + = $field; } // remove form unset($plugin->fields[$n]); @@ -7331,19 +9431,24 @@ class Get // load the config form if (!isset($plugin->config_fields[$form['fields_name']])) { - $plugin->config_fields[$form['fields_name']] = array(); + $plugin->config_fields[$form['fields_name']] + = array(); } if (!isset($plugin->config_fields[$form['fields_name']][$form['fieldset']])) { - $plugin->config_fields[$form['fields_name']][$form['fieldset']] = array(); + $plugin->config_fields[$form['fields_name']][$form['fieldset']] + = array(); } // do some house cleaning (for fields) foreach ($form['fields'] as $field) { // so first we lock the field name in - $this->getFieldName($field, $plugin->key, $unique); + $this->getFieldName( + $field, $plugin->key, $unique + ); // add the fields to the config builder - $plugin->config_fields[$form['fields_name']][$form['fieldset']][] = $field; + $plugin->config_fields[$form['fields_name']][$form['fieldset']][] + = $field; } // remove form unset($plugin->fields[$n]); @@ -7357,14 +9462,29 @@ class Get } unset($plugin->fields); // set the add targets - $addArray = array('files' => 'files', 'folders' => 'folders', 'urls' => 'urls', 'filesfullpath' => 'files', 'foldersfullpath' => 'folders'); + $addArray = array('files' => 'files', + 'folders' => 'folders', + 'urls' => 'urls', + 'filesfullpath' => 'files', + 'foldersfullpath' => 'folders'); foreach ($addArray as $addTarget => $targetHere) { // set the add target data - $plugin->{'add' . $addTarget} = (isset($plugin->{'add' . $addTarget}) && ComponentbuilderHelper::checkJson($plugin->{'add' . $addTarget})) ? json_decode($plugin->{'add' . $addTarget}, true) : null; - if (ComponentbuilderHelper::checkArray($plugin->{'add' . $addTarget})) + $plugin->{'add' . $addTarget} = (isset( + $plugin->{'add' . $addTarget} + ) + && ComponentbuilderHelper::checkJson( + $plugin->{'add' . $addTarget} + )) ? json_decode($plugin->{'add' . $addTarget}, true) + : null; + if (ComponentbuilderHelper::checkArray( + $plugin->{'add' . $addTarget} + )) { - if (isset($plugin->{$targetHere}) && ComponentbuilderHelper::checkArray($plugin->{$targetHere})) + if (isset($plugin->{$targetHere}) + && ComponentbuilderHelper::checkArray( + $plugin->{$targetHere} + )) { foreach ($plugin->{'add' . $addTarget} as $taget) { @@ -7373,25 +9493,47 @@ class Get } else { - $plugin->{$targetHere} = array_values($plugin->{'add' . $addTarget}); + $plugin->{$targetHere} = array_values( + $plugin->{'add' . $addTarget} + ); } } unset($plugin->{'add' . $addTarget}); } // add PHP in plugin install $plugin->add_install_script = false; - $addScriptMethods = array('php_preflight', 'php_postflight', 'php_method'); - $addScriptTypes = array('install', 'update', 'uninstall'); + $addScriptMethods = array('php_preflight', + 'php_postflight', + 'php_method'); + $addScriptTypes = array('install', 'update', + 'uninstall'); foreach ($addScriptMethods as $scriptMethod) { foreach ($addScriptTypes as $scriptType) { - if (isset($plugin->{'add_' . $scriptMethod . '_' . $scriptType}) && $plugin->{'add_' . $scriptMethod . '_' . $scriptType} == 1 && ComponentbuilderHelper::checkString($plugin->{$scriptMethod . '_' . $scriptType})) + if (isset( + $plugin->{'add_' . $scriptMethod . '_' + . $scriptType} + ) + && $plugin->{'add_' . $scriptMethod . '_' + . $scriptType} == 1 + && ComponentbuilderHelper::checkString( + $plugin->{$scriptMethod . '_' . $scriptType} + )) { // set GUI mapper field - $guiMapper['field'] = $scriptMethod . '_' . $scriptType; - $plugin->{$scriptMethod . '_' . $scriptType} = $this->setGuiCodePlaceholder( - $this->setPlaceholders($this->setDynamicValues(base64_decode($plugin->{$scriptMethod . '_' . $scriptType})), $this->placeholders), + $guiMapper['field'] = $scriptMethod . '_' + . $scriptType; + $plugin->{$scriptMethod . '_' . $scriptType} + = $this->setGuiCodePlaceholder( + $this->setPlaceholders( + $this->setDynamicValues( + base64_decode( + $plugin->{$scriptMethod . '_' + . $scriptType} + ) + ), $this->placeholders + ), $guiMapper ); $plugin->add_install_script = true; @@ -7399,14 +9541,20 @@ class Get else { unset($plugin->{$scriptMethod . '_' . $scriptType}); - $plugin->{'add_' . $scriptMethod . '_' . $scriptType} = 0; + $plugin->{'add_' . $scriptMethod . '_' + . $scriptType} + = 0; } } } // add_sql - if ($plugin->add_sql == 1 && ComponentbuilderHelper::checkString($plugin->sql)) + if ($plugin->add_sql == 1 + && ComponentbuilderHelper::checkString($plugin->sql)) { - $plugin->sql = $this->setPlaceholders($this->setDynamicValues(base64_decode($plugin->sql)), $this->placeholders); + $plugin->sql = $this->setPlaceholders( + $this->setDynamicValues(base64_decode($plugin->sql)), + $this->placeholders + ); } else { @@ -7414,9 +9562,16 @@ class Get $plugin->add_sql = 0; } // add_sql_uninstall - if ($plugin->add_sql_uninstall == 1 && ComponentbuilderHelper::checkString($plugin->sql_uninstall)) - { - $plugin->sql_uninstall = $this->setPlaceholders($this->setDynamicValues(base64_decode($plugin->sql_uninstall)), $this->placeholders); + if ($plugin->add_sql_uninstall == 1 + && ComponentbuilderHelper::checkString( + $plugin->sql_uninstall + )) + { + $plugin->sql_uninstall = $this->setPlaceholders( + $this->setDynamicValues( + base64_decode($plugin->sql_uninstall) + ), $this->placeholders + ); } else { @@ -7424,18 +9579,31 @@ class Get $plugin->add_sql_uninstall = 0; } // update the URL of the update_server if set - if ($plugin->add_update_server == 1 && ComponentbuilderHelper::checkString($plugin->update_server_url)) + if ($plugin->add_update_server == 1 + && ComponentbuilderHelper::checkString( + $plugin->update_server_url + )) { - $plugin->update_server_url = $this->setPlaceholders($this->setDynamicValues($plugin->update_server_url), $this->placeholders); + $plugin->update_server_url = $this->setPlaceholders( + $this->setDynamicValues($plugin->update_server_url), + $this->placeholders + ); } // add the update/sales server FTP details if that is the expected protocol $serverArray = array('update_server', 'sales_server'); foreach ($serverArray as $server) { - if ($plugin->{'add_' . $server} == 1 && is_numeric($plugin->{$server}) && $plugin->{$server} > 0) + if ($plugin->{'add_' . $server} == 1 + && is_numeric( + $plugin->{$server} + ) + && $plugin->{$server} > 0) { // get the server protocol - $plugin->{$server . '_protocol'} = ComponentbuilderHelper::getVar('server', (int) $plugin->{$server}, 'id', 'protocol'); + $plugin->{$server . '_protocol'} + = ComponentbuilderHelper::getVar( + 'server', (int) $plugin->{$server}, 'id', 'protocol' + ); } else { @@ -7453,45 +9621,70 @@ class Get // update_server_xml_file_name // rest globals - $this->target = $_backup_target; - $this->lang = $_backup_lang; + $this->target = $_backup_target; + $this->lang = $_backup_lang; $this->langPrefix = $_backup_langPrefix; - unset($this->placeholders[$this->bbb . 'Plugin_name' . $this->ddd]); + unset( + $this->placeholders[$this->bbb . 'Plugin_name' . $this->ddd] + ); unset($this->placeholders[$this->bbb . 'Plugin' . $this->ddd]); unset($this->placeholders[$this->bbb . 'plugin' . $this->ddd]); - unset($this->placeholders[$this->bbb . 'Plugin_group' . $this->ddd]); - unset($this->placeholders[$this->bbb . 'plugin_group' . $this->ddd]); - unset($this->placeholders[$this->bbb . 'plugin.version' . $this->ddd]); - unset($this->placeholders[$this->bbb . 'plugin_version' . $this->ddd]); + unset( + $this->placeholders[$this->bbb . 'Plugin_group' + . $this->ddd] + ); + unset( + $this->placeholders[$this->bbb . 'plugin_group' + . $this->ddd] + ); + unset( + $this->placeholders[$this->bbb . 'plugin.version' + . $this->ddd] + ); + unset( + $this->placeholders[$this->bbb . 'plugin_version' + . $this->ddd] + ); $this->joomlaPlugins[$id] = $plugin; return true; } } + return false; } /** * get the plugin xml template - * + * * @return string - * + * */ public function getPluginXMLTemplate(&$plugin) { $xml = ''; - $xml .= PHP_EOL . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $plugin->lang_prefix . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'BUILDDATE' . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'AUTHOR' . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'AUTHOREMAIL' . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'AUTHORWEBSITE' . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'COPYRIGHT' . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'LICENSE' . $this->hhh . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $plugin->plugin_version . ''; - $xml .= PHP_EOL . $this->_t(1) . '' . $plugin->lang_prefix . '_XML_DESCRIPTION'; + $xml .= PHP_EOL . ''; + $xml .= PHP_EOL . $this->_t(1) . '' . $plugin->lang_prefix + . ''; + $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh + . 'BUILDDATE' . $this->hhh . ''; + $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'AUTHOR' + . $this->hhh . ''; + $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh + . 'AUTHOREMAIL' . $this->hhh . ''; + $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh + . 'AUTHORWEBSITE' . $this->hhh . ''; + $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh + . 'COPYRIGHT' . $this->hhh . ''; + $xml .= PHP_EOL . $this->_t(1) . '' . $this->hhh . 'LICENSE' + . $this->hhh . ''; + $xml .= PHP_EOL . $this->_t(1) . '' . $plugin->plugin_version + . ''; + $xml .= PHP_EOL . $this->_t(1) . '' . $plugin->lang_prefix + . '_XML_DESCRIPTION'; $xml .= $this->hhh . 'MAINXML' . $this->hhh; $xml .= PHP_EOL . ''; @@ -7500,9 +9693,9 @@ class Get /** * check if we already have these ids in local memory - * + * * @return void - * + * */ protected function checkCustomCodeMemory($ids) { @@ -7521,28 +9714,34 @@ class Get { return $ids; } + return false; } /** * store the code - * - * @param int $when To set when to update + * + * @param int $when To set when to update * * @return void - * + * */ protected function setNewCustomCode($when = 1) { if (count((array) $this->newCustomCode) >= $when) { // Create a new query object. - $query = $this->db->getQuery(true); + $query = $this->db->getQuery(true); $continue = false; // Insert columns. - $columns = array('path', 'type', 'target', 'comment_type', '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($this->db->quoteName('#__componentbuilder_custom_code')); + $query->insert( + $this->db->quoteName('#__componentbuilder_custom_code') + ); $query->columns($this->db->quoteName($columns)); foreach ($this->newCustomCode as $values) { @@ -7570,11 +9769,11 @@ class Get /** * store the code - * - * @param int $when To set when to update + * + * @param int $when To set when to update * * @return void - * + * */ protected function setExistingCustomCode($when = 1) { @@ -7585,7 +9784,9 @@ class Get // Create a new query object. $query = $this->db->getQuery(true); // Prepare the update query. - $query->update($this->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. $this->db->setQuery($query); $this->db->execute(); @@ -7597,26 +9798,37 @@ class Get /** * get the custom code from the local files - * + * * @param array $paths The local paths to parse * @param string $today The date for today * * @return void - * + * */ protected function customCodeFactory(&$paths, &$today) { // we must first store the current woking directory - $joomla = getcwd(); + $joomla = getcwd(); $counter = array(1 => 0, 2 => 0); // file types to get $fileTypes = array('\.php', '\.js', '\.xml'); // set some local placeholders - $placeholders = array_flip($this->globalPlaceholders); - $placeholders[ComponentbuilderHelper::safeString($this->componentCodeName, 'F') . 'Helper::'] = $this->bbb . 'Component' . $this->ddd . 'Helper::'; - $placeholders['COM_' . ComponentbuilderHelper::safeString($this->componentCodeName, 'U')] = 'COM_' . $this->bbb . 'COMPONENT' . $this->ddd; - $placeholders['com_' . $this->componentCodeName] = 'com_' . $this->bbb . 'component' . $this->ddd; + $placeholders = array_flip( + $this->globalPlaceholders + ); + $placeholders[ComponentbuilderHelper::safeString( + $this->componentCodeName, 'F' + ) . 'Helper::'] + = $this->bbb + . 'Component' . $this->ddd . 'Helper::'; + $placeholders['COM_' . ComponentbuilderHelper::safeString( + $this->componentCodeName, 'U' + )] + = 'COM_' . $this->bbb + . 'COMPONENT' . $this->ddd; + $placeholders['com_' . $this->componentCodeName] = 'com_' . $this->bbb + . 'component' . $this->ddd; // putt the last first $placeholders = array_reverse($placeholders, true); @@ -7633,14 +9845,21 @@ class Get { foreach ($files as $file) { - $this->searchFileContent($counter, $file, $target, $this->customCodePlaceholders, $placeholders, $today); + $this->searchFileContent( + $counter, $file, $target, + $this->customCodePlaceholders, $placeholders, $today + ); // insert new code - if (ComponentbuilderHelper::checkArray($this->newCustomCode)) + if (ComponentbuilderHelper::checkArray( + $this->newCustomCode + )) { $this->setNewCustomCode(100); } // update existing custom code - if (ComponentbuilderHelper::checkArray($this->existingCustomCode)) + if (ComponentbuilderHelper::checkArray( + $this->existingCustomCode + )) { $this->setExistingCustomCode(30); } @@ -7664,33 +9883,34 @@ class Get /** * search a file for placeholders and store result - * - * @param array $counter The counter for the arrays - * @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 string $today The date for today + * + * @param array $counter The counter for the arrays + * @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 string $today The date for today * * @return array on success - * + * */ - protected function searchFileContent(&$counter, &$file, &$target, &$searchArray, &$placeholders, &$today) - { + protected function searchFileContent(&$counter, &$file, &$target, + &$searchArray, &$placeholders, &$today + ) { // we add a new search for the GUI CODE Blocks $this->guiCodeSearch($file, $placeholders, $today, $target); // reset each time per file $loadEndFingerPrint = false; - $endFingerPrint = array(); - $fingerPrint = array(); - $codeBucket = array(); - $pointer = array(); - $reading = array(); - $reader = 0; + $endFingerPrint = array(); + $fingerPrint = array(); + $codeBucket = array(); + $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); # TODO (windows path issues) + $file = str_replace('./', '', $file); # TODO (windows path issues) if ($file !== 'script.php') { $path = $target . '/' . $file; @@ -7711,22 +9931,32 @@ class Get } foreach ($searchArray as $type => $search) { - $i = (int) ($type == 3 || $type == 4) ? 2 : 1; + $i = (int) ($type == 3 || $type == 4) ? 2 : 1; $_type = (int) ($type == 1 || $type == 3) ? 1 : 2; if ($reader === 0 || $reader === $i) { $targetKey = $type; - $start = '/***[' . $search . '***/'; - $end = '/***[/' . $search . '***/'; + $start = '/***[' . $search . '***/'; + $end = '/***[/' . $search . '***/'; $startHTML = ''; - $endHTML = ''; + $endHTML = ''; // check if the ending place holder was found - if (isset($reading[$targetKey]) && $reading[$targetKey] && - ((trim($lineContent) === $end || strpos($lineContent, $end) !== false) || - (trim($lineContent) === $endHTML || strpos($lineContent, $endHTML) !== 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 (isset($endReplace) && ($_line = $this->addLineChecker($endReplace, 2, $lineContent)) !== false) + if (isset($endReplace) + && ($_line + = $this->addLineChecker( + $endReplace, 2, $lineContent + )) !== false) { $codeBucket[$pointer[$targetKey]][] = $_line; } @@ -7741,55 +9971,82 @@ class Get { // activate fingerPrint for replacement end target $loadEndFingerPrint = true; - $backupTargetKey = $targetKey; - $backupI = $i; + $backupTargetKey = $targetKey; + $backupI = $i; } // all new records we can do a bulk insert if ($i === 1) { // end the bucket info for this code block - $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote((int) $lineNumber); // 'toline' + $this->newCustomCode[$pointer[$targetKey]][] + = $this->db->quote( + (int) $lineNumber + ); // 'toline' // first reverse engineer this code block - $c0de = $this->reversePlaceholders(implode('', $codeBucket[$pointer[$targetKey]]), $placeholders, $target); - $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote(base64_encode($c0de)); // 'code' + $c0de = $this->reversePlaceholders( + implode('', $codeBucket[$pointer[$targetKey]]), + $placeholders, $target + ); + $this->newCustomCode[$pointer[$targetKey]][] + = $this->db->quote( + base64_encode($c0de) + ); // 'code' if ($_type == 2) { // load the last value - $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote(0); // 'hashendtarget' + $this->newCustomCode[$pointer[$targetKey]][] + = $this->db->quote(0); // 'hashendtarget' } } // the record already exist so we must update instead elseif ($i === 2) { // end the bucket info for this code block - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('to_line') . ' = ' . $this->db->quote($lineNumber); + $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, $target, $this->existingCustomCode[$pointer[$targetKey]]['id']); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('code') . ' = ' . $this->db->quote(base64_encode($c0de)); + $c0de = $this->reversePlaceholders( + implode('', $codeBucket[$pointer[$targetKey]]), + $placeholders, $target, + $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'][] = $this->db->quoteName('hashendtarget') . ' = ' . $this->db->quote(0); + $this->existingCustomCode[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('hashendtarget') + . ' = ' . $this->db->quote(0); } } } // check if the endfingerprint is ready to save if (count((array) $endFingerPrint) === 3) { - $hashendtarget = '3__' . md5(implode('', $endFingerPrint)); + $hashendtarget = '3__' . md5( + implode('', $endFingerPrint) + ); // all new records we can do a bulk insert if ($i === 1) { // load the last value - $this->newCustomCode[$pointer[$targetKey]][] = $this->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'][] = $this->db->quoteName('hashendtarget') . ' = ' . $this->db->quote($hashendtarget); + $this->existingCustomCode[$pointer[$targetKey]]['fields'][] + = $this->db->quoteName('hashendtarget') . ' = ' + . $this->db->quote($hashendtarget); } // reset the needed values - $endFingerPrint = array(); + $endFingerPrint = array(); $loadEndFingerPrint = false; // deactivate reader (to allow other search) $reader = 0; @@ -7800,18 +10057,23 @@ class Get $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)) + if ((!isset($reading[$targetKey]) || !$reading[$targetKey]) + && (($i === 1 && trim($lineContent) === $start) + || strpos($lineContent, $start) !== false)) { - $commentType = 1; // PHP/JS type + $commentType = 1; // PHP/JS type $startReplace = $start; - $endReplace = $end; + $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)) + elseif ((!isset($reading[$targetKey]) + || !$reading[$targetKey]) + && (($i === 1 && trim($lineContent) === $startHTML) + || strpos($lineContent, $startHTML) !== false)) { - $commentType = 2; // HTML type + $commentType = 2; // HTML type $startReplace = $startHTML; - $endReplace = $endHTML; + $endReplace = $endHTML; } // check if the starting place holder was found if ($commentType > 0) @@ -7821,15 +10083,27 @@ class Get { // reset found comment type $commentType = 0; - $this->app->enqueueMessage(JText::_('

Custom Codes Warning

'), 'Warning'); - $this->app->enqueueMessage(JText::sprintf('We found dynamic code all in one line, and ignored it! Please review (%s) for more details!', $path), 'Warning'); + $this->app->enqueueMessage( + JText::_('

Custom Codes Warning

'), + 'Warning' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'We found dynamic code all in one line, and ignored it! Please review (%s) for more details!', + $path + ), 'Warning' + ); continue; } // do a quick check to insure we have an id $id = false; if ($i === 2) { - $id = $this->getSystemID($lineContent, array(1 => $start, 2 => $startHTML), $commentType); + $id = $this->getSystemID( + $lineContent, + array(1 => $start, 2 => $startHTML), + $commentType + ); } if ($i === 2 && $id > 0) { @@ -7844,7 +10118,9 @@ class Get $this->codeAreadyDone[$id] = (int) $id; } // start replace - $startReplace = $this->setStartReplace($id, $commentType, $startReplace); + $startReplace = $this->setStartReplace( + $id, $commentType, $startReplace + ); // set active reader (to lock out other search) $reader = $i; // set pointer @@ -7854,64 +10130,129 @@ class Get // start code bucket $codeBucket[$pointer[$targetKey]] = array(); // trim the placeholder and if there is still data then load it - if ($_line = $this->addLineChecker($startReplace, 1, $lineContent)) + 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; - $hasharray = array_slice($fingerPrint, -$inFinger, $getFinger, true); - $hasleng = count($hasharray); - $hashtarget = $hasleng . '__' . md5(implode('', $hasharray)); + $inFinger = count($fingerPrint); + $getFinger = $inFinger - 1; + $hasharray = array_slice( + $fingerPrint, -$inFinger, $getFinger, true + ); + $hasleng = count($hasharray); + $hashtarget = $hasleng . '__' . md5( + implode('', $hasharray) + ); // for good practice ComponentbuilderHelper::fixPath($path); // all new records we can do a bulk insert if ($i === 1 || !$id) { // start the bucket for this code - $this->newCustomCode[$pointer[$targetKey]] = array(); - $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' + $this->newCustomCode[$pointer[$targetKey]] + = array(); + $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) { // start the bucket for this code - $this->existingCustomCode[$pointer[$targetKey]] = array(); - $this->existingCustomCode[$pointer[$targetKey]]['id'] = (int) $id; - $this->existingCustomCode[$pointer[$targetKey]]['conditions'] = array(); - $this->existingCustomCode[$pointer[$targetKey]]['conditions'][] = $this->db->quoteName('id') . ' = ' . $this->db->quote($id); - $this->existingCustomCode[$pointer[$targetKey]]['fields'] = array(); - $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); + $this->existingCustomCode[$pointer[$targetKey]] + = array(); + $this->existingCustomCode[$pointer[$targetKey]]['id'] + = (int) $id; + $this->existingCustomCode[$pointer[$targetKey]]['conditions'] + = array(); + $this->existingCustomCode[$pointer[$targetKey]]['conditions'][] + = $this->db->quoteName('id') . ' = ' + . $this->db->quote($id); + $this->existingCustomCode[$pointer[$targetKey]]['fields'] + = array(); + $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 { // de activate the reader $reading[$targetKey] = false; - $reader = 0; + $reader = 0; } // reset found comment type $commentType = 0; // update the counter - $counter[$i] ++; + $counter[$i]++; } } } @@ -7926,8 +10267,10 @@ class Get { if (count((array) $endFingerPrint) > 0) { - $leng = count($endFingerPrint); - $hashendtarget = $leng . '__' . md5(implode('', $endFingerPrint)); + $leng = count($endFingerPrint); + $hashendtarget = $leng . '__' . md5( + implode('', $endFingerPrint) + ); } else { @@ -7937,52 +10280,75 @@ class Get if ($backupI === 1) { // load the last value - $this->newCustomCode[$pointer[$backupTargetKey]][] = $this->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'][] = $this->db->quoteName('hashendtarget') . ' = ' . $this->db->quote($hashendtarget); + $this->existingCustomCode[$pointer[$backupTargetKey]]['fields'][] + = $this->db->quoteName('hashendtarget') . ' = ' + . $this->db->quote($hashendtarget); } } } /** * Set the JCB GUI code placeholder - * - * @param string $string The code string - * @param array $config The placeholder config values + * + * @param string $string The code string + * @param array $config The placeholder config values * * @return string - * + * */ public function setGuiCodePlaceholder($string, $config) { if (ComponentbuilderHelper::checkString($string)) { - if ($this->addPlaceholders && $this->canAddGuiCodePlaceholder($string) + if ($this->addPlaceholders + && $this->canAddGuiCodePlaceholder( + $string + ) && ComponentbuilderHelper::checkArray($config) - && isset($config['table']) && ComponentbuilderHelper::checkString($config['table']) - && isset($config['field']) && ComponentbuilderHelper::checkString($config['field']) - && isset($config['type']) && ComponentbuilderHelper::checkString($config['type']) - && isset($config['id']) && is_numeric($config['id'])) + && isset($config['table']) + && ComponentbuilderHelper::checkString($config['table']) + && isset($config['field']) + && ComponentbuilderHelper::checkString($config['field']) + && isset($config['type']) + && ComponentbuilderHelper::checkString($config['type']) + && isset($config['id']) + && is_numeric($config['id'])) { // if we have a key we must get the ID - if (isset($config['key']) && ComponentbuilderHelper::checkString($config['key']) && $config['key'] !== 'id') + if (isset($config['key']) + && ComponentbuilderHelper::checkString($config['key']) + && $config['key'] !== 'id') { - if (($id = ComponentbuilderHelper::getVar($config['table'], $config['id'], $config['key'], 'id')) !== false && is_numeric($id)) + if (($id = ComponentbuilderHelper::getVar( + $config['table'], $config['id'], $config['key'], + 'id' + )) !== false + && is_numeric($id)) { $config['id'] = $id; } else { // we must give a error message to inform the user of this issue. (should never happen) - $this->app->enqueueMessage(JText::sprintf('ID mismatch was detected with the %s.%s.%s.%s GUI code field. So the placeholder was not set.', $config['table'], $config['field'], $config['key'], $config['id']), 'Error'); + $this->app->enqueueMessage( + JText::sprintf( + 'ID mismatch was detected with the %s.%s.%s.%s GUI code field. So the placeholder was not set.', + $config['table'], $config['field'], + $config['key'], $config['id'] + ), 'Error' + ); // check some config if (!isset($config['prefix'])) { $config['prefix'] = ''; } + return $config['prefix'] . $string; } } @@ -7998,35 +10364,39 @@ class Get case 'html': $front = $config['prefix'] . '' . PHP_EOL; - $back = ''); + $guiCode[] = ComponentbuilderHelper::getAllBetween( + $file_conent, '/***[JCB' . 'GUI<>', '/***[/JCBGUI' . '$$$$]***/' + ); + $guiCode[] = ComponentbuilderHelper::getAllBetween( + $file_conent, '' + ); - if (($guiCode = ComponentbuilderHelper::mergeArrays($guiCode)) !== false && ComponentbuilderHelper::checkArray($guiCode, true)) + if (($guiCode = ComponentbuilderHelper::mergeArrays($guiCode)) !== false + && ComponentbuilderHelper::checkArray($guiCode, true)) { foreach ($guiCode as $code) { @@ -8072,7 +10448,8 @@ class Get if (is_array($query) && count($query) >= 3) { // cleanup the newlines around the code - $code = trim(str_replace($first_line, '', $code), PHP_EOL) . PHP_EOL; + $code = trim(str_replace($first_line, '', $code), PHP_EOL) + . PHP_EOL; // set the ID $id = (int) $query[2]; // make the field name save @@ -8080,13 +10457,19 @@ class Get // make the table name save $table = ComponentbuilderHelper::safeString($query[0]); // reverse placeholder as much as we can - $code = $this->reversePlaceholders($code, $placeholders, $target, $id, $field, $table); + $code = $this->reversePlaceholders( + $code, $placeholders, $target, $id, $field, $table + ); // update the GUI/Tables/Database $object = new stdClass(); $object->id = $id; - $object->{$field} = base64_encode($code); // (TODO) this may not always work... + $object->{$field} = base64_encode( + $code + ); // (TODO) this may not always work... // update the value in GUI - $this->db->updateObject('#__componentbuilder_' . (string) $table, $object, 'id'); + $this->db->updateObject( + '#__componentbuilder_' . (string) $table, $object, 'id' + ); } } } @@ -8094,13 +10477,13 @@ class Get /** * Check if this line should be added - * - * @param string $replaceKey The key to remove from line - * @param int $type The line type - * @param string $lineContent The line to check + * + * @param string $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) { @@ -8124,18 +10507,19 @@ class Get } break; } + return false; } /** * set the start replace placeholder - * - * @param int $id The comment id - * @param int $commentType The comment type - * @param string $startReplace The main replace string + * + * @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) { @@ -8151,18 +10535,19 @@ class Get break; } } + return $startReplace; } /** * search for the system id in the line given - * - * @param string $lineContent The file path to search - * @param string $placeholders The values to search for - * @param int $commentType The comment type + * + * @param string $lineContent The file path to search + * @param string $placeholders The values to search for + * @param int $commentType The comment type * * @return array on success - * + * */ protected function getSystemID(&$lineContent, $placeholders, $commentType) { @@ -8172,63 +10557,78 @@ class Get $trim = '', - 'end' => ''); + 'end' => ''); } else { return array( 'start' => "", - 'end' => ""); + 'end' => ""); } break; case 22: @@ -8446,21 +10868,22 @@ class Get { return array( 'start' => '', - 'end' => ''); + 'end' => ''); } else { return array( 'start' => "", - 'end' => " "); + 'end' => " "); } break; case 3: return array( 'start' => "", - 'end' => ""); + 'end' => ""); break; } + return false; } @@ -8468,18 +10891,21 @@ class Get * 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; + $localPaths['admin'] = JPATH_ADMINISTRATOR . '/components/com_' + . $this->componentCodeName; // site path - $localPaths['site'] = JPATH_ROOT . '/components/com_' . $this->componentCodeName; + $localPaths['site'] = JPATH_ROOT . '/components/com_' + . $this->componentCodeName; // media path - $localPaths['media'] = JPATH_ROOT . '/media/com_' . $this->componentCodeName; + $localPaths['media'] = JPATH_ROOT . '/media/com_' + . $this->componentCodeName; // lets also go over the REPOS (TODO) // Painfull but we need to folder paths for the linked modules if (($module_ids = $this->getModuleIDs()) !== false) @@ -8490,7 +10916,8 @@ class Get if (($path = $this->getModulePath($module_id)) !== false) { // set the path - $localPaths['module_' . str_replace('/', '_', $path)] = $path; + $localPaths['module_' . str_replace('/', '_', $path)] + = $path; } } } @@ -8503,7 +10930,8 @@ class Get if (($path = $this->getPluginPath($plugin_id)) !== false) { // set the path - $localPaths['plugin_' . str_replace('/', '_', $path)] = JPATH_ROOT . '/plugins/' . $path; + $localPaths['plugin_' . str_replace('/', '_', $path)] + = JPATH_ROOT . '/plugins/' . $path; } } } @@ -8519,6 +10947,7 @@ class Get { return $localPaths; } + return false; } diff --git a/admin/helpers/compiler/b_Structure.php b/admin/helpers/compiler/b_Structure.php index 5f3d3bf93..c0e44be97 100644 --- a/admin/helpers/compiler/b_Structure.php +++ b/admin/helpers/compiler/b_Structure.php @@ -5,7 +5,7 @@ * @created 30th April, 2015 * @author Llewellyn van der Merwe * @github Joomla Component Builder - * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @copyright Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -20,210 +20,210 @@ class Structure extends Get /** * The folder counter - * + * * @var int */ public $folderCount = 0; /** * The file counter - * + * * @var int */ public $fileCount = 0; /** * The page counter - * + * * @var int */ public $pageCount = 0; /** * The line counter - * + * * @var int */ public $lineCount = 0; /** * The field counter - * + * * @var int */ public $fieldCount = 0; /** * The seconds counter - * + * * @var int */ public $seconds = 0; /** * The actual seconds counter - * + * * @var int */ public $actualSeconds = 0; /** * The folder seconds counter - * + * * @var int */ public $folderSeconds = 0; /** * The file seconds counter - * + * * @var int */ public $fileSeconds = 0; /** * The line seconds counter - * + * * @var int */ public $lineSeconds = 0; /** * The seconds debugging counter - * + * * @var int */ public $secondsDebugging = 0; /** * The seconds planning counter - * + * * @var int */ public $secondsPlanning = 0; /** * The seconds mapping counter - * + * * @var int */ public $secondsMapping = 0; /** * The seconds office counter - * + * * @var int */ public $secondsOffice = 0; /** * The total hours counter - * + * * @var int */ public $totalHours = 0; /** * The debugging hours counter - * + * * @var int */ public $debuggingHours = 0; /** * The planning hours counter - * + * * @var int */ public $planningHours = 0; /** * The mapping hours counter - * + * * @var int */ public $mappingHours = 0; /** * The office hours counter - * + * * @var int */ public $officeHours = 0; /** * The actual Total Hours counter - * + * * @var int */ public $actualTotalHours = 0; /** * The actual hours spent counter - * + * * @var int */ public $actualHoursSpent = 0; /** * The actual days spent counter - * + * * @var int */ public $actualDaysSpent = 0; /** * The total days counter - * + * * @var int */ public $totalDays = 0; /** * The actual Total Days counter - * + * * @var int */ public $actualTotalDays = 0; /** * The project week time counter - * + * * @var int */ public $projectWeekTime = 0; /** * The project month time counter - * + * * @var int */ public $projectMonthTime = 0; /** * The template path - * + * * @var string */ public $templatePath; /** * The custom template path - * + * * @var string */ public $templatePathCustom; /** * The Joomla Version Data - * + * * @var object */ public $joomlaVersionData; /** * Static File Content - * + * * @var array */ public $fileContentStatic = array(); @@ -244,105 +244,107 @@ class Structure extends Get /** * The standard folders - * + * * @var array */ public $stdFolders = array('site', 'admin', 'media'); /** * The standard root files - * + * * @var array */ - public $stdRootFiles = array('access.xml', 'config.xml', 'controller.php', 'index.html', 'README.txt'); + public $stdRootFiles + = array('access.xml', 'config.xml', 'controller.php', 'index.html', + 'README.txt'); /** * Dynamic File Content - * + * * @var array */ public $fileContentDynamic = array(); /** * The Component Sales name - * + * * @var string */ public $componentSalesName; /** * The Component Backup name - * + * * @var string */ public $componentBackupName; /** * The Component Folder name - * + * * @var string */ public $componentFolderName; /** * The Component path - * + * * @var string */ public $componentPath; /** * The Dynamic paths - * + * * @var array */ public $dynamicPaths = array(); /** * The not new static items - * + * * @var array */ public $notNew = array(); /** * Update the file content - * + * * @var array */ public $updateFileContent = array(); /** * The new files - * + * * @var array */ public $newFiles = array(); /** * The Checkin Switch - * + * * @var boolean */ public $addCheckin = false; /** * The Move Folders Switch - * + * * @var boolean */ public $setMoveFolders = false; /** * The array of last modified dates - * + * * @var array */ protected $lastModifiedDate = array(); /** * The default view switch - * + * * @var bool/string */ public $dynamicDashboard = false; @@ -358,29 +360,53 @@ class Structure extends Get // set the standard admin file $this->stdRootFiles[] = $this->componentData->name_code . '.php'; // set incase no extra admin folder are loaded - $this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FOLDERS' . $this->hhh] = ''; + $this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FOLDERS' + . $this->hhh] + = ''; // set incase no extra site folder are loaded - $this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FOLDERS' . $this->hhh] = ''; + $this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FOLDERS' + . $this->hhh] + = ''; // set incase no extra media folder are loaded - $this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] = ''; + $this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' + . $this->hhh] + = ''; // set incase no extra admin files are loaded - $this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FILES' . $this->hhh] = ''; + $this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FILES' + . $this->hhh] + = ''; // set incase no extra site files are loaded - $this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FILES' . $this->hhh] = ''; + $this->fileContentStatic[$this->hhh . 'EXSTRA_SITE_FILES' + . $this->hhh] + = ''; // set incase no extra media files are loaded - $this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FILES' . $this->hhh] = ''; + $this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FILES' + . $this->hhh] + = ''; // run global updater ComponentbuilderHelper::runGlobalUpdater(); // set the template path - $this->templatePath = $this->compilerPath . '/joomla_' . $config['version']; + $this->templatePath = $this->compilerPath . '/joomla_' + . $config['version']; // set some default names - $this->componentSalesName = 'com_' . $this->componentData->sales_name . '__J' . $this->joomlaVersion; - $this->componentBackupName = 'com_' . $this->componentData->sales_name . '_v' . str_replace('.', '_', $this->componentData->component_version) . '__J' . $this->joomlaVersion; - $this->componentFolderName = 'com_' . $this->componentData->name_code . '_v' . str_replace('.', '_', $this->componentData->component_version) . '__J' . $this->joomlaVersion; + $this->componentSalesName = 'com_' + . $this->componentData->sales_name . '__J' + . $this->joomlaVersion; + $this->componentBackupName = 'com_' + . $this->componentData->sales_name . '_v' . str_replace( + '.', '_', $this->componentData->component_version + ) . '__J' . $this->joomlaVersion; + $this->componentFolderName = 'com_' + . $this->componentData->name_code . '_v' . str_replace( + '.', '_', $this->componentData->component_version + ) . '__J' . $this->joomlaVersion; // set component folder path - $this->componentPath = $this->compilerPath . '/' . $this->componentFolderName; + $this->componentPath = $this->compilerPath . '/' + . $this->componentFolderName; // set the template path for custom - $this->templatePathCustom = $this->params->get('custom_folder_path', JPATH_COMPONENT_ADMINISTRATOR . '/custom'); + $this->templatePathCustom = $this->params->get( + 'custom_folder_path', JPATH_COMPONENT_ADMINISTRATOR . '/custom' + ); // make sure there is no old build $this->removeFolder($this->componentPath); // load the libraries files/folders and url's @@ -392,7 +418,10 @@ class Structure extends Get // set the Joomla Version Data $this->joomlaVersionData = $this->setJoomlaVersionData(); // Trigger Event: jcb_ce_onAfterSetJoomlaVersionData - $this->triggerEvent('jcb_ce_onAfterSetJoomlaVersionData', array(&$this->componentContext, &$this->joomlaVersionData)); + $this->triggerEvent( + 'jcb_ce_onAfterSetJoomlaVersionData', + array(&$this->componentContext, &$this->joomlaVersionData) + ); // set the dashboard $this->setDynamicDashboard(); // set the new folders @@ -410,18 +439,20 @@ class Structure extends Get { return false; } + return true; } + return false; } /** * Set the line number in comments - * - * @param int $nr The line number - * + * + * @param int $nr The line number + * * @return string - * + * */ private function setLine($nr) { @@ -429,6 +460,7 @@ class Structure extends Get { return ' [Structure ' . $nr . ']'; } + return ''; } @@ -443,14 +475,21 @@ class Structure extends Get if (ComponentbuilderHelper::checkArray($this->joomlaModules)) { // Trigger Event: jcb_ce_onBeforeSetModules - $this->triggerEvent('jcb_ce_onBeforeBuildModules', array(&$this->componentContext, &$this->joomlaModules)); + $this->triggerEvent( + 'jcb_ce_onBeforeBuildModules', + array(&$this->componentContext, &$this->joomlaModules) + ); foreach ($this->joomlaModules as $module) { - if (ComponentbuilderHelper::checkObject($module) && isset($module->folder_name) - && ComponentbuilderHelper::checkString($module->folder_name)) + if (ComponentbuilderHelper::checkObject($module) + && isset($module->folder_name) + && ComponentbuilderHelper::checkString( + $module->folder_name + )) { // module path - $module->folder_path = $this->compilerPath . '/' . $module->folder_name; + $module->folder_path = $this->compilerPath . '/' + . $module->folder_name; // set the module paths $this->dynamicPaths[$module->key] = $module->folder_path; // make sure there is no old build @@ -461,35 +500,52 @@ class Structure extends Get JFolder::create($module->folder_path); // count the folder created $this->folderCount++; - $this->indexHTML($module->folder_name, $this->compilerPath); + $this->indexHTML( + $module->folder_name, $this->compilerPath + ); } // set main mod file - $fileDetails = array('path' => $module->folder_path . '/' . $module->file_name . '.php', - 'name' => $module->file_name . '.php', 'zip' => $module->file_name . '.php'); - $this->writeFile($fileDetails['path'], + $fileDetails = array('path' => $module->folder_path . '/' + . $module->file_name . '.php', + 'name' => $module->file_name . '.php', + 'zip' => $module->file_name . '.php'); + $this->writeFile( + $fileDetails['path'], 'hhh . 'BOM' . $this->hhh . PHP_EOL . PHP_EOL . '// No direct access to this file' . PHP_EOL . - "defined('_JEXEC') or die('Restricted access');" . PHP_EOL . - $this->hhh . 'MODCODE' . $this->hhh); + "defined('_JEXEC') or die('Restricted access');" + . PHP_EOL . + $this->hhh . 'MODCODE' . $this->hhh + ); $this->newFiles[$module->key][] = $fileDetails; // count the file created $this->fileCount++; // set custom_get if ($module->custom_get) { - $fileDetails = array('path' => $module->folder_path . '/data.php', - 'name' => 'data.php', 'zip' => 'data.php'); - $this->writeFile($fileDetails['path'], + $fileDetails = array('path' => $module->folder_path + . '/data.php', + 'name' => 'data.php', + 'zip' => 'data.php'); + $this->writeFile( + $fileDetails['path'], 'hhh . 'BOM' . $this->hhh . PHP_EOL . - PHP_EOL . '// No direct access to this file' . PHP_EOL . - "defined('_JEXEC') or die('Restricted access');" . PHP_EOL . PHP_EOL . + PHP_EOL . $this->hhh . 'BOM' . $this->hhh . PHP_EOL + . + PHP_EOL . '// No direct access to this file' + . PHP_EOL . + "defined('_JEXEC') or die('Restricted access');" + . PHP_EOL . PHP_EOL . '/**' . PHP_EOL . - ' * Module ' . $module->official_name . ' Data' . PHP_EOL . + ' * Module ' . $module->official_name . ' Data' + . PHP_EOL . ' */' . PHP_EOL . - "class " . $module->class_data_name . ' extends \JObject' . PHP_EOL . - "{" . $this->hhh . 'DYNAMICGETS' . $this->hhh . "}" . PHP_EOL); + "class " . $module->class_data_name + . ' extends \JObject' . PHP_EOL . + "{" . $this->hhh . 'DYNAMICGETS' . $this->hhh . "}" + . PHP_EOL + ); $this->newFiles[$module->key][] = $fileDetails; // count the file created $this->fileCount++; @@ -497,22 +553,34 @@ class Structure extends Get // set helper file if ($module->add_class_helper >= 1) { - $fileDetails = array('path' => $module->folder_path . '/helper.php', - 'name' => 'helper.php', 'zip' => 'helper.php'); - $this->writeFile($fileDetails['path'], + $fileDetails = array('path' => $module->folder_path + . '/helper.php', + 'name' => 'helper.php', + 'zip' => 'helper.php'); + $this->writeFile( + $fileDetails['path'], 'hhh . 'BOM' . $this->hhh . PHP_EOL . - PHP_EOL . '// No direct access to this file' . PHP_EOL . - "defined('_JEXEC') or die('Restricted access');" . PHP_EOL . - $this->hhh . 'HELPERCODE' . $this->hhh); + PHP_EOL . $this->hhh . 'BOM' . $this->hhh . PHP_EOL + . + PHP_EOL . '// No direct access to this file' + . PHP_EOL . + "defined('_JEXEC') or die('Restricted access');" + . PHP_EOL . + $this->hhh . 'HELPERCODE' . $this->hhh + ); $this->newFiles[$module->key][] = $fileDetails; // count the file created $this->fileCount++; } // set main xml file - $fileDetails = array('path' => $module->folder_path . '/' . $module->file_name . '.xml', - 'name' => $module->file_name . '.xml', 'zip' => $module->file_name . '.xml'); - $this->writeFile($fileDetails['path'], $this->getModuleXMLTemplate($module)); + $fileDetails = array('path' => $module->folder_path . '/' + . $module->file_name . '.xml', + 'name' => $module->file_name . '.xml', + 'zip' => $module->file_name . '.xml'); + $this->writeFile( + $fileDetails['path'], + $this->getModuleXMLTemplate($module) + ); $this->newFiles[$module->key][] = $fileDetails; // count the file created $this->fileCount++; @@ -522,31 +590,45 @@ class Structure extends Get JFolder::create($module->folder_path . '/tmpl'); // count the folder created $this->folderCount++; - $this->indexHTML($module->folder_name . '/tmpl', $this->compilerPath); + $this->indexHTML( + $module->folder_name . '/tmpl', $this->compilerPath + ); } // set default file - $fileDetails = array('path' => $module->folder_path . '/tmpl/default.php', - 'name' => 'default.php', 'zip' => 'tmpl/default.php'); - $this->writeFile($fileDetails['path'], + $fileDetails = array('path' => $module->folder_path + . '/tmpl/default.php', + 'name' => 'default.php', + 'zip' => 'tmpl/default.php'); + $this->writeFile( + $fileDetails['path'], 'hhh . 'BOM' . $this->hhh . PHP_EOL . PHP_EOL . '// No direct access to this file' . PHP_EOL . - "defined('_JEXEC') or die('Restricted access');" . PHP_EOL . - $this->hhh . 'MODDEFAULT' . $this->hhh); + "defined('_JEXEC') or die('Restricted access');" + . PHP_EOL . + $this->hhh . 'MODDEFAULT' . $this->hhh + ); $this->newFiles[$module->key][] = $fileDetails; // count the file created $this->fileCount++; // set install script if needed if ($module->add_install_script) { - $fileDetails = array('path' => $module->folder_path . '/script.php', - 'name' => 'script.php', 'zip' => 'script.php'); - $this->writeFile($fileDetails['path'], + $fileDetails = array('path' => $module->folder_path + . '/script.php', + 'name' => 'script.php', + 'zip' => 'script.php'); + $this->writeFile( + $fileDetails['path'], 'hhh . 'BOM' . $this->hhh . PHP_EOL . - PHP_EOL . '// No direct access to this file' . PHP_EOL . - "defined('_JEXEC') or die('Restricted access');" . PHP_EOL . - $this->hhh . 'INSTALLCLASS' . $this->hhh); + PHP_EOL . $this->hhh . 'BOM' . $this->hhh . PHP_EOL + . + PHP_EOL . '// No direct access to this file' + . PHP_EOL . + "defined('_JEXEC') or die('Restricted access');" + . PHP_EOL . + $this->hhh . 'INSTALLCLASS' . $this->hhh + ); $this->newFiles[$module->key][] = $fileDetails; // count the file created $this->fileCount++; @@ -554,15 +636,18 @@ class Structure extends Get // set readme if found if ($module->addreadme) { - $fileDetails = array('path' => $module->folder_path . '/README.md', - 'name' => 'README.md', 'zip' => 'README.md'); + $fileDetails = array('path' => $module->folder_path + . '/README.md', + 'name' => 'README.md', + 'zip' => 'README.md'); $this->writeFile($fileDetails['path'], $module->readme); $this->newFiles[$module->key][] = $fileDetails; // count the file created $this->fileCount++; } // set fields & rules folders if needed - if (isset($module->fields_rules_paths) && $module->fields_rules_paths == 2) + if (isset($module->fields_rules_paths) + && $module->fields_rules_paths == 2) { // create fields folder if (!JFolder::exists($module->folder_path . '/fields')) @@ -570,7 +655,10 @@ class Structure extends Get JFolder::create($module->folder_path . '/fields'); // count the folder created $this->folderCount++; - $this->indexHTML($module->folder_name . '/fields', $this->compilerPath); + $this->indexHTML( + $module->folder_name . '/fields', + $this->compilerPath + ); } // create rules folder if (!JFolder::exists($module->folder_path . '/rules')) @@ -578,11 +666,17 @@ class Structure extends Get JFolder::create($module->folder_path . '/rules'); // count the folder created $this->folderCount++; - $this->indexHTML($module->folder_name . '/rules', $this->compilerPath); + $this->indexHTML( + $module->folder_name . '/rules', + $this->compilerPath + ); } } // set forms folder if needed - if (isset($module->form_files) && ComponentbuilderHelper::checkArray($module->form_files)) + if (isset($module->form_files) + && ComponentbuilderHelper::checkArray( + $module->form_files + )) { // create forms folder if (!JFolder::exists($module->folder_path . '/forms')) @@ -590,17 +684,26 @@ class Structure extends Get JFolder::create($module->folder_path . '/forms'); // count the folder created $this->folderCount++; - $this->indexHTML($module->folder_name . '/forms', $this->compilerPath); + $this->indexHTML( + $module->folder_name . '/forms', + $this->compilerPath + ); } // set the template files - foreach($module->form_files as $file => $fields) + foreach ($module->form_files as $file => $fields) { // set file details - $fileDetails = array('path' => $module->folder_path . '/forms/' . $file . '.xml', - 'name' => $file . '.xml', 'zip' => 'forms/' . $file . '.xml'); + $fileDetails = array('path' => $module->folder_path + . '/forms/' . $file . '.xml', + 'name' => $file . '.xml', + 'zip' => 'forms/' . $file + . '.xml'); // biuld basic XML $xml = ''; - $xml .= PHP_EOL . ''; + $xml .= PHP_EOL . ''; // search if we must add the component path $add_component_path = false; foreach ($fields as $field_name => $fieldsets) @@ -609,7 +712,13 @@ class Structure extends Get { foreach ($fieldsets as $fieldset => $field) { - if (!$add_component_path && isset($module->fieldsets_paths[$file . $field_name . $fieldset]) && $module->fieldsets_paths[$file . $field_name . $fieldset] == 1) + if (!$add_component_path + && isset( + $module->fieldsets_paths[$file + . $field_name . $fieldset] + ) + && $module->fieldsets_paths[$file + . $field_name . $fieldset] == 1) { $add_component_path = true; } @@ -620,8 +729,14 @@ class Structure extends Get if ($add_component_path) { $xml .= PHP_EOL . '_t(1) . 'addrulepath="/administrator/components/com_' . $this->componentCodeName . '/models/rules"'; - $xml .= PHP_EOL . $this->_t(1) . 'addfieldpath="/administrator/components/com_' . $this->componentCodeName . '/models/fields"'; + $xml .= PHP_EOL . $this->_t(1) + . 'addrulepath="/administrator/components/com_' + . $this->componentCodeName + . '/models/rules"'; + $xml .= PHP_EOL . $this->_t(1) + . 'addfieldpath="/administrator/components/com_' + . $this->componentCodeName + . '/models/fields"'; $xml .= PHP_EOL . '>'; } else @@ -643,41 +758,74 @@ class Structure extends Get $field_name_inner = $field_names[1]; } } - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . $this->_t(1) + . ''; foreach ($fieldsets as $fieldset => $field) { // default to the field set name $label = $fieldset; - if (isset($module->fieldsets_label[$file.$field_name.$fieldset])) + if (isset( + $module->fieldsets_label[$file + . $field_name . $fieldset] + )) { - $label = $module->fieldsets_label[$file.$field_name.$fieldset]; + $label = $module->fieldsets_label[$file + . $field_name . $fieldset]; } // add path to module rules and custom fields - if (isset($module->fieldsets_paths[$file.$field_name.$fieldset]) && $module->fieldsets_paths[$file.$field_name.$fieldset] == 2) + if (isset( + $module->fieldsets_paths[$file + . $field_name . $fieldset] + ) + && $module->fieldsets_paths[$file + . $field_name . $fieldset] == 2) { - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . '
_t(2) . 'addrulepath="/modules/' . strtolower($module->code_name) . '/rules"'; - $xml .= PHP_EOL . $this->_t(2) . 'addfieldpath="/modules/' . strtolower($module->code_name) . '/fields"'; + $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . $this->_t(1) + . '
_t(2) + . 'addrulepath="/modules/' + . strtolower($module->code_name) + . '/rules"'; + $xml .= PHP_EOL . $this->_t(2) + . 'addfieldpath="/modules/' + . strtolower($module->code_name) + . '/fields"'; $xml .= PHP_EOL . $this->_t(1) . '>'; } else { - $xml .= PHP_EOL . $this->_t(1) . '
'; + $xml .= PHP_EOL . $this->_t(1) + . '
'; } // check if we have an inner field set - if (ComponentbuilderHelper::checkString($field_name_inner)) + if (ComponentbuilderHelper::checkString( + $field_name_inner + )) { - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . $this->_t(1) + . ''; } // add the placeholder of the fields - $xml .= $this->hhh . 'FIELDSET_' . $file.$field_name.$fieldset . $this->hhh; + $xml .= $this->hhh . 'FIELDSET_' . $file + . $field_name . $fieldset . $this->hhh; // check if we have an inner field set - if (ComponentbuilderHelper::checkString($field_name_inner)) + if (ComponentbuilderHelper::checkString( + $field_name_inner + )) { - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . $this->_t(1) + . ''; } - $xml .= PHP_EOL . $this->_t(1) . '
'; + $xml .= PHP_EOL . $this->_t(1) + . '
'; } $xml .= PHP_EOL . $this->_t(1) . ''; } @@ -698,27 +846,44 @@ class Structure extends Get JFolder::create($module->folder_path . '/sql'); // count the folder created $this->folderCount++; - $this->indexHTML($module->folder_name . '/sql', $this->compilerPath); + $this->indexHTML( + $module->folder_name . '/sql', + $this->compilerPath + ); } // create mysql folder - if (!JFolder::exists($module->folder_path . '/sql/mysql')) + if (!JFolder::exists( + $module->folder_path . '/sql/mysql' + )) { - JFolder::create($module->folder_path . '/sql/mysql'); + JFolder::create( + $module->folder_path . '/sql/mysql' + ); // count the folder created $this->folderCount++; - $this->indexHTML($module->folder_name . '/sql/mysql', $this->compilerPath); + $this->indexHTML( + $module->folder_name . '/sql/mysql', + $this->compilerPath + ); } // now set the install file if ($module->add_sql) { - $this->writeFile($module->folder_path . '/sql/mysql/install.sql', $module->sql); + $this->writeFile( + $module->folder_path . '/sql/mysql/install.sql', + $module->sql + ); // count the file created $this->fileCount++; } // now set the uninstall file if ($module->add_sql_uninstall) { - $this->writeFile($module->folder_path . '/sql/mysql/uninstall.sql', $module->sql_uninstall); + $this->writeFile( + $module->folder_path + . '/sql/mysql/uninstall.sql', + $module->sql_uninstall + ); // count the file created $this->fileCount++; } @@ -730,51 +895,64 @@ class Structure extends Get // count the folder created $this->folderCount++; // also the lang tag - if (!JFolder::exists($module->folder_path . '/language/' . $this->langTag)) + if (!JFolder::exists( + $module->folder_path . '/language/' . $this->langTag + )) { - JFolder::create($module->folder_path . '/language/' . $this->langTag); + JFolder::create( + $module->folder_path . '/language/' + . $this->langTag + ); // count the folder created $this->folderCount++; } } // check if this lib has files - if (isset($module->files) && ComponentbuilderHelper::checkArray($module->files)) + if (isset($module->files) + && ComponentbuilderHelper::checkArray($module->files)) { // add to component files foreach ($module->files as $file) { // set the path finder - $file['target_type'] = $module->target_type; - $file['target_id'] = $module->id; + $file['target_type'] = $module->target_type; + $file['target_id'] = $module->id; $this->componentData->files[] = $file; } } // check if this lib has folders - if (isset($module->folders) && ComponentbuilderHelper::checkArray($module->folders)) + if (isset($module->folders) + && ComponentbuilderHelper::checkArray($module->folders)) { // add to component folders foreach ($module->folders as $folder) { // set the path finder - $folder['target_type'] = $module->target_type; - $folder['target_id'] = $module->id; + $folder['target_type'] = $module->target_type; + $folder['target_id'] = $module->id; $this->componentData->folders[] = $folder; } } // check if this module has urls - if (isset($module->urls) && ComponentbuilderHelper::checkArray($module->urls)) + if (isset($module->urls) + && ComponentbuilderHelper::checkArray($module->urls)) { // add to component urls foreach ($module->urls as $n => &$url) { // should we add the local folder - if (isset($url['type']) && $url['type'] > 1 && isset($url['url']) - && ComponentbuilderHelper::checkString($url['url'])) + if (isset($url['type']) && $url['type'] > 1 + && isset($url['url']) + && ComponentbuilderHelper::checkString( + $url['url'] + )) { // set file name $fileName = basename($url['url']); // get the file contents - $data = ComponentbuilderHelper::getFileContents($url['url']); + $data = ComponentbuilderHelper::getFileContents( + $url['url'] + ); // build sub path if (strpos($fileName, '.js') !== false) { @@ -789,15 +967,23 @@ class Structure extends Get $path = ''; } // create sub media path if not set - if (!JFolder::exists($module->folder_path .$path)) + if (!JFolder::exists( + $module->folder_path . $path + )) { - JFolder::create($module->folder_path . $path); + JFolder::create( + $module->folder_path . $path + ); // count the folder created $this->folderCount++; - $this->indexHTML($module->folder_name . $path, $this->compilerPath); + $this->indexHTML( + $module->folder_name . $path, + $this->compilerPath + ); } // set the path to module file - $url['path'] = $module->folder_path . $path . '/' . $fileName; // we need this for later + $url['path'] = $module->folder_path . $path + . '/' . $fileName; // we need this for later // write data to path $this->writeFile($url['path'], $data); // count the file created @@ -812,23 +998,30 @@ class Structure extends Get /** * Build the Plugins files, folders, url's and config - * + * * @return void - * + * */ private function buildPlugins() { if (ComponentbuilderHelper::checkArray($this->joomlaPlugins)) { // Trigger Event: jcb_ce_onBeforeSetPlugins - $this->triggerEvent('jcb_ce_onBeforeBuildPlugins', array(&$this->componentContext, &$this->joomlaPlugins)); + $this->triggerEvent( + 'jcb_ce_onBeforeBuildPlugins', + array(&$this->componentContext, &$this->joomlaPlugins) + ); foreach ($this->joomlaPlugins as $plugin) { - if (ComponentbuilderHelper::checkObject($plugin) && isset($plugin->folder_name) - && ComponentbuilderHelper::checkString($plugin->folder_name)) + if (ComponentbuilderHelper::checkObject($plugin) + && isset($plugin->folder_name) + && ComponentbuilderHelper::checkString( + $plugin->folder_name + )) { // plugin path - $plugin->folder_path = $this->compilerPath . '/' . $plugin->folder_name; + $plugin->folder_path = $this->compilerPath . '/' + . $plugin->folder_name; // set the plugin paths $this->dynamicPaths[$plugin->key] = $plugin->folder_path; // make sure there is no old build @@ -839,38 +1032,57 @@ class Structure extends Get JFolder::create($plugin->folder_path); // count the folder created $this->folderCount++; - $this->indexHTML($plugin->folder_name, $this->compilerPath); + $this->indexHTML( + $plugin->folder_name, $this->compilerPath + ); } // set main class file - $fileDetails = array('path' => $plugin->folder_path . '/' . $plugin->file_name . '.php', - 'name' => $plugin->file_name . '.php', 'zip' => $plugin->file_name . '.php'); - $this->writeFile($fileDetails['path'], + $fileDetails = array('path' => $plugin->folder_path . '/' + . $plugin->file_name . '.php', + 'name' => $plugin->file_name . '.php', + 'zip' => $plugin->file_name . '.php'); + $this->writeFile( + $fileDetails['path'], 'hhh . 'BOM' . $this->hhh . PHP_EOL . PHP_EOL . '// No direct access to this file' . PHP_EOL . - "defined('_JEXEC') or die('Restricted access');" . PHP_EOL . - $this->hhh . 'MAINCLASS' . $this->hhh); + "defined('_JEXEC') or die('Restricted access');" + . PHP_EOL . + $this->hhh . 'MAINCLASS' . $this->hhh + ); $this->newFiles[$plugin->key][] = $fileDetails; // count the file created $this->fileCount++; // set main xml file - $fileDetails = array('path' => $plugin->folder_path . '/' . $plugin->file_name . '.xml', - 'name' => $plugin->file_name . '.xml', 'zip' => $plugin->file_name . '.xml'); - $this->writeFile($fileDetails['path'], $this->getPluginXMLTemplate($plugin)); + $fileDetails = array('path' => $plugin->folder_path . '/' + . $plugin->file_name . '.xml', + 'name' => $plugin->file_name . '.xml', + 'zip' => $plugin->file_name . '.xml'); + $this->writeFile( + $fileDetails['path'], + $this->getPluginXMLTemplate($plugin) + ); $this->newFiles[$plugin->key][] = $fileDetails; // count the file created $this->fileCount++; // set install script if needed if ($plugin->add_install_script) { - $fileDetails = array('path' => $plugin->folder_path . '/script.php', - 'name' => 'script.php', 'zip' => 'script.php'); - $this->writeFile($fileDetails['path'], + $fileDetails = array('path' => $plugin->folder_path + . '/script.php', + 'name' => 'script.php', + 'zip' => 'script.php'); + $this->writeFile( + $fileDetails['path'], 'hhh . 'BOM' . $this->hhh . PHP_EOL . - PHP_EOL . '// No direct access to this file' . PHP_EOL . - "defined('_JEXEC') or die('Restricted access');" . PHP_EOL . - $this->hhh . 'INSTALLCLASS' . $this->hhh); + PHP_EOL . $this->hhh . 'BOM' . $this->hhh . PHP_EOL + . + PHP_EOL . '// No direct access to this file' + . PHP_EOL . + "defined('_JEXEC') or die('Restricted access');" + . PHP_EOL . + $this->hhh . 'INSTALLCLASS' . $this->hhh + ); $this->newFiles[$plugin->key][] = $fileDetails; // count the file created $this->fileCount++; @@ -878,15 +1090,18 @@ class Structure extends Get // set readme if found if ($plugin->addreadme) { - $fileDetails = array('path' => $plugin->folder_path . '/README.md', - 'name' => 'README.md', 'zip' => 'README.md'); + $fileDetails = array('path' => $plugin->folder_path + . '/README.md', + 'name' => 'README.md', + 'zip' => 'README.md'); $this->writeFile($fileDetails['path'], $plugin->readme); $this->newFiles[$plugin->key][] = $fileDetails; // count the file created $this->fileCount++; } // set fields & rules folders if needed - if (isset($plugin->fields_rules_paths) && $plugin->fields_rules_paths == 2) + if (isset($plugin->fields_rules_paths) + && $plugin->fields_rules_paths == 2) { // create fields folder if (!JFolder::exists($plugin->folder_path . '/fields')) @@ -894,7 +1109,10 @@ class Structure extends Get JFolder::create($plugin->folder_path . '/fields'); // count the folder created $this->folderCount++; - $this->indexHTML($plugin->folder_name . '/fields', $this->compilerPath); + $this->indexHTML( + $plugin->folder_name . '/fields', + $this->compilerPath + ); } // create rules folder if (!JFolder::exists($plugin->folder_path . '/rules')) @@ -902,11 +1120,17 @@ class Structure extends Get JFolder::create($plugin->folder_path . '/rules'); // count the folder created $this->folderCount++; - $this->indexHTML($plugin->folder_name . '/rules', $this->compilerPath); + $this->indexHTML( + $plugin->folder_name . '/rules', + $this->compilerPath + ); } } // set forms folder if needed - if (isset($plugin->form_files) && ComponentbuilderHelper::checkArray($plugin->form_files)) + if (isset($plugin->form_files) + && ComponentbuilderHelper::checkArray( + $plugin->form_files + )) { // create forms folder if (!JFolder::exists($plugin->folder_path . '/forms')) @@ -914,17 +1138,26 @@ class Structure extends Get JFolder::create($plugin->folder_path . '/forms'); // count the folder created $this->folderCount++; - $this->indexHTML($plugin->folder_name . '/forms', $this->compilerPath); + $this->indexHTML( + $plugin->folder_name . '/forms', + $this->compilerPath + ); } // set the template files - foreach($plugin->form_files as $file => $fields) + foreach ($plugin->form_files as $file => $fields) { // set file details - $fileDetails = array('path' => $plugin->folder_path . '/forms/' . $file . '.xml', - 'name' => $file . '.xml', 'zip' => 'forms/' . $file . '.xml'); + $fileDetails = array('path' => $plugin->folder_path + . '/forms/' . $file . '.xml', + 'name' => $file . '.xml', + 'zip' => 'forms/' . $file + . '.xml'); // biuld basic XML $xml = ''; - $xml .= PHP_EOL . ''; + $xml .= PHP_EOL . ''; // search if we must add the component path $add_component_path = false; foreach ($fields as $field_name => $fieldsets) @@ -933,7 +1166,13 @@ class Structure extends Get { foreach ($fieldsets as $fieldset => $field) { - if (!$add_component_path && isset($plugin->fieldsets_paths[$file . $field_name . $fieldset]) && $plugin->fieldsets_paths[$file . $field_name . $fieldset] == 1) + if (!$add_component_path + && isset( + $plugin->fieldsets_paths[$file + . $field_name . $fieldset] + ) + && $plugin->fieldsets_paths[$file + . $field_name . $fieldset] == 1) { $add_component_path = true; } @@ -944,8 +1183,14 @@ class Structure extends Get if ($add_component_path) { $xml .= PHP_EOL . '_t(1) . 'addrulepath="/administrator/components/com_' . $this->componentCodeName . '/models/rules"'; - $xml .= PHP_EOL . $this->_t(1) . 'addfieldpath="/administrator/components/com_' . $this->componentCodeName . '/models/fields"'; + $xml .= PHP_EOL . $this->_t(1) + . 'addrulepath="/administrator/components/com_' + . $this->componentCodeName + . '/models/rules"'; + $xml .= PHP_EOL . $this->_t(1) + . 'addfieldpath="/administrator/components/com_' + . $this->componentCodeName + . '/models/fields"'; $xml .= PHP_EOL . '>'; } else @@ -967,41 +1212,76 @@ class Structure extends Get $field_name_inner = $field_names[1]; } } - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . $this->_t(1) + . ''; foreach ($fieldsets as $fieldset => $field) { // default to the field set name $label = $fieldset; - if (isset($plugin->fieldsets_label[$file.$field_name.$fieldset])) + if (isset( + $plugin->fieldsets_label[$file + . $field_name . $fieldset] + )) { - $label = $plugin->fieldsets_label[$file.$field_name.$fieldset]; + $label = $plugin->fieldsets_label[$file + . $field_name . $fieldset]; } // add path to plugin rules and custom fields - if (isset($plugin->fieldsets_paths[$file.$field_name.$fieldset]) && $plugin->fieldsets_paths[$file.$field_name.$fieldset] == 2) + if (isset( + $plugin->fieldsets_paths[$file + . $field_name . $fieldset] + ) + && $plugin->fieldsets_paths[$file + . $field_name . $fieldset] == 2) { - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . '
_t(2) . 'addrulepath="/plugins/' . strtolower($plugin->group) . '/' . strtolower($plugin->code_name) . '/rules"'; - $xml .= PHP_EOL . $this->_t(2) . 'addfieldpath="/plugins/' . strtolower($plugin->group) . '/' . strtolower($plugin->code_name) . '/fields"'; + $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . $this->_t(1) + . '
_t(2) + . 'addrulepath="/plugins/' + . strtolower($plugin->group) . '/' + . strtolower($plugin->code_name) + . '/rules"'; + $xml .= PHP_EOL . $this->_t(2) + . 'addfieldpath="/plugins/' + . strtolower($plugin->group) . '/' + . strtolower($plugin->code_name) + . '/fields"'; $xml .= PHP_EOL . $this->_t(1) . '>'; } else { - $xml .= PHP_EOL . $this->_t(1) . '
'; + $xml .= PHP_EOL . $this->_t(1) + . '
'; } // check if we have an inner field set - if (ComponentbuilderHelper::checkString($field_name_inner)) + if (ComponentbuilderHelper::checkString( + $field_name_inner + )) { - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . $this->_t(1) + . ''; } // add the placeholder of the fields - $xml .= $this->hhh . 'FIELDSET_' . $file.$field_name.$fieldset . $this->hhh; + $xml .= $this->hhh . 'FIELDSET_' . $file + . $field_name . $fieldset . $this->hhh; // check if we have an inner field set - if (ComponentbuilderHelper::checkString($field_name_inner)) + if (ComponentbuilderHelper::checkString( + $field_name_inner + )) { - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . $this->_t(1) + . ''; } - $xml .= PHP_EOL . $this->_t(1) . '
'; + $xml .= PHP_EOL . $this->_t(1) + . '
'; } $xml .= PHP_EOL . $this->_t(1) . ''; } @@ -1022,27 +1302,44 @@ class Structure extends Get JFolder::create($plugin->folder_path . '/sql'); // count the folder created $this->folderCount++; - $this->indexHTML($plugin->folder_name . '/sql', $this->compilerPath); + $this->indexHTML( + $plugin->folder_name . '/sql', + $this->compilerPath + ); } // create mysql folder - if (!JFolder::exists($plugin->folder_path . '/sql/mysql')) + if (!JFolder::exists( + $plugin->folder_path . '/sql/mysql' + )) { - JFolder::create($plugin->folder_path . '/sql/mysql'); + JFolder::create( + $plugin->folder_path . '/sql/mysql' + ); // count the folder created $this->folderCount++; - $this->indexHTML($plugin->folder_name . '/sql/mysql', $this->compilerPath); + $this->indexHTML( + $plugin->folder_name . '/sql/mysql', + $this->compilerPath + ); } // now set the install file if ($plugin->add_sql) { - $this->writeFile($plugin->folder_path . '/sql/mysql/install.sql', $plugin->sql); + $this->writeFile( + $plugin->folder_path . '/sql/mysql/install.sql', + $plugin->sql + ); // count the file created $this->fileCount++; } // now set the uninstall file if ($plugin->add_sql_uninstall) { - $this->writeFile($plugin->folder_path . '/sql/mysql/uninstall.sql', $plugin->sql_uninstall); + $this->writeFile( + $plugin->folder_path + . '/sql/mysql/uninstall.sql', + $plugin->sql_uninstall + ); // count the file created $this->fileCount++; } @@ -1054,51 +1351,64 @@ class Structure extends Get // count the folder created $this->folderCount++; // also the lang tag - if (!JFolder::exists($plugin->folder_path . '/language/' . $this->langTag)) + if (!JFolder::exists( + $plugin->folder_path . '/language/' . $this->langTag + )) { - JFolder::create($plugin->folder_path . '/language/' . $this->langTag); + JFolder::create( + $plugin->folder_path . '/language/' + . $this->langTag + ); // count the folder created $this->folderCount++; } } // check if this lib has files - if (isset($plugin->files) && ComponentbuilderHelper::checkArray($plugin->files)) + if (isset($plugin->files) + && ComponentbuilderHelper::checkArray($plugin->files)) { // add to component files foreach ($plugin->files as $file) { // set the path finder - $file['target_type'] = $plugin->target_type; - $file['target_id'] = $plugin->id; + $file['target_type'] = $plugin->target_type; + $file['target_id'] = $plugin->id; $this->componentData->files[] = $file; } } // check if this lib has folders - if (isset($plugin->folders) && ComponentbuilderHelper::checkArray($plugin->folders)) + if (isset($plugin->folders) + && ComponentbuilderHelper::checkArray($plugin->folders)) { // add to component folders foreach ($plugin->folders as $folder) { // set the path finder - $folder['target_type'] = $plugin->target_type; - $folder['target_id'] = $plugin->id; + $folder['target_type'] = $plugin->target_type; + $folder['target_id'] = $plugin->id; $this->componentData->folders[] = $folder; } } // check if this plugin has urls - if (isset($plugin->urls) && ComponentbuilderHelper::checkArray($plugin->urls)) + if (isset($plugin->urls) + && ComponentbuilderHelper::checkArray($plugin->urls)) { // add to component urls foreach ($plugin->urls as $n => &$url) { // should we add the local folder - if (isset($url['type']) && $url['type'] > 1 && isset($url['url']) - && ComponentbuilderHelper::checkString($url['url'])) + if (isset($url['type']) && $url['type'] > 1 + && isset($url['url']) + && ComponentbuilderHelper::checkString( + $url['url'] + )) { // set file name $fileName = basename($url['url']); // get the file contents - $data = ComponentbuilderHelper::getFileContents($url['url']); + $data = ComponentbuilderHelper::getFileContents( + $url['url'] + ); // build sub path if (strpos($fileName, '.js') !== false) { @@ -1113,15 +1423,23 @@ class Structure extends Get $path = ''; } // create sub media path if not set - if (!JFolder::exists($plugin->folder_path .$path)) + if (!JFolder::exists( + $plugin->folder_path . $path + )) { - JFolder::create($plugin->folder_path . $path); + JFolder::create( + $plugin->folder_path . $path + ); // count the folder created $this->folderCount++; - $this->indexHTML($plugin->folder_name . $path, $this->compilerPath); + $this->indexHTML( + $plugin->folder_name . $path, + $this->compilerPath + ); } // set the path to plugin file - $url['path'] = $plugin->folder_path . $path . '/' . $fileName; // we need this for later + $url['path'] = $plugin->folder_path . $path + . '/' . $fileName; // we need this for later // write data to path $this->writeFile($url['path'], $data); // count the file created @@ -1136,16 +1454,19 @@ class Structure extends Get /** * Build the Libraries files, folders, url's and config - * + * * @return void - * + * */ private function setLibraries() { if (ComponentbuilderHelper::checkArray($this->libraries)) { // Trigger Event: jcb_ce_onBeforeSetLibraries - $this->triggerEvent('jcb_ce_onBeforeSetLibraries', array(&$this->componentContext, &$this->libraries)); + $this->triggerEvent( + 'jcb_ce_onBeforeSetLibraries', + array(&$this->componentContext, &$this->libraries) + ); // creat the main component folder if (!JFolder::exists($this->componentPath)) { @@ -1167,7 +1488,8 @@ class Structure extends Get if (ComponentbuilderHelper::checkObject($library)) { // check if this lib has files - if (isset($library->files) && ComponentbuilderHelper::checkArray($library->files)) + if (isset($library->files) + && ComponentbuilderHelper::checkArray($library->files)) { // add to component files foreach ($library->files as $file) @@ -1176,7 +1498,10 @@ class Structure extends Get } } // check if this lib has folders - if (isset($library->folders) && ComponentbuilderHelper::checkArray($library->folders)) + if (isset($library->folders) + && ComponentbuilderHelper::checkArray( + $library->folders + )) { // add to component folders foreach ($library->folders as $folder) @@ -1185,22 +1510,38 @@ class Structure extends Get } } // check if this lib has urls - if (isset($library->urls) && ComponentbuilderHelper::checkArray($library->urls)) + if (isset($library->urls) + && ComponentbuilderHelper::checkArray($library->urls)) { // build media folder path - $libFolder = strtolower(preg_replace('/\s+/', '-', ComponentbuilderHelper::safeString($library->name, 'filename', ' ', false))); + $libFolder = strtolower( + preg_replace( + '/\s+/', '-', + ComponentbuilderHelper::safeString( + $library->name, 'filename', ' ', false + ) + ) + ); $mediaPath = '/media/' . $libFolder; // should we add the local folder $addLocalFolder = false; // add to component urls foreach ($library->urls as $n => &$url) { - if (isset($url['type']) && $url['type'] > 1 && isset($url['url']) && ComponentbuilderHelper::checkString($url['url'])) + if (isset($url['type']) && $url['type'] > 1 + && isset($url['url']) + && ComponentbuilderHelper::checkString( + $url['url'] + )) { // create media/lib path if not set - if (!JFolder::exists($this->componentPath . $mediaPath)) + if (!JFolder::exists( + $this->componentPath . $mediaPath + )) { - JFolder::create($this->componentPath . $mediaPath); + JFolder::create( + $this->componentPath . $mediaPath + ); // count the folder created $this->folderCount++; $this->indexHTML($mediaPath); @@ -1210,7 +1551,9 @@ class Structure extends Get // set file name $fileName = basename($url['url']); // get the file contents - $data = ComponentbuilderHelper::getFileContents($url['url']); + $data = ComponentbuilderHelper::getFileContents( + $url['url'] + ); // build sub path if (strpos($fileName, '.js') !== false) { @@ -1225,15 +1568,21 @@ class Structure extends Get $path = ''; } // create sub media path if not set - if (!JFolder::exists($this->componentPath . $mediaPath . $path)) + if (!JFolder::exists( + $this->componentPath . $mediaPath . $path + )) { - JFolder::create($this->componentPath . $mediaPath . $path); + JFolder::create( + $this->componentPath . $mediaPath + . $path + ); // count the folder created $this->folderCount++; $this->indexHTML($mediaPath . $path); } // set the path to library file - $url['path'] = $mediaPath . $path . '/' . $fileName; // we need this for later + $url['path'] = $mediaPath . $path . '/' + . $fileName; // we need this for later // set full path $path = $this->componentPath . $url['path']; // write data to path @@ -1246,18 +1595,25 @@ class Structure extends Get if ($addLocalFolder) { // add folder to xml of media folders - $this->fileContentStatic[$this->hhh . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] .= PHP_EOL . $this->_t(2) . "" . $libFolder . ""; + $this->fileContentStatic[$this->hhh + . 'EXSTRA_MEDIA_FOLDERS' . $this->hhh] + .= PHP_EOL . $this->_t(2) . "" + . $libFolder . ""; } } // if config fields are found load into component config (avoiding dublicates) - if (isset($library->how) && $library->how > 1 && isset($library->config) && ComponentbuilderHelper::checkArray($library->config)) + if (isset($library->how) && $library->how > 1 + && isset($library->config) + && ComponentbuilderHelper::checkArray($library->config)) { foreach ($library->config as $cofig) { - $found = array_filter($this->componentData->config, function($item) use($cofig) - { - return $item['field'] == $cofig['field']; - }); + $found = array_filter( + $this->componentData->config, + function ($item) use ($cofig) { + return $item['field'] == $cofig['field']; + } + ); // set the config data if not found if (!ComponentbuilderHelper::checkArray($found)) { @@ -1272,86 +1628,138 @@ class Structure extends Get /** * set the dynamic dashboard if set - * + * * @return void - * + * */ private function setDynamicDashboard() { // only add the dynamic dashboard if all checks out - if (isset($this->componentData->dashboard_type) && 2 == $this->componentData->dashboard_type && isset($this->componentData->dashboard) && ComponentbuilderHelper::checkString($this->componentData->dashboard) && strpos($this->componentData->dashboard, '_') !== false) + if (isset($this->componentData->dashboard_type) + && 2 == $this->componentData->dashboard_type + && isset($this->componentData->dashboard) + && ComponentbuilderHelper::checkString( + $this->componentData->dashboard + ) + && strpos($this->componentData->dashboard, '_') !== false) { // set the default view $getter = explode('_', $this->componentData->dashboard); if (count((array) $getter) == 2 && is_numeric($getter[1])) { // the pointers - $t = ComponentbuilderHelper::safeString($getter[0], 'U'); + $t = ComponentbuilderHelper::safeString($getter[0], 'U'); $id = (int) $getter[1]; // the dynamic stuff - $targets = array('A' => 'admin_views', 'C' => 'custom_admin_views'); - $names = array('A' => 'admin view', 'C' => 'custom admin view'); - $types = array('A' => 'adminview', 'C' => 'customadminview'); - $keys = array('A' => 'name_list', 'C' => 'code'); + $targets = array('A' => 'admin_views', + 'C' => 'custom_admin_views'); + $names = array('A' => 'admin view', + 'C' => 'custom admin view'); + $types = array('A' => 'adminview', 'C' => 'customadminview'); + $keys = array('A' => 'name_list', 'C' => 'code'); // check the target values if (isset($targets[$t]) && $id > 0) { // set the type name - $type_names = ComponentbuilderHelper::safeString($targets[$t], 'w'); + $type_names = ComponentbuilderHelper::safeString( + $targets[$t], 'w' + ); // set the dynamic dash - if (isset($this->componentData->{$targets[$t]}) && ComponentbuilderHelper::checkArray($this->componentData->{$targets[$t]})) + if (isset($this->componentData->{$targets[$t]}) + && ComponentbuilderHelper::checkArray( + $this->componentData->{$targets[$t]} + )) { // search the target views - $dashboard = (array) array_filter($this->componentData->{$targets[$t]}, function($view) use($id, $t, $types) - { - if (isset($view[$types[$t]]) && $id == $view[$types[$t]]) + $dashboard = (array) array_filter( + $this->componentData->{$targets[$t]}, + function ($view) use ($id, $t, $types) { + if (isset($view[$types[$t]]) + && $id == $view[$types[$t]]) { return true; } + return false; - }); + } + ); // set dashboard if (ComponentbuilderHelper::checkArray($dashboard)) { $dashboard = array_values($dashboard)[0]; } // check if view was found (this should be true) - if (isset($dashboard['settings']) && isset($dashboard['settings']->{$keys[$t]})) + if (isset($dashboard['settings']) + && isset($dashboard['settings']->{$keys[$t]})) { - $this->dynamicDashboard = ComponentbuilderHelper::safeString($dashboard['settings']->{$keys[$t]}); + $this->dynamicDashboard + = ComponentbuilderHelper::safeString( + $dashboard['settings']->{$keys[$t]} + ); } else { // set massage that something is wrong - $this->app->enqueueMessage(JText::_('

Dashboard Error

'), 'Error'); - $this->app->enqueueMessage(JText::sprintf('The %s (%s) is not available in your component! Please insure to only used %s, for a dynamic dashboard, that are still linked to your component.', $names[$t], $this->componentData->dashboard, $type_names), 'Error'); + $this->app->enqueueMessage( + JText::_('

Dashboard Error

'), + 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'The %s (%s) is not available in your component! Please insure to only used %s, for a dynamic dashboard, that are still linked to your component.', + $names[$t], $this->componentData->dashboard, + $type_names + ), 'Error' + ); } } else { // set massage that something is wrong - $this->app->enqueueMessage(JText::_('

Dashboard Error

'), 'Error'); - $this->app->enqueueMessage(JText::sprintf('The %s (%s) is not available in your component! Please insure to only used %s, for a dynamic dashboard, that are still linked to your component.', $names[$t], $this->componentData->dashboard, $type_names), 'Error'); + $this->app->enqueueMessage( + JText::_('

Dashboard Error

'), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'The %s (%s) is not available in your component! Please insure to only used %s, for a dynamic dashboard, that are still linked to your component.', + $names[$t], $this->componentData->dashboard, + $type_names + ), 'Error' + ); } } else { // the target value is wrong - $this->app->enqueueMessage(JText::_('

Dashboard Error

'), 'Error'); - $this->app->enqueueMessage(JText::sprintf('The %s value for the dynamic dashboard is invalid.', $this->componentData->dashboard), 'Error'); + $this->app->enqueueMessage( + JText::_('

Dashboard Error

'), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'The %s value for the dynamic dashboard is invalid.', + $this->componentData->dashboard + ), 'Error' + ); } } else { // the target value is wrong - $this->app->enqueueMessage(JText::_('

Dashboard Error

'), 'Error'); - $this->app->enqueueMessage(JText::sprintf('The %s value for the dynamic dashboard is invalid.', $this->componentData->dashboard), 'Error'); + $this->app->enqueueMessage( + JText::_('

Dashboard Error

'), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'The %s value for the dynamic dashboard is invalid.', + $this->componentData->dashboard + ), 'Error' + ); } // if default was changed to dynamic dashboard the remove default tab and methods if (ComponentbuilderHelper::checkString($this->dynamicDashboard)) { // dynamic dashboard is used - $this->componentData->dashboard_tab = ''; + $this->componentData->dashboard_tab = ''; $this->componentData->php_dashboard_methods = ''; } } @@ -1359,9 +1767,9 @@ class Structure extends Get /** * Write data to file - * + * * @return bool true on success - * + * */ public function writeFile($path, $data) { @@ -1370,13 +1778,15 @@ class Structure extends Get /** * Build the Initial Folders - * + * * @return void - * + * */ private function setFolders() { - if (ComponentbuilderHelper::checkObject($this->joomlaVersionData->create)) + if (ComponentbuilderHelper::checkObject( + $this->joomlaVersionData->create + )) { // creat the main component folder if (!JFolder::exists($this->componentPath)) @@ -1400,9 +1810,13 @@ class Structure extends Get { foreach ($folders as $sub => $subFolders) { - if (!JFolder::exists($this->componentPath . '/' . $main . '/' . $sub)) + if (!JFolder::exists( + $this->componentPath . '/' . $main . '/' . $sub + )) { - JFolder::create($this->componentPath . '/' . $main . '/' . $sub); + JFolder::create( + $this->componentPath . '/' . $main . '/' . $sub + ); // count the folder created $this->folderCount++; $this->indexHTML($main . '/' . $sub); @@ -1411,68 +1825,250 @@ class Structure extends Get { foreach ($subFolders as $sub_2 => $subFolders_2) { - if (!JFolder::exists($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2)) + if (!JFolder::exists( + $this->componentPath . '/' . $main . '/' + . $sub . '/' . $sub_2 + )) { - JFolder::create($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2); + JFolder::create( + $this->componentPath . '/' . $main . '/' + . $sub . '/' . $sub_2 + ); // count the folder created $this->folderCount++; - $this->indexHTML($main . '/' . $sub . '/' . $sub_2); + $this->indexHTML( + $main . '/' . $sub . '/' . $sub_2 + ); } - if (ComponentbuilderHelper::checkObject($subFolders_2)) + if (ComponentbuilderHelper::checkObject( + $subFolders_2 + )) { - foreach ($subFolders_2 as $sub_3 => $subFolders_3) + foreach ( + $subFolders_2 as $sub_3 => $subFolders_3 + ) { - if (!JFolder::exists($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3)) + if (!JFolder::exists( + $this->componentPath . '/' . $main + . '/' . $sub . '/' . $sub_2 . '/' + . $sub_3 + )) { - JFolder::create($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3); + JFolder::create( + $this->componentPath . '/' + . $main . '/' . $sub . '/' + . $sub_2 . '/' . $sub_3 + ); // count the folder created $this->folderCount++; - $this->indexHTML($main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3); + $this->indexHTML( + $main . '/' . $sub . '/' + . $sub_2 . '/' . $sub_3 + ); } - if (ComponentbuilderHelper::checkObject($subFolders_3)) + if (ComponentbuilderHelper::checkObject( + $subFolders_3 + )) { - foreach ($subFolders_3 as $sub_4 => $subFolders_4) + foreach ( + $subFolders_3 as $sub_4 => + $subFolders_4 + ) { - if (!JFolder::exists($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4)) + if (!JFolder::exists( + $this->componentPath . '/' + . $main . '/' . $sub . '/' + . $sub_2 . '/' . $sub_3 + . '/' . $sub_4 + )) { - JFolder::create($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4); + JFolder::create( + $this->componentPath + . '/' . $main . '/' + . $sub . '/' . $sub_2 + . '/' . $sub_3 . '/' + . $sub_4 + ); // count the folder created $this->folderCount++; - $this->indexHTML($main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4); + $this->indexHTML( + $main . '/' . $sub . '/' + . $sub_2 . '/' . $sub_3 + . '/' . $sub_4 + ); } - if (ComponentbuilderHelper::checkObject($subFolders_4)) + if (ComponentbuilderHelper::checkObject( + $subFolders_4 + )) { - foreach ($subFolders_4 as $sub_5 => $subFolders_5) + foreach ( + $subFolders_4 as $sub_5 + => $subFolders_5 + ) { - if (!JFolder::exists($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4 . '/' . $sub_5)) + if (!JFolder::exists( + $this->componentPath + . '/' . $main . '/' + . $sub . '/' + . $sub_2 . '/' + . $sub_3 . '/' + . $sub_4 . '/' + . $sub_5 + )) { - JFolder::create($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4 . '/' . $sub_5); + JFolder::create( + $this->componentPath + . '/' . $main + . '/' . $sub + . '/' . $sub_2 + . '/' . $sub_3 + . '/' . $sub_4 + . '/' . $sub_5 + ); // count the folder created $this->folderCount++; - $this->indexHTML($main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4 . '/' . $sub_5); + $this->indexHTML( + $main . '/' + . $sub . '/' + . $sub_2 . '/' + . $sub_3 . '/' + . $sub_4 . '/' + . $sub_5 + ); } - if (ComponentbuilderHelper::checkObject($subFolders_5)) + if (ComponentbuilderHelper::checkObject( + $subFolders_5 + )) { - foreach ($subFolders_5 as $sub_6 => $subFolders_6) + foreach ( + $subFolders_5 as + $sub_6 => + $subFolders_6 + ) { - if (!JFolder::exists($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4 . '/' . $sub_5 . '/' . $sub_6)) + if (!JFolder::exists( + $this->componentPath + . '/' + . $main + . '/' . $sub + . '/' + . $sub_2 + . '/' + . $sub_3 + . '/' + . $sub_4 + . '/' + . $sub_5 + . '/' + . $sub_6 + )) { - JFolder::create($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4 . '/' . $sub_5 . '/' . $sub_6); + JFolder::create( + $this->componentPath + . '/' + . $main + . '/' + . $sub + . '/' + . $sub_2 + . '/' + . $sub_3 + . '/' + . $sub_4 + . '/' + . $sub_5 + . '/' + . $sub_6 + ); // count the folder created $this->folderCount++; - $this->indexHTML($main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4 . '/' . $sub_5 . '/' . $sub_6); + $this->indexHTML( + $main + . '/' + . $sub + . '/' + . $sub_2 + . '/' + . $sub_3 + . '/' + . $sub_4 + . '/' + . $sub_5 + . '/' + . $sub_6 + ); } - if (ComponentbuilderHelper::checkObject($subFolders_6)) + if (ComponentbuilderHelper::checkObject( + $subFolders_6 + )) { - foreach ($subFolders_6 as $sub_7 => $subFolders_7) + foreach ( + $subFolders_6 + as + $sub_7 + => + $subFolders_7 + ) { - if (!JFolder::exists($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4 . '/' . $sub_5 . '/' . $sub_6 . '/' . $sub_7)) + if (!JFolder::exists( + $this->componentPath + . '/' + . $main + . '/' + . $sub + . '/' + . $sub_2 + . '/' + . $sub_3 + . '/' + . $sub_4 + . '/' + . $sub_5 + . '/' + . $sub_6 + . '/' + . $sub_7 + )) { - JFolder::create($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4 . '/' . $sub_5 . '/' . $sub_6 . '/' . $sub_7); + JFolder::create( + $this->componentPath + . '/' + . $main + . '/' + . $sub + . '/' + . $sub_2 + . '/' + . $sub_3 + . '/' + . $sub_4 + . '/' + . $sub_5 + . '/' + . $sub_6 + . '/' + . $sub_7 + ); // count the folder created $this->folderCount++; - $this->indexHTML($main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4 . '/' . $sub_5 . '/' . $sub_6 . '/' . $sub_7); + $this->indexHTML( + $main + . '/' + . $sub + . '/' + . $sub_2 + . '/' + . $sub_3 + . '/' + . $sub_4 + . '/' + . $sub_5 + . '/' + . $sub_6 + . '/' + . $sub_7 + ); } } } @@ -1489,32 +2085,43 @@ class Structure extends Get } } } + return true; } + return false; } /** * Set the Static File & Folder - * + * * @return boolean - * + * */ private function setStatic() { - if (ComponentbuilderHelper::checkObject($this->joomlaVersionData->move->static)) + if (ComponentbuilderHelper::checkObject( + $this->joomlaVersionData->move->static + )) { $codeName = $this->componentCodeName; // TODO needs more looking at this must be dynamic actualy $this->notNew[] = 'PHPExcel.php'; $this->notNew[] = 'LICENSE.txt'; // do license check - $LICENSE = false; + $LICENSE = false; $licenseChecker = strtolower($this->componentData->license); - if (strpos($licenseChecker, 'gnu') !== false && strpos($licenseChecker, '2') !== false && - (strpos($licenseChecker, 'gpl') !== false || strpos($licenseChecker, 'general public license') !== false)) + if (strpos($licenseChecker, 'gnu') !== false + && strpos( + $licenseChecker, '2' + ) !== false + && (strpos($licenseChecker, 'gpl') !== false + || strpos( + $licenseChecker, 'general public license' + ) !== false)) { - $LICENSE = true; // we only add version 2 auto at this time (TODO) + $LICENSE + = true; // we only add version 2 auto at this time (TODO) } // do README check $README = false; @@ -1524,7 +2131,9 @@ class Structure extends Get $README = true; } // start moving - foreach ($this->joomlaVersionData->move->static as $ftem => $details) + foreach ( + $this->joomlaVersionData->move->static as $ftem => $details + ) { // set item $item = $details->naam; @@ -1550,7 +2159,8 @@ class Structure extends Get continue; } // if not needed do not add - if (($item === 'README.md' || $item === 'README.txt') && !$README) + if (($item === 'README.md' || $item === 'README.txt') + && !$README) { continue; } @@ -1558,34 +2168,56 @@ class Structure extends Get if (isset($details->_target)) { // set destination path - $zipPath = str_replace($details->_target['type'] . '/', '', $details->path); - $path = str_replace($details->_target['type'] . '/', $this->dynamicPaths[$details->_target['key']] . '/', $details->path); + $zipPath = str_replace( + $details->_target['type'] . '/', '', $details->path + ); + $path = str_replace( + $details->_target['type'] . '/', + $this->dynamicPaths[$details->_target['key']] . '/', + $details->path + ); } else { // set destination path $zipPath = str_replace('c0mp0n3nt/', '', $details->path); - $path = str_replace('c0mp0n3nt/', $this->componentPath . '/', $details->path); + $path = str_replace( + 'c0mp0n3nt/', $this->componentPath . '/', $details->path + ); } // set the template folder path - $templatePath = (isset($details->custom) && $details->custom) ? (($details->custom !== 'full') ? $this->templatePathCustom . '/' : '') : $this->templatePath . '/'; + $templatePath = (isset($details->custom) && $details->custom) + ? (($details->custom !== 'full') ? $this->templatePathCustom + . '/' : '') : $this->templatePath . '/'; // set the final paths - $currentFullPath = (preg_match('/^[a-z]:/i', $item)) ? $item : $templatePath . '/' . $item; + $currentFullPath = (preg_match('/^[a-z]:/i', $item)) ? $item + : $templatePath . '/' . $item; $currentFullPath = str_replace('//', '/', $currentFullPath); $packageFullPath = str_replace('//', '/', $path . '/' . $new); - $zipFullPath = str_replace('//', '/', $zipPath . '/' . $new); + $zipFullPath = str_replace( + '//', '/', $zipPath . '/' . $new + ); // now move the file if ($details->type === 'file') { if (!JFile::exists($currentFullPath)) { - $this->app->enqueueMessage(JText::_('

File Path Error

'), 'Error'); - $this->app->enqueueMessage(JText::sprintf('The file path: %s does not exist, and was not added!', $currentFullPath), 'Error'); + $this->app->enqueueMessage( + JText::_('

File Path Error

'), 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'The file path: %s does not exist, and was not added!', + $currentFullPath + ), 'Error' + ); } else { // get base name && get the path only - $packageFullPath0nly = str_replace(basename($packageFullPath), '', $packageFullPath); + $packageFullPath0nly = str_replace( + basename($packageFullPath), '', $packageFullPath + ); // check if path exist, if not creat it if (!JFolder::exists($packageFullPath0nly)) { @@ -1600,20 +2232,28 @@ class Structure extends Get { if (isset($details->_target)) { - $this->newFiles[$details->_target['key']][] = array('path' => $packageFullPath, 'name' => $new, 'zip' => $zipFullPath); + $this->newFiles[$details->_target['key']][] + = array('path' => $packageFullPath, + 'name' => $new, + 'zip' => $zipFullPath); } else { - $this->newFiles['static'][] = array('path' => $packageFullPath, 'name' => $new, 'zip' => $zipFullPath); + $this->newFiles['static'][] + = array('path' => $packageFullPath, + 'name' => $new, + 'zip' => $zipFullPath); } } // ensure we update this file if needed - if (isset($this->updateFileContent[$ftem]) && $this->updateFileContent[$ftem]) + if (isset($this->updateFileContent[$ftem]) + && $this->updateFileContent[$ftem]) { // remove the pointer unset($this->updateFileContent[$ftem]); // set the full path - $this->updateFileContent[$packageFullPath] = $packageFullPath; + $this->updateFileContent[$packageFullPath] + = $packageFullPath; } } } @@ -1621,13 +2261,23 @@ class Structure extends Get { if (!JFolder::exists($currentFullPath)) { - $this->app->enqueueMessage(JText::_('

Folder Path Error

'), 'Error'); - $this->app->enqueueMessage(JText::sprintf('The folder path: %s does not exist, and was not added!', $currentFullPath), 'Error'); + $this->app->enqueueMessage( + JText::_('

Folder Path Error

'), + 'Error' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'The folder path: %s does not exist, and was not added!', + $currentFullPath + ), 'Error' + ); } else { // move the folder to its place - JFolder::copy($currentFullPath, $packageFullPath, '', true); + JFolder::copy( + $currentFullPath, $packageFullPath, '', true + ); // count the folder created $this->folderCount++; } @@ -1639,7 +2289,8 @@ class Structure extends Get $checker = array_values((array) explode('/', $zipFullPath)); // TODO <-- this may not be the best way, will keep an eye on this. // We basicly only want to check if a folder is added that is not in the stdFolders array - if (isset($checker[0]) && ComponentbuilderHelper::checkString($checker[0]) + if (isset($checker[0]) + && ComponentbuilderHelper::checkString($checker[0]) && !in_array($checker[0], $this->stdFolders)) { // check if we should add the dynamic folder moving script to the installer script @@ -1648,11 +2299,20 @@ class Structure extends Get // add the setDynamicF0ld3rs() method to the install scipt.php file $this->setMoveFolders = true; // set message that this was done (will still add a tutorial link later) - $this->app->enqueueMessage(JText::_('

Dynamic folder/s were detected.

'), 'Notice'); - $this->app->enqueueMessage(JText::sprintf('A method (setDynamicF0ld3rs) was added to the install script.php of this package to insure that the folder/s are copied into the correct place when this componet is installed!'), 'Notice'); + $this->app->enqueueMessage( + JText::_( + '

Dynamic folder/s were detected.

' + ), 'Notice' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'A method (setDynamicF0ld3rs) was added to the install script.php of this package to insure that the folder/s are copied into the correct place when this componet is installed!' + ), 'Notice' + ); } } - elseif (count((array) $checker) == 2 && ComponentbuilderHelper::checkString($checker[0])) + elseif (count((array) $checker) == 2 + && ComponentbuilderHelper::checkString($checker[0])) { $add_to_extra = false; // set the target @@ -1662,13 +2322,14 @@ class Structure extends Get if ($details->type === 'folder') { // only folders outside the standard folder are added - $eNAME = 'FOLDERS'; - $ename = 'folder'; + $eNAME = 'FOLDERS'; + $ename = 'folder'; $add_to_extra = true; } // if this is a file, it can only be added to the admin/site/media folders // all other folders are moved as a whole so their files do not need to be declared - elseif (in_array($checker[0], $this->stdFolders) && !in_array($checker[1], $this->stdRootFiles)) + elseif (in_array($checker[0], $this->stdFolders) + && !in_array($checker[1], $this->stdRootFiles)) { $add_to_extra = true; } @@ -1682,27 +2343,41 @@ class Structure extends Get $eTab = $this->_t(3); } // set the xml file - $this->fileContentStatic[$this->hhh . 'EXSTRA_' . ComponentbuilderHelper::safeString($checker[0], 'U') . '_' . $eNAME . $this->hhh] .= PHP_EOL . $eTab . "<" . $ename . ">" . $checker[1] . ""; + $this->fileContentStatic[$this->hhh . 'EXSTRA_' + . ComponentbuilderHelper::safeString( + $checker[0], 'U' + ) . '_' . $eNAME . $this->hhh] + .= PHP_EOL . $eTab . "<" . $ename . ">" + . $checker[1] . ""; } } } } + return true; } + return false; } /** * Set the Dynamic File & Folder - * + * * @return boolean - * + * */ private function setDynamique() { - $back = false; + $back = false; $front = false; - if ((isset($this->joomlaVersionData->move->dynamic) && ComponentbuilderHelper::checkObject($this->joomlaVersionData->move->dynamic)) && (isset($this->componentData->admin_views) && ComponentbuilderHelper::checkArray($this->componentData->admin_views))) + if ((isset($this->joomlaVersionData->move->dynamic) + && ComponentbuilderHelper::checkObject( + $this->joomlaVersionData->move->dynamic + )) + && (isset($this->componentData->admin_views) + && ComponentbuilderHelper::checkArray( + $this->componentData->admin_views + ))) { if (!ComponentbuilderHelper::checkString($this->dynamicDashboard)) { @@ -1715,30 +2390,55 @@ class Structure extends Get { if (ComponentbuilderHelper::checkObject($view['settings'])) { - $created = $this->getCreatedDate($view); + $created = $this->getCreatedDate($view); $modified = $this->getLastModifiedDate($view); if ($view['settings']->name_list != 'null') { - $target = array('admin' => $view['settings']->name_list); - $config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version); + $target + = array('admin' => $view['settings']->name_list); + $config = array($this->hhh . 'CREATIONDATE' + . $this->hhh => $created, + $this->hhh . 'BUILDDATE' + . $this->hhh => $modified, + $this->hhh . 'VERSION' + . $this->hhh => $view['settings']->version); $this->buildDynamique($target, 'list', false, $config); } if ($view['settings']->name_single != 'null') { - $target = array('admin' => $view['settings']->name_single); - $config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version); - $this->buildDynamique($target, 'single', false, $config); + $target + = array('admin' => $view['settings']->name_single); + $config = array($this->hhh . 'CREATIONDATE' + . $this->hhh => $created, + $this->hhh . 'BUILDDATE' + . $this->hhh => $modified, + $this->hhh . 'VERSION' + . $this->hhh => $view['settings']->version); + $this->buildDynamique( + $target, 'single', false, $config + ); } - if (isset($view['edit_create_site_view']) && is_numeric($view['edit_create_site_view']) && $view['edit_create_site_view'] > 0) + if (isset($view['edit_create_site_view']) + && is_numeric( + $view['edit_create_site_view'] + ) + && $view['edit_create_site_view'] > 0) { // setup the front site edit-view files - $target = array('site' => $view['settings']->name_single); - $config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version); + $target + = array('site' => $view['settings']->name_single); + $config = array($this->hhh . 'CREATIONDATE' + . $this->hhh => $created, + $this->hhh . 'BUILDDATE' + . $this->hhh => $modified, + $this->hhh . 'VERSION' + . $this->hhh => $view['settings']->version); $this->buildDynamique($target, 'edit', false, $config); } } // quick set of checkin once - if (isset($view['checkin']) && $view['checkin'] == 1 && !$this->addCheckin) + if (isset($view['checkin']) && $view['checkin'] == 1 + && !$this->addCheckin) { // switch to add checking to config $this->addCheckin = true; @@ -1746,48 +2446,82 @@ class Structure extends Get } $back = true; } - if ((isset($this->joomlaVersionData->move->dynamic) && ComponentbuilderHelper::checkObject($this->joomlaVersionData->move->dynamic)) && (isset($this->componentData->site_views) && ComponentbuilderHelper::checkArray($this->componentData->site_views))) + if ((isset($this->joomlaVersionData->move->dynamic) + && ComponentbuilderHelper::checkObject( + $this->joomlaVersionData->move->dynamic + )) + && (isset($this->componentData->site_views) + && ComponentbuilderHelper::checkArray( + $this->componentData->site_views + ))) { foreach ($this->componentData->site_views as $nr => $view) { - $created = $this->getCreatedDate($view); + $created = $this->getCreatedDate($view); $modified = $this->getLastModifiedDate($view); if ($view['settings']->main_get->gettype == 2) { // set list view $target = array('site' => $view['settings']->code); - $config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version); + $config = array($this->hhh . 'CREATIONDATE' + . $this->hhh => $created, + $this->hhh . 'BUILDDATE' + . $this->hhh => $modified, + $this->hhh . 'VERSION' + . $this->hhh => $view['settings']->version); $this->buildDynamique($target, 'list', false, $config); } elseif ($view['settings']->main_get->gettype == 1) { // set single view $target = array('site' => $view['settings']->code); - $config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version); + $config = array($this->hhh . 'CREATIONDATE' + . $this->hhh => $created, + $this->hhh . 'BUILDDATE' + . $this->hhh => $modified, + $this->hhh . 'VERSION' + . $this->hhh => $view['settings']->version); $this->buildDynamique($target, 'single', false, $config); } } $front = true; } - if ((isset($this->joomlaVersionData->move->dynamic) && ComponentbuilderHelper::checkObject($this->joomlaVersionData->move->dynamic)) && (isset($this->componentData->custom_admin_views) && ComponentbuilderHelper::checkArray($this->componentData->custom_admin_views))) + if ((isset($this->joomlaVersionData->move->dynamic) + && ComponentbuilderHelper::checkObject( + $this->joomlaVersionData->move->dynamic + )) + && (isset($this->componentData->custom_admin_views) + && ComponentbuilderHelper::checkArray( + $this->componentData->custom_admin_views + ))) { foreach ($this->componentData->custom_admin_views as $nr => $view) { - $created = $this->getCreatedDate($view); + $created = $this->getCreatedDate($view); $modified = $this->getLastModifiedDate($view); if ($view['settings']->main_get->gettype == 2) { // set list view$view $target = array('custom_admin' => $view['settings']->code); - $config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version); + $config = array($this->hhh . 'CREATIONDATE' + . $this->hhh => $created, + $this->hhh . 'BUILDDATE' + . $this->hhh => $modified, + $this->hhh . 'VERSION' + . $this->hhh => $view['settings']->version); $this->buildDynamique($target, 'list', false, $config); } elseif ($view['settings']->main_get->gettype == 1) { // set single view $target = array('custom_admin' => $view['settings']->code); - $config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version); + $config = array($this->hhh . 'CREATIONDATE' + . $this->hhh => $created, + $this->hhh . 'BUILDDATE' + . $this->hhh => $modified, + $this->hhh . 'VERSION' + . $this->hhh => $view['settings']->version); $this->buildDynamique($target, 'single', false, $config); } } @@ -1798,6 +2532,7 @@ class Structure extends Get { return true; } + return false; } @@ -1816,32 +2551,58 @@ class Structure extends Get if (isset($this->extentionCustomfields[$field['type_name']])) { // lets check if we already moved this - if (!isset($this->extentionTrackingFilesMoved[$path . 'type' . $field['type_name']])) + if (!isset( + $this->extentionTrackingFilesMoved[$path . 'type' + . $field['type_name']] + )) { // check files exist - if (JFile::exists($this->componentPath . '/admin/models/fields/' . $field['type_name'] . '.php')) + if (JFile::exists( + $this->componentPath . '/admin/models/fields/' + . $field['type_name'] . '.php' + )) { // copy the custom field - JFile::copy($this->componentPath . '/admin/models/fields/' . $field['type_name'] . '.php', $path . '/fields/' . $field['type_name'] . '.php'); + JFile::copy( + $this->componentPath . '/admin/models/fields/' + . $field['type_name'] . '.php', + $path . '/fields/' . $field['type_name'] . '.php' + ); } // stop from doing this again. - $this->extentionTrackingFilesMoved[$path . 'type' . $field['type_name']] = true; + $this->extentionTrackingFilesMoved[$path . 'type' + . $field['type_name']] + = true; } } // check if this has validation that should be moved if (isset($this->validationLinkedFields[$field['field']])) { // lets check if we already moved this - if (!isset($this->extentionTrackingFilesMoved[$path . 'rule' . $this->validationLinkedFields[$field['field']]])) + if (!isset( + $this->extentionTrackingFilesMoved[$path . 'rule' + . $this->validationLinkedFields[$field['field']]] + )) { // check files exist - if (JFile::exists($this->componentPath . '/admin/models/rules/' . $this->validationLinkedFields[$field['field']] . '.php')) + if (JFile::exists( + $this->componentPath . '/admin/models/rules/' + . $this->validationLinkedFields[$field['field']] . '.php' + )) { // copy the custom field - JFile::copy($this->componentPath . '/admin/models/rules/' . $this->validationLinkedFields[$field['field']] . '.php', $path . '/rules/' . $this->validationLinkedFields[$field['field']] . '.php'); + JFile::copy( + $this->componentPath . '/admin/models/rules/' + . $this->validationLinkedFields[$field['field']] + . '.php', $path . '/rules/' + . $this->validationLinkedFields[$field['field']] + . '.php' + ); } // stop from doing this again. - $this->extentionTrackingFilesMoved[$path . 'rule' . $this->validationLinkedFields[$field['field']]] = true; + $this->extentionTrackingFilesMoved[$path . 'rule' + . $this->validationLinkedFields[$field['field']]] + = true; } } } @@ -1849,14 +2610,15 @@ class Structure extends Get /** * get the created date of the (view) * - * @param array $view The view values + * @param array $view The view values * * @return string Last Modified Date * */ public function getCreatedDate($view) { - if (isset($view['settings']->created) && ComponentbuilderHelper::checkString($view['settings']->created)) + if (isset($view['settings']->created) + && ComponentbuilderHelper::checkString($view['settings']->created)) { // first set the main date $date = strtotime($view['settings']->created); @@ -1866,13 +2628,14 @@ class Structure extends Get // first set the main date $date = strtotime("now"); } + return JFactory::getDate($date)->format('jS F, Y'); } /** * get the last modified date of a MVC (view) * - * @param array $view The view values + * @param array $view The view values * * @return string Last Modified Date * @@ -1880,7 +2643,9 @@ class Structure extends Get public function getLastModifiedDate($view) { // first set the main date - if (isset($view['settings']->modified) && ComponentbuilderHelper::checkString($view['settings']->modified) && '0000-00-00 00:00:00' !== $view['settings']->modified) + if (isset($view['settings']->modified) + && ComponentbuilderHelper::checkString($view['settings']->modified) + && '0000-00-00 00:00:00' !== $view['settings']->modified) { $date = strtotime($view['settings']->modified); } @@ -1896,13 +2661,27 @@ class Structure extends Get // now check if value has been set if (!isset($this->lastModifiedDate[$id])) { - if (isset($view['settings']->fields) && ComponentbuilderHelper::checkArray($view['settings']->fields)) + if (isset($view['settings']->fields) + && ComponentbuilderHelper::checkArray( + $view['settings']->fields + )) { foreach ($view['settings']->fields as $field) { - if (isset($field['settings']) && ComponentbuilderHelper::checkObject($field['settings']) && isset($field['settings']->modified) && ComponentbuilderHelper::checkString($field['settings']->modified) && '0000-00-00 00:00:00' !== $field['settings']->modified) + if (isset($field['settings']) + && ComponentbuilderHelper::checkObject( + $field['settings'] + ) + && isset($field['settings']->modified) + && ComponentbuilderHelper::checkString( + $field['settings']->modified + ) + && '0000-00-00 00:00:00' + !== $field['settings']->modified) { - $anotherDate = strtotime($field['settings']->modified); + $anotherDate = strtotime( + $field['settings']->modified + ); if ($anotherDate > $date) { $date = $anotherDate; @@ -1918,9 +2697,16 @@ class Structure extends Get // now check if value has been set if (!isset($this->lastModifiedDate[$id])) { - if (isset($view['settings']->main_get->modified) && ComponentbuilderHelper::checkString($view['settings']->main_get->modified) && '0000-00-00 00:00:00' !== $view['settings']->main_get->modified) + if (isset($view['settings']->main_get->modified) + && ComponentbuilderHelper::checkString( + $view['settings']->main_get->modified + ) + && '0000-00-00 00:00:00' + !== $view['settings']->main_get->modified) { - $anotherDate = strtotime($view['settings']->main_get->modified); + $anotherDate = strtotime( + $view['settings']->main_get->modified + ); if ($anotherDate > $date) { $date = $anotherDate; @@ -1934,9 +2720,16 @@ class Structure extends Get // now check if value has been set if (!isset($this->lastModifiedDate[$id])) { - if (isset($view['settings']->main_get->modified) && ComponentbuilderHelper::checkString($view['settings']->main_get->modified) && '0000-00-00 00:00:00' !== $view['settings']->main_get->modified) + if (isset($view['settings']->main_get->modified) + && ComponentbuilderHelper::checkString( + $view['settings']->main_get->modified + ) + && '0000-00-00 00:00:00' + !== $view['settings']->main_get->modified) { - $anotherDate = strtotime($view['settings']->main_get->modified); + $anotherDate = strtotime( + $view['settings']->main_get->modified + ); if ($anotherDate > $date) { $date = $anotherDate; @@ -1955,22 +2748,25 @@ class Structure extends Get $this->lastModifiedDate[$id] = $date; } - return JFactory::getDate($this->lastModifiedDate[$id])->format('jS F, Y'); + return JFactory::getDate($this->lastModifiedDate[$id])->format( + 'jS F, Y' + ); } /** * Set the Static File & Folder * - * @param array $target The main target and name - * @param string $type The type in the target - * @param string $fileName The custom file name - * @param array $cofig to add more data to the files info + * @param array $target The main target and name + * @param string $type The type in the target + * @param string $fileName The custom file name + * @param array $cofig to add more data to the files info * * @return boolean * */ - public function buildDynamique($target, $type, $fileName = false, $config = false) - { + public function buildDynamique($target, $type, $fileName = false, + $config = false + ) { // did we build the files (any number) $build_status = false; // check that we have the target values @@ -1982,7 +2778,10 @@ class Structure extends Get // make sure it is lower case $name = ComponentbuilderHelper::safeString($name); // setup the files - foreach ($this->joomlaVersionData->move->dynamic->{$main} as $item => $details) + foreach ( + $this->joomlaVersionData->move->dynamic->{$main} as $item => + $details + ) { if ($details->type === $type) { @@ -1997,7 +2796,9 @@ class Structure extends Get $path = $details->path; } $zipPath = str_replace('c0mp0n3nt/', '', $path); - $path = str_replace('c0mp0n3nt/', $this->componentPath . '/', $path); + $path = str_replace( + 'c0mp0n3nt/', $this->componentPath . '/', $path + ); // setup the folder if (!JFolder::exists($path)) @@ -2012,7 +2813,9 @@ class Structure extends Get { if ($fileName) { - $new = str_replace($details->rename, $fileName, $item); + $new = str_replace( + $details->rename, $fileName, $item + ); $name = $name . '_' . $fileName; } elseif ($details->rename === 'new') @@ -2021,7 +2824,9 @@ class Structure extends Get } else { - $new = str_replace($details->rename, $name, $item); + $new = str_replace( + $details->rename, $name, $item + ); } } else @@ -2031,12 +2836,17 @@ class Structure extends Get if (!JFile::exists($path . '/' . $new)) { // move the file to its place - JFile::copy($this->templatePath . '/' . $item, $path . '/' . $new, '', true); + JFile::copy( + $this->templatePath . '/' . $item, + $path . '/' . $new, '', true + ); // count the file created $this->fileCount++; } // setup array for new file - $newFIle = array('path' => $path . '/' . $new, 'name' => $new, 'view' => $name, 'zip' => $zipPath . '/' . $new); + $newFIle = array('path' => $path . '/' . $new, + 'name' => $new, 'view' => $name, + 'zip' => $zipPath . '/' . $new); if (ComponentbuilderHelper::checkArray($config)) { $newFIle['config'] = $config; @@ -2049,6 +2859,7 @@ class Structure extends Get } } } + return $build_status; } @@ -2061,41 +2872,65 @@ class Structure extends Get private function setJoomlaVersionData() { // set the version data - $versionData = json_decode(ComponentbuilderHelper::getFileContents($this->templatePath . '/settings.json')); + $versionData = json_decode( + ComponentbuilderHelper::getFileContents( + $this->templatePath . '/settings.json' + ) + ); // add custom folders - if ((isset($this->componentData->folders) && ComponentbuilderHelper::checkArray($this->componentData->folders)) || $this->addEximport || $this->uikit || $this->footable) + if ((isset($this->componentData->folders) + && ComponentbuilderHelper::checkArray( + $this->componentData->folders + )) + || $this->addEximport + || $this->uikit + || $this->footable) { if ($this->addEximport) { // move the import view folder in place - $importView = array('folder' => 'importViews', 'path' => 'admin/views/import', 'rename' => 1); + $importView = array('folder' => 'importViews', + 'path' => 'admin/views/import', + 'rename' => 1); $this->componentData->folders[] = $importView; // move the PHPExel Folder - $PHPExcel = array('folder' => 'PHPExcel', 'path' => 'admin/helpers', 'rename' => 0); + $PHPExcel = array('folder' => 'PHPExcel', + 'path' => 'admin/helpers', + 'rename' => 0); $this->componentData->folders[] = $PHPExcel; } if (2 == $this->uikit || 1 == $this->uikit) { // move the UIKIT Folder into place - $uikit = array('folder' => 'uikit-v2', 'path' => 'media', 'rename' => 0); + $uikit = array('folder' => 'uikit-v2', + 'path' => 'media', + 'rename' => 0); $this->componentData->folders[] = $uikit; } if (2 == $this->uikit || 3 == $this->uikit) { // move the UIKIT-3 Folder into place - $uikit = array('folder' => 'uikit-v3', 'path' => 'media', 'rename' => 0); + $uikit = array('folder' => 'uikit-v3', + 'path' => 'media', + 'rename' => 0); $this->componentData->folders[] = $uikit; } - if ($this->footable && (!isset($this->footableVersion) || 2 == $this->footableVersion)) + if ($this->footable + && (!isset($this->footableVersion) + || 2 == $this->footableVersion)) { // move the footable folder into place - $footable = array('folder' => 'footable-v2', 'path' => 'media', 'rename' => 0); + $footable = array('folder' => 'footable-v2', + 'path' => 'media', + 'rename' => 0); $this->componentData->folders[] = $footable; } elseif ($this->footable && 3 == $this->footableVersion) { // move the footable folder into place - $footable = array('folder' => 'footable-v3', 'path' => 'media', 'rename' => 0); + $footable = array('folder' => 'footable-v3', + 'path' => 'media', + 'rename' => 0); $this->componentData->folders[] = $footable; } @@ -2110,9 +2945,12 @@ class Structure extends Get $_target_type = $custom['target_type']; } // for good practice - ComponentbuilderHelper::fixPath($custom, array('path', 'folder', 'folderpath')); + ComponentbuilderHelper::fixPath( + $custom, array('path', 'folder', 'folderpath') + ); // fix custom path - if (isset($custom['path']) && ComponentbuilderHelper::checkString($custom['path'])) + if (isset($custom['path']) + && ComponentbuilderHelper::checkString($custom['path'])) { $custom['path'] = trim($custom['path'], '/'); } @@ -2122,9 +2960,13 @@ class Structure extends Get if (!isset($custom['folder']) && isset($custom['folderpath'])) { // update the dynamic path - $custom['folderpath'] = $this->updateDynamicPath($custom['folderpath']); + $custom['folderpath'] = $this->updateDynamicPath( + $custom['folderpath'] + ); // set the folder path with / if does not have a drive/windows full path - $custom['folder'] = (preg_match('/^[a-z]:/i', $custom['folderpath'])) + $custom['folder'] = (preg_match( + '/^[a-z]:/i', $custom['folderpath'] + )) ? trim($custom['folderpath'], '/') : '/' . trim($custom['folderpath'], '/'); // remove the file path @@ -2133,67 +2975,94 @@ class Structure extends Get $customPath = 'full'; } // make sure we use the correct name - $pathArray = (array) explode('/', $custom['path']); + $pathArray = (array) explode('/', $custom['path']); $firstFolder = array_values($pathArray)[0]; - $lastFolder = end($pathArray); + $lastFolder = end($pathArray); // only rename folder if last has folder name if (isset($custom['rename']) && $custom['rename'] == 1) { - $custom['path'] = str_replace('/' . $lastFolder, '', $custom['path']); - $rename = 'new'; - $newname = $lastFolder; + $custom['path'] = str_replace( + '/' . $lastFolder, '', $custom['path'] + ); + $rename = 'new'; + $newname = $lastFolder; } elseif ('full' === $customPath) { // make sure we use the correct name $folderArray = (array) explode('/', $custom['folder']); - $lastFolder = end($folderArray); - $rename = 'new'; - $newname = $lastFolder; + $lastFolder = end($folderArray); + $rename = 'new'; + $newname = $lastFolder; } else { $lastFolder = $custom['folder']; - $rename = false; - $newname = ''; + $rename = false; + $newname = ''; } // insure we have no duplicates - $key_pointer = ComponentbuilderHelper::safeString($custom['folder']) . '_f' . $pointer_tracker; + $key_pointer = ComponentbuilderHelper::safeString( + $custom['folder'] + ) . '_f' . $pointer_tracker; $pointer_tracker++; // fix custom path $custom['path'] = ltrim($custom['path'], '/'); // set new folder to object - $versionData->move->static->{$key_pointer} = new stdClass(); - $versionData->move->static->{$key_pointer}->naam = str_replace('//','/', $custom['folder']); - $versionData->move->static->{$key_pointer}->path = $_target_type. '/' . $custom['path']; - $versionData->move->static->{$key_pointer}->rename = $rename; + $versionData->move->static->{$key_pointer} = new stdClass( + ); + $versionData->move->static->{$key_pointer}->naam + = str_replace( + '//', '/', $custom['folder'] + ); + $versionData->move->static->{$key_pointer}->path + = $_target_type + . '/' . $custom['path']; + $versionData->move->static->{$key_pointer}->rename = $rename; $versionData->move->static->{$key_pointer}->newName = $newname; - $versionData->move->static->{$key_pointer}->type = 'folder'; - $versionData->move->static->{$key_pointer}->custom = $customPath; + $versionData->move->static->{$key_pointer}->type = 'folder'; + $versionData->move->static->{$key_pointer}->custom + = $customPath; // set the target if type and id is found - if (isset($custom['target_id']) && isset($custom['target_type'])) + if (isset($custom['target_id']) + && isset($custom['target_type'])) { - $versionData->move->static->{$key_pointer}->_target = array('key' => $custom['target_id'] . '_' . $custom['target_type'], 'type' => $custom['target_type']); + $versionData->move->static->{$key_pointer}->_target + = array('key' => $custom['target_id'] . '_' + . $custom['target_type'], + 'type' => $custom['target_type']); } } unset($this->componentData->folders); unset($custom); } // add custom files - if ((isset($this->componentData->files) && ComponentbuilderHelper::checkArray($this->componentData->files)) || $this->addEximport || $this->googlechart) + if ((isset($this->componentData->files) + && ComponentbuilderHelper::checkArray( + $this->componentData->files + )) + || $this->addEximport + || $this->googlechart) { if ($this->addEximport) { // move the PHPExel main file - $PHPExcel = array('file' => 'PHPExcel.php', 'path' => 'admin/helpers', 'rename' => 0); + $PHPExcel = array('file' => 'PHPExcel.php', + 'path' => 'admin/helpers', + 'rename' => 0); $this->componentData->files[] = $PHPExcel; } if ($this->googlechart) { // move the google chart files - $googleChart = array('file' => 'google.jsapi.js', 'path' => 'media/js', 'rename' => 0); + $googleChart = array('file' => 'google.jsapi.js', + 'path' => 'media/js', + 'rename' => 0); $this->componentData->files[] = $googleChart; - $googleChart = array('file' => 'chartbuilder.php', 'path' => 'admin/helpers', 'rename' => 0); + $googleChart + = array('file' => 'chartbuilder.php', + 'path' => 'admin/helpers', + 'rename' => 0); $this->componentData->files[] = $googleChart; } @@ -2208,16 +3077,22 @@ class Structure extends Get $_target_type = $custom['target_type']; } // for good practice - ComponentbuilderHelper::fixPath($custom, array('path', 'file', 'filepath')); + ComponentbuilderHelper::fixPath( + $custom, array('path', 'file', 'filepath') + ); // by default custom path is true $customPath = 'custom'; // set full path if this is a full path file if (!isset($custom['file']) && isset($custom['filepath'])) { // update the dynamic path - $custom['filepath'] = $this->updateDynamicPath($custom['filepath']); + $custom['filepath'] = $this->updateDynamicPath( + $custom['filepath'] + ); // set the file path with / if does not have a drive/windows full path - $custom['file'] = (preg_match('/^[a-z]:/i', $custom['filepath'])) + $custom['file'] = (preg_match( + '/^[a-z]:/i', $custom['filepath'] + )) ? trim($custom['filepath'], '/') : '/' . trim($custom['filepath'], '/'); // remove the file path @@ -2226,22 +3101,32 @@ class Structure extends Get $customPath = 'full'; } // make sure we have not duplicates - $key_pointer = ComponentbuilderHelper::safeString($custom['file']) . '_g' . $pointer_tracker; + $key_pointer = ComponentbuilderHelper::safeString( + $custom['file'] + ) . '_g' . $pointer_tracker; $pointer_tracker++; // set new file to object - $versionData->move->static->{$key_pointer} = new stdClass(); - $versionData->move->static->{$key_pointer}->naam = str_replace('//','/',$custom['file']); + $versionData->move->static->{$key_pointer} = new stdClass( + ); + $versionData->move->static->{$key_pointer}->naam = str_replace( + '//', '/', $custom['file'] + ); // update the dynamic component name placholders in file names - $custom['path'] = $this->setPlaceholders($custom['path'], $this->placeholders); + $custom['path'] = $this->setPlaceholders( + $custom['path'], $this->placeholders + ); // get the path info $pathInfo = pathinfo($custom['path']); if (isset($pathInfo['extension']) && $pathInfo['extension']) { $pathInfo['dirname'] = trim($pathInfo['dirname'], '/'); // set the info - $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $pathInfo['dirname']; + $versionData->move->static->{$key_pointer}->path + = $_target_type + . '/' . $pathInfo['dirname']; $versionData->move->static->{$key_pointer}->rename = 'new'; - $versionData->move->static->{$key_pointer}->newName = $pathInfo['basename']; + $versionData->move->static->{$key_pointer}->newName + = $pathInfo['basename']; } elseif ('full' === $customPath) { @@ -2250,27 +3135,39 @@ class Structure extends Get // get file array $fileArray = (array) explode('/', $custom['file']); // set the info - $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; - $versionData->move->static->{$key_pointer}->rename = 'new'; - $versionData->move->static->{$key_pointer}->newName = end($fileArray); + $versionData->move->static->{$key_pointer}->path + = $_target_type + . '/' . $custom['path']; + $versionData->move->static->{$key_pointer}->rename = 'new'; + $versionData->move->static->{$key_pointer}->newName = end( + $fileArray + ); } else { // fix custom path $custom['path'] = ltrim($custom['path'], '/'); // set the info - $versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path']; + $versionData->move->static->{$key_pointer}->path + = $_target_type + . '/' . $custom['path']; $versionData->move->static->{$key_pointer}->rename = false; } $versionData->move->static->{$key_pointer}->type = 'file'; - $versionData->move->static->{$key_pointer}->custom = $customPath; + $versionData->move->static->{$key_pointer}->custom + = $customPath; // set the target if type and id is found - if (isset($custom['target_id']) && isset($custom['target_type'])) + if (isset($custom['target_id']) + && isset($custom['target_type'])) { - $versionData->move->static->{$key_pointer}->_target = array('key' => $custom['target_id'] . '_' . $custom['target_type'], 'type' => $custom['target_type']); + $versionData->move->static->{$key_pointer}->_target + = array('key' => $custom['target_id'] . '_' + . $custom['target_type'], + 'type' => $custom['target_type']); } // check if file should be updated - if (!isset($custom['notnew']) || $custom['notnew'] == 0 || $custom['notnew'] != 1) + if (!isset($custom['notnew']) || $custom['notnew'] == 0 + || $custom['notnew'] != 1) { $this->notNew[] = $key_pointer; } @@ -2283,13 +3180,14 @@ class Structure extends Get unset($this->componentData->files); unset($custom); } + return $versionData; } /** * set the index.html file in a folder path * - * @param string $path The path to place the index.html file in + * @param string $path The path to place the index.html file in * * @return void * @@ -2303,13 +3201,18 @@ class Structure extends Get // use path if exist if (strlen($path) > 0) { - JFile::copy($this->templatePath . '/index.html', $root . '/' . $path . '/index.html'); + JFile::copy( + $this->templatePath . '/index.html', + $root . '/' . $path . '/index.html' + ); // count the file created $this->fileCount++; } else { - JFile::copy($this->templatePath . '/index.html', $root . '/index.html'); + JFile::copy( + $this->templatePath . '/index.html', $root . '/index.html' + ); // count the file created $this->fileCount++; } @@ -2317,25 +3220,29 @@ class Structure extends Get /** * Update paths with real value - * - * @param string $path The full path + * + * @param string $path The full path * * @return string The updated path - * + * */ protected function updateDynamicPath($path) { - return $this->setPlaceholders($this->setPlaceholders($path, ComponentbuilderHelper::$constantPaths), $this->placeholders); + return $this->setPlaceholders( + $this->setPlaceholders( + $path, ComponentbuilderHelper::$constantPaths + ), $this->placeholders + ); } /** * Remove folders with files - * + * * @param string $dir The path to folder to remove * @param boolean $ignore The files and folders to ignore * * @return boolean True if all is removed - * + * */ protected function removeFolder($dir, $ignore = false) { diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index e258d4a4a..1dc6f27d2 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -5,7 +5,7 @@ * @created 30th April, 2015 * @author Llewellyn van der Merwe * @github Joomla Component Builder - * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @copyright Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -286,74 +286,74 @@ class Fields extends Structure /** * Get Items Method Eximport String Fix Builder - * + * * @var array */ public $getItemsMethodEximportStringFixBuilder = array(); /** * Selection Translation Fix Builder - * + * * @var array */ public $selectionTranslationFixBuilder = array(); /** * Sort Builder - * + * * @var array */ public $sortBuilder = array(); /** * Search Builder - * + * * @var array */ public $searchBuilder = array(); /** * Filter Builder - * + * * @var array */ public $filterBuilder = array(); /** * Set Group Control - * + * * @var array */ public $setGroupControl = array(); /** * Set Field Names - * + * * @var array */ public $fieldsNames = array(); /** * Default Fields set to publishing - * + * * @var array */ public $newPublishingFields = array(); /** * Default Fields set to publishing - * + * * @var array */ public $movedPublishingFields = array(); /** * Set the line number in comments - * - * @param int $nr The line number - * + * + * @param int $nr The line number + * * @return void - * + * */ private function setLine($nr) { @@ -361,24 +361,27 @@ class Fields extends Structure { return ' [Fields ' . $nr . ']'; } + return ''; } /** * set the Field set of a view - * - * @param array $view The view data - * @param string $component The component name - * @param string $view_name_single The single view name - * @param string $view_name_list The list view name + * + * @param array $view The view data + * @param string $component The component name + * @param string $view_name_single The single view name + * @param string $view_name_list The list view name * * @return string The fields set in xml - * + * */ - public function setFieldSet($view, $component, $view_name_single, $view_name_list) - { + public function setFieldSet($view, $component, $view_name_single, + $view_name_list + ) { // setup the fieldset of this view - if (isset($view['settings']->fields) && ComponentbuilderHelper::checkArray($view['settings']->fields)) + if (isset($view['settings']->fields) + && ComponentbuilderHelper::checkArray($view['settings']->fields)) { // add metadata to the view if (isset($view['metadata']) && $view['metadata']) @@ -391,106 +394,243 @@ class Fields extends Structure $this->accessBuilder[$view_name_single] = $view_name_single; } // main lang prefix - $langView = $this->langPrefix . '_' . $this->placeholders[$this->hhh . 'VIEW' . $this->hhh]; - $langViews = $this->langPrefix . '_' . $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh]; + $langView = $this->langPrefix . '_' + . $this->placeholders[$this->hhh . 'VIEW' . $this->hhh]; + $langViews = $this->langPrefix . '_' + . $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh]; // set default lang - $this->setLangContent($this->lang, $langView, $view['settings']->name_single); - $this->setLangContent($this->lang, $langViews, $view['settings']->name_list); + $this->setLangContent( + $this->lang, $langView, $view['settings']->name_single + ); + $this->setLangContent( + $this->lang, $langViews, $view['settings']->name_list + ); // set global item strings - $this->setLangContent($this->lang, $langViews . '_N_ITEMS_ARCHIVED', "%s " . $view['settings']->name_list . " archived."); - $this->setLangContent($this->lang, $langViews . '_N_ITEMS_ARCHIVED_1', "%s " . $view['settings']->name_single . " archived."); - $this->setLangContent($this->lang, $langViews . '_N_ITEMS_CHECKED_IN_0', "No " . $view['settings']->name_single . " successfully checked in."); - $this->setLangContent($this->lang, $langViews . '_N_ITEMS_CHECKED_IN_1', "%d " . $view['settings']->name_single . " successfully checked in."); - $this->setLangContent($this->lang, $langViews . '_N_ITEMS_CHECKED_IN_MORE', "%d " . $view['settings']->name_list . " successfully checked in."); - $this->setLangContent($this->lang, $langViews . '_N_ITEMS_DELETED', "%s " . $view['settings']->name_list . " deleted."); - $this->setLangContent($this->lang, $langViews . '_N_ITEMS_DELETED_1', "%s " . $view['settings']->name_single . " deleted."); - $this->setLangContent($this->lang, $langViews . '_N_ITEMS_FEATURED', "%s " . $view['settings']->name_list . " featured."); - $this->setLangContent($this->lang, $langViews . '_N_ITEMS_FEATURED_1', "%s " . $view['settings']->name_single . " featured."); - $this->setLangContent($this->lang, $langViews . '_N_ITEMS_PUBLISHED', "%s " . $view['settings']->name_list . " published."); - $this->setLangContent($this->lang, $langViews . '_N_ITEMS_PUBLISHED_1', "%s " . $view['settings']->name_single . " published."); - $this->setLangContent($this->lang, $langViews . '_N_ITEMS_TRASHED', "%s " . $view['settings']->name_list . " trashed."); - $this->setLangContent($this->lang, $langViews . '_N_ITEMS_TRASHED_1', "%s " . $view['settings']->name_single . " trashed."); - $this->setLangContent($this->lang, $langViews . '_N_ITEMS_UNFEATURED', "%s " . $view['settings']->name_list . " unfeatured."); - $this->setLangContent($this->lang, $langViews . '_N_ITEMS_UNFEATURED_1', "%s " . $view['settings']->name_single . " unfeatured."); - $this->setLangContent($this->lang, $langViews . '_N_ITEMS_UNPUBLISHED', "%s " . $view['settings']->name_list . " unpublished."); - $this->setLangContent($this->lang, $langViews . '_N_ITEMS_UNPUBLISHED_1', "%s " . $view['settings']->name_single . " unpublished."); - $this->setLangContent($this->lang, $langViews . '_BATCH_OPTIONS', "Batch process the selected " . $view['settings']->name_list); - $this->setLangContent($this->lang, $langViews . '_BATCH_TIP', "All changes will be applied to all selected " . $view['settings']->name_list); + $this->setLangContent( + $this->lang, $langViews . '_N_ITEMS_ARCHIVED', + "%s " . $view['settings']->name_list . " archived." + ); + $this->setLangContent( + $this->lang, $langViews . '_N_ITEMS_ARCHIVED_1', + "%s " . $view['settings']->name_single . " archived." + ); + $this->setLangContent( + $this->lang, $langViews . '_N_ITEMS_CHECKED_IN_0', + "No " . $view['settings']->name_single + . " successfully checked in." + ); + $this->setLangContent( + $this->lang, $langViews . '_N_ITEMS_CHECKED_IN_1', + "%d " . $view['settings']->name_single + . " successfully checked in." + ); + $this->setLangContent( + $this->lang, $langViews . '_N_ITEMS_CHECKED_IN_MORE', + "%d " . $view['settings']->name_list + . " successfully checked in." + ); + $this->setLangContent( + $this->lang, $langViews . '_N_ITEMS_DELETED', + "%s " . $view['settings']->name_list . " deleted." + ); + $this->setLangContent( + $this->lang, $langViews . '_N_ITEMS_DELETED_1', + "%s " . $view['settings']->name_single . " deleted." + ); + $this->setLangContent( + $this->lang, $langViews . '_N_ITEMS_FEATURED', + "%s " . $view['settings']->name_list . " featured." + ); + $this->setLangContent( + $this->lang, $langViews . '_N_ITEMS_FEATURED_1', + "%s " . $view['settings']->name_single . " featured." + ); + $this->setLangContent( + $this->lang, $langViews . '_N_ITEMS_PUBLISHED', + "%s " . $view['settings']->name_list . " published." + ); + $this->setLangContent( + $this->lang, $langViews . '_N_ITEMS_PUBLISHED_1', + "%s " . $view['settings']->name_single . " published." + ); + $this->setLangContent( + $this->lang, $langViews . '_N_ITEMS_TRASHED', + "%s " . $view['settings']->name_list . " trashed." + ); + $this->setLangContent( + $this->lang, $langViews . '_N_ITEMS_TRASHED_1', + "%s " . $view['settings']->name_single . " trashed." + ); + $this->setLangContent( + $this->lang, $langViews . '_N_ITEMS_UNFEATURED', + "%s " . $view['settings']->name_list . " unfeatured." + ); + $this->setLangContent( + $this->lang, $langViews . '_N_ITEMS_UNFEATURED_1', + "%s " . $view['settings']->name_single . " unfeatured." + ); + $this->setLangContent( + $this->lang, $langViews . '_N_ITEMS_UNPUBLISHED', + "%s " . $view['settings']->name_list . " unpublished." + ); + $this->setLangContent( + $this->lang, $langViews . '_N_ITEMS_UNPUBLISHED_1', + "%s " . $view['settings']->name_single . " unpublished." + ); + $this->setLangContent( + $this->lang, $langViews . '_BATCH_OPTIONS', + "Batch process the selected " . $view['settings']->name_list + ); + $this->setLangContent( + $this->lang, $langViews . '_BATCH_TIP', + "All changes will be applied to all selected " + . $view['settings']->name_list + ); // set some basic defaults - $this->setLangContent($this->lang, $langView . '_ERROR_UNIQUE_ALIAS', "Another " . $view['settings']->name_single . " has the same alias."); - $this->setLangContent($this->lang, $langView . '_CREATED_DATE_LABEL', "Created Date"); - $this->setLangContent($this->lang, $langView . '_CREATED_DATE_DESC', "The date this " . $view['settings']->name_single . " was created."); - $this->setLangContent($this->lang, $langView . '_MODIFIED_DATE_LABEL', "Modified Date"); - $this->setLangContent($this->lang, $langView . '_MODIFIED_DATE_DESC', "The date this " . $view['settings']->name_single . " was modified."); - $this->setLangContent($this->lang, $langView . '_CREATED_BY_LABEL', "Created By"); - $this->setLangContent($this->lang, $langView . '_CREATED_BY_DESC', "The user that created this " . $view['settings']->name_single . "."); - $this->setLangContent($this->lang, $langView . '_MODIFIED_BY_LABEL', "Modified By"); - $this->setLangContent($this->lang, $langView . '_MODIFIED_BY_DESC', "The last user that modified this " . $view['settings']->name_single . "."); - $this->setLangContent($this->lang, $langView . '_ORDERING_LABEL', "Ordering"); - $this->setLangContent($this->lang, $langView . '_VERSION_LABEL', "Version"); - $this->setLangContent($this->lang, $langView . '_VERSION_DESC', "A count of the number of times this " . $view['settings']->name_single . " has been revised."); - $this->setLangContent($this->lang, $langView . '_SAVE_WARNING', "Alias already existed so a number was added at the end. You can re-edit the " . $view['settings']->name_single . " to customise the alias."); + $this->setLangContent( + $this->lang, $langView . '_ERROR_UNIQUE_ALIAS', + "Another " . $view['settings']->name_single + . " has the same alias." + ); + $this->setLangContent( + $this->lang, $langView . '_CREATED_DATE_LABEL', "Created Date" + ); + $this->setLangContent( + $this->lang, $langView . '_CREATED_DATE_DESC', + "The date this " . $view['settings']->name_single + . " was created." + ); + $this->setLangContent( + $this->lang, $langView . '_MODIFIED_DATE_LABEL', "Modified Date" + ); + $this->setLangContent( + $this->lang, $langView . '_MODIFIED_DATE_DESC', + "The date this " . $view['settings']->name_single + . " was modified." + ); + $this->setLangContent( + $this->lang, $langView . '_CREATED_BY_LABEL', "Created By" + ); + $this->setLangContent( + $this->lang, $langView . '_CREATED_BY_DESC', + "The user that created this " . $view['settings']->name_single + . "." + ); + $this->setLangContent( + $this->lang, $langView . '_MODIFIED_BY_LABEL', "Modified By" + ); + $this->setLangContent( + $this->lang, $langView . '_MODIFIED_BY_DESC', + "The last user that modified this " + . $view['settings']->name_single . "." + ); + $this->setLangContent( + $this->lang, $langView . '_ORDERING_LABEL', "Ordering" + ); + $this->setLangContent( + $this->lang, $langView . '_VERSION_LABEL', "Version" + ); + $this->setLangContent( + $this->lang, $langView . '_VERSION_DESC', + "A count of the number of times this " + . $view['settings']->name_single . " has been revised." + ); + $this->setLangContent( + $this->lang, $langView . '_SAVE_WARNING', + "Alias already existed so a number was added at the end. You can re-edit the " + . $view['settings']->name_single . " to customise the alias." + ); // check what type of field builder to use if ($this->fieldBuilderType == 1) { // build field set using string manipulation - return $this->stringFieldSet($view, $component, $view_name_single, $view_name_list, $langView, $langViews); + return $this->stringFieldSet( + $view, $component, $view_name_single, $view_name_list, + $langView, $langViews + ); } else { // build field set with simpleXMLElement class - return $this->simpleXMLFieldSet($view, $component, $view_name_single, $view_name_list, $langView, $langViews); + return $this->simpleXMLFieldSet( + $view, $component, $view_name_single, $view_name_list, + $langView, $langViews + ); } } + return ''; } /** * build field set using string manipulation * - * @param array $view The view data - * @param string $component The component name - * @param string $view_name_single The single view name - * @param string $view_name_list The list view name - * @param string $langView The language string of the view - * @param string $langViews The language string of the views + * @param array $view The view data + * @param string $component The component name + * @param string $view_name_single The single view name + * @param string $view_name_list The list view name + * @param string $langView The language string of the view + * @param string $langViews The language string of the views * * @return string The fields set in xml * */ - protected function stringFieldSet($view, $component, $view_name_single, $view_name_list, $langView, $langViews) - { + protected function stringFieldSet($view, $component, $view_name_single, + $view_name_list, $langView, $langViews + ) { // set the read only $readOnly = false; if ($view['settings']->type == 2) { - $readOnly = $this->_t(3) . 'readonly="true"' . PHP_EOL . $this->_t(3) . 'disabled="true"'; + $readOnly = $this->_t(3) . 'readonly="true"' . PHP_EOL . $this->_t( + 3 + ) . 'disabled="true"'; } // start adding dynamc fields $dynamicFields = ''; // set the custom table key $dbkey = 'g'; // Trigger Event: jcb_ce_onBeforeBuildFields - $this->triggerEvent('jcb_ce_onBeforeBuildFields', array(&$this->componentContext, &$dynamicFields, &$readOnly, &$dbkey, &$view, &$component, &$view_name_single, &$view_name_list, &$this->placeholders, &$langView, &$langViews)); + $this->triggerEvent( + 'jcb_ce_onBeforeBuildFields', + array(&$this->componentContext, &$dynamicFields, &$readOnly, + &$dbkey, &$view, &$component, &$view_name_single, + &$view_name_list, &$this->placeholders, &$langView, + &$langViews) + ); // TODO we should add the global and local view switch if field for front end foreach ($view['settings']->fields as $field) { - $dynamicFields .= $this->setDynamicField($field, $view, $view['settings']->type, $langView, $view_name_single, $view_name_list, $this->placeholders, $dbkey, true); + $dynamicFields .= $this->setDynamicField( + $field, $view, $view['settings']->type, $langView, + $view_name_single, $view_name_list, $this->placeholders, $dbkey, + true + ); } // Trigger Event: jcb_ce_onAfterBuildFields - $this->triggerEvent('jcb_ce_onAfterBuildFields', array(&$this->componentContext, &$dynamicFields, &$readOnly, &$dbkey, &$view, &$component, &$view_name_single, &$view_name_list, &$this->placeholders, &$langView, &$langViews)); + $this->triggerEvent( + 'jcb_ce_onAfterBuildFields', + array(&$this->componentContext, &$dynamicFields, &$readOnly, + &$dbkey, &$view, &$component, &$view_name_single, + &$view_name_list, &$this->placeholders, &$langView, + &$langViews) + ); // set the default fields - $fieldSet = array(); + $fieldSet = array(); $fieldSet[] = '
'; - $fieldSet[] = $this->_t(2) . ""; - $fieldSet[] = $this->_t(2) . ""; + $fieldSet[] = $this->_t(2) . ""; + $fieldSet[] = $this->_t(2) . ""; // if id is not set if (!isset($this->fieldsNames[$view_name_single]['id'])) { $fieldSet[] = $this->_t(2) . "_t(3) . "name=" . '"id"'; - $fieldSet[] = $this->_t(3) . 'type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL"'; - $fieldSet[] = $this->_t(3) . 'description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"'; + $fieldSet[] = $this->_t(3) + . 'type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL"'; + $fieldSet[] = $this->_t(3) + . 'description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"'; $fieldSet[] = $this->_t(3) . 'readonly="true"'; $fieldSet[] = $this->_t(2) . "/>"; // count the static field created @@ -499,12 +639,15 @@ class Fields extends Structure // if created is not set if (!isset($this->fieldsNames[$view_name_single]['created'])) { - $fieldSet[] = $this->_t(2) . ""; + $fieldSet[] = $this->_t(2) . ""; $fieldSet[] = $this->_t(2) . "_t(3) . "name=" . '"created"'; $fieldSet[] = $this->_t(3) . "type=" . '"calendar"'; - $fieldSet[] = $this->_t(3) . "label=" . '"' . $langView . '_CREATED_DATE_LABEL"'; - $fieldSet[] = $this->_t(3) . "description=" . '"' . $langView . '_CREATED_DATE_DESC"'; + $fieldSet[] = $this->_t(3) . "label=" . '"' . $langView + . '_CREATED_DATE_LABEL"'; + $fieldSet[] = $this->_t(3) . "description=" . '"' . $langView + . '_CREATED_DATE_DESC"'; $fieldSet[] = $this->_t(3) . "size=" . '"22"'; if ($readOnly) { @@ -519,16 +662,19 @@ class Fields extends Structure // if created_by is not set if (!isset($this->fieldsNames[$view_name_single]['created_by'])) { - $fieldSet[] = $this->_t(2) . ""; + $fieldSet[] = $this->_t(2) . ""; $fieldSet[] = $this->_t(2) . "_t(3) . "name=" . '"created_by"'; $fieldSet[] = $this->_t(3) . "type=" . '"user"'; - $fieldSet[] = $this->_t(3) . "label=" . '"' . $langView . '_CREATED_BY_LABEL"'; + $fieldSet[] = $this->_t(3) . "label=" . '"' . $langView + . '_CREATED_BY_LABEL"'; if ($readOnly) { $fieldSet[] = $readOnly; } - $fieldSet[] = $this->_t(3) . "description=" . '"' . $langView . '_CREATED_BY_DESC"'; + $fieldSet[] = $this->_t(3) . "description=" . '"' . $langView + . '_CREATED_BY_DESC"'; $fieldSet[] = $this->_t(2) . "/>"; // count the static field created $this->fieldCount++; @@ -536,14 +682,18 @@ class Fields extends Structure // if published is not set if (!isset($this->fieldsNames[$view_name_single]['published'])) { - $fieldSet[] = $this->_t(2) . ""; - $fieldSet[] = $this->_t(2) . "_t(3) . "description=" . '"JFIELD_PUBLISHED_DESC" class="chzn-color-state"'; + $fieldSet[] = $this->_t(2) . ""; + $fieldSet[] = $this->_t(2) . "_t(3) . "description=" + . '"JFIELD_PUBLISHED_DESC" class="chzn-color-state"'; if ($readOnly) { $fieldSet[] = $readOnly; } - $fieldSet[] = $this->_t(3) . "filter=" . '"intval" size="1" default="1" >'; + $fieldSet[] = $this->_t(3) . "filter=" + . '"intval" size="1" default="1" >'; $fieldSet[] = $this->_t(3) . ""; $fieldSet[] = $this->_t(3) . "
"; // check if metadata is added to this view - if (isset($this->metadataBuilder[$view_name_single]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view_name_single])) + if (isset($this->metadataBuilder[$view_name_single]) + && ComponentbuilderHelper::checkString( + $this->metadataBuilder[$view_name_single] + )) { if (!isset($this->fieldsNames[$view_name_single]['robots']) || !isset($this->fieldsNames[$view_name_single]['rights']) || !isset($this->fieldsNames[$view_name_single]['author'])) { - $fieldSet[] = PHP_EOL . $this->_t(1) . ""; - $fieldSet[] = $this->_t(1) . "'; + $fieldSet[] = PHP_EOL . $this->_t(1) . ""; + $fieldSet[] = $this->_t(1) . "'; $fieldSet[] = $this->_t(2) . '
_t(3) . 'label="JGLOBAL_FIELDSET_METADATA_OPTIONS">'; + $fieldSet[] = $this->_t(3) + . 'label="JGLOBAL_FIELDSET_METADATA_OPTIONS">'; // robots if (!isset($this->fieldsNames[$view_name_single]['robots'])) { - $fieldSet[] = $this->_t(3) . ""; + $fieldSet[] = $this->_t(3) . ""; $fieldSet[] = $this->_t(3) . '_t(4) . 'type="list"'; - $fieldSet[] = $this->_t(4) . 'label="JFIELD_METADATA_ROBOTS_LABEL"'; - $fieldSet[] = $this->_t(4) . 'description="JFIELD_METADATA_ROBOTS_DESC" >'; - $fieldSet[] = $this->_t(4) . ''; - $fieldSet[] = $this->_t(4) . ''; - $fieldSet[] = $this->_t(4) . ''; - $fieldSet[] = $this->_t(4) . ''; - $fieldSet[] = $this->_t(4) . ''; + $fieldSet[] = $this->_t(4) + . 'label="JFIELD_METADATA_ROBOTS_LABEL"'; + $fieldSet[] = $this->_t(4) + . 'description="JFIELD_METADATA_ROBOTS_DESC" >'; + $fieldSet[] = $this->_t(4) + . ''; + $fieldSet[] = $this->_t(4) + . ''; + $fieldSet[] = $this->_t(4) + . ''; + $fieldSet[] = $this->_t(4) + . ''; + $fieldSet[] = $this->_t(4) + . ''; $fieldSet[] = $this->_t(3) . ''; // count the static field created $this->fieldCount++; @@ -708,10 +903,13 @@ class Fields extends Structure // author if (!isset($this->fieldsNames[$view_name_single]['author'])) { - $fieldSet[] = $this->_t(3) . ""; + $fieldSet[] = $this->_t(3) . ""; $fieldSet[] = $this->_t(3) . '_t(4) . 'type="text"'; - $fieldSet[] = $this->_t(4) . 'label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC"'; + $fieldSet[] = $this->_t(4) + . 'label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC"'; $fieldSet[] = $this->_t(4) . 'size="20"'; $fieldSet[] = $this->_t(3) . "/>"; // count the static field created @@ -720,9 +918,13 @@ class Fields extends Structure // rights if (!isset($this->fieldsNames[$view_name_single]['rights'])) { - $fieldSet[] = $this->_t(3) . ""; - $fieldSet[] = $this->_t(3) . '_t(4) . 'description="JFIELD_META_RIGHTS_DESC" required="false" filter="string"'; + $fieldSet[] = $this->_t(3) . ""; + $fieldSet[] = $this->_t(3) + . '_t(4) + . 'description="JFIELD_META_RIGHTS_DESC" required="false" filter="string"'; $fieldSet[] = $this->_t(4) . 'cols="30" rows="2"'; $fieldSet[] = $this->_t(3) . "/>"; // count the static field created @@ -732,6 +934,7 @@ class Fields extends Structure $fieldSet[] = $this->_t(1) . ""; } } + // retunr the set return implode(PHP_EOL, $fieldSet); } @@ -739,18 +942,19 @@ class Fields extends Structure /** * build field set with simpleXMLElement class * - * @param array $view The view data - * @param string $component The component name - * @param string $view_name_single The single view name - * @param string $view_name_list The list view name - * @param string $langView The language string of the view - * @param string $langViews The language string of the views + * @param array $view The view data + * @param string $component The component name + * @param string $view_name_single The single view name + * @param string $view_name_list The list view name + * @param string $langView The language string of the view + * @param string $langViews The language string of the views * * @return string The fields set in xml * */ - protected function simpleXMLFieldSet($view, $component, $view_name_single, $view_name_list, $langView, $langViews) - { + protected function simpleXMLFieldSet($view, $component, $view_name_single, + $view_name_list, $langView, $langViews + ) { // set the read only $readOnlyXML = array(); if ($view['settings']->type == 2) @@ -763,34 +967,55 @@ class Fields extends Structure // set the custom table key $dbkey = 'g'; // Trigger Event: jcb_ce_onBeforeBuildFields - $this->triggerEvent('jcb_ce_onBeforeBuildFields', array(&$this->componentContext, &$dynamicFieldsXML, &$readOnlyXML, &$dbkey, &$view, &$component, &$view_name_single, &$view_name_list, &$this->placeholders, &$langView, &$langViews)); + $this->triggerEvent( + 'jcb_ce_onBeforeBuildFields', + array(&$this->componentContext, &$dynamicFieldsXML, &$readOnlyXML, + &$dbkey, &$view, &$component, &$view_name_single, + &$view_name_list, &$this->placeholders, &$langView, + &$langViews) + ); // TODO we should add the global and local view switch if field for front end foreach ($view['settings']->fields as $field) { - $dynamicFieldsXML[] = $this->setDynamicField($field, $view, $view['settings']->type, $langView, $view_name_single, $view_name_list, $this->placeholders, $dbkey, true); + $dynamicFieldsXML[] = $this->setDynamicField( + $field, $view, $view['settings']->type, $langView, + $view_name_single, $view_name_list, $this->placeholders, $dbkey, + true + ); } // Trigger Event: jcb_ce_onAfterBuildFields - $this->triggerEvent('jcb_ce_onAfterBuildFields', array(&$this->componentContext, &$dynamicFieldsXML, &$readOnlyXML, &$dbkey, &$view, &$component, &$view_name_single, &$view_name_list, &$this->placeholders, &$langView, &$langViews)); + $this->triggerEvent( + 'jcb_ce_onAfterBuildFields', + array(&$this->componentContext, &$dynamicFieldsXML, &$readOnlyXML, + &$dbkey, &$view, &$component, &$view_name_single, + &$view_name_list, &$this->placeholders, &$langView, + &$langViews) + ); // set the default fields - $XML = new simpleXMLElement(''); + $XML = new simpleXMLElement(''); $fieldSetXML = $XML->addChild('fieldset'); $fieldSetXML->addAttribute('name', 'details'); - ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Default Fields."); - ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Id Field. Type: Text (joomla)"); + ComponentbuilderHelper::xmlComment( + $fieldSetXML, $this->setLine(__LINE__) . " Default Fields." + ); + ComponentbuilderHelper::xmlComment( + $fieldSetXML, + $this->setLine(__LINE__) . " Id Field. Type: Text (joomla)" + ); // if id is not set if (!isset($this->fieldsNames[$view_name_single]['id'])) { $attributes = array( - 'name' => 'id', - 'type' => 'text', - 'class' => 'readonly', - 'readonly' => "true", - 'label' => 'JGLOBAL_FIELD_ID_LABEL', + 'name' => 'id', + 'type' => 'text', + 'class' => 'readonly', + 'readonly' => "true", + 'label' => 'JGLOBAL_FIELD_ID_LABEL', 'description' => 'JGLOBAL_FIELD_ID_DESC', - 'size' => 10, - 'default' => 0 + 'size' => 10, + 'default' => 0 ); - $fieldXML = $fieldSetXML->addChild('field'); + $fieldXML = $fieldSetXML->addChild('field'); ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes); // count the static field created $this->fieldCount++; @@ -799,16 +1024,19 @@ class Fields extends Structure if (!isset($this->fieldsNames[$view_name_single]['created'])) { $attributes = array( - 'name' => 'created', - 'type' => 'calendar', - 'label' => $langView . '_CREATED_DATE_LABEL', + 'name' => 'created', + 'type' => 'calendar', + 'label' => $langView . '_CREATED_DATE_LABEL', 'description' => $langView . '_CREATED_DATE_DESC', - 'size' => 22, - 'format' => '%Y-%m-%d %H:%M:%S', - 'filter' => 'user_utc' + 'size' => 22, + 'format' => '%Y-%m-%d %H:%M:%S', + 'filter' => 'user_utc' ); $attributes = array_merge($attributes, $readOnlyXML); - ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Date Created Field. Type: Calendar (joomla)"); + ComponentbuilderHelper::xmlComment( + $fieldSetXML, $this->setLine(__LINE__) + . " Date Created Field. Type: Calendar (joomla)" + ); $fieldXML = $fieldSetXML->addChild('field'); ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes); // count the static field created @@ -818,13 +1046,16 @@ class Fields extends Structure if (!isset($this->fieldsNames[$view_name_single]['created_by'])) { $attributes = array( - 'name' => 'created_by', - 'type' => 'user', - 'label' => $langView . '_CREATED_BY_LABEL', + 'name' => 'created_by', + 'type' => 'user', + 'label' => $langView . '_CREATED_BY_LABEL', 'description' => $langView . '_CREATED_BY_DESC', ); $attributes = array_merge($attributes, $readOnlyXML); - ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " User Created Field. Type: User (joomla)"); + ComponentbuilderHelper::xmlComment( + $fieldSetXML, $this->setLine(__LINE__) + . " User Created Field. Type: User (joomla)" + ); $fieldXML = $fieldSetXML->addChild('field'); ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes); // count the static field created @@ -834,17 +1065,23 @@ class Fields extends Structure if (!isset($this->fieldsNames[$view_name_single]['published'])) { $attributes = array( - 'name' => 'published', - 'type' => 'list', + 'name' => 'published', + 'type' => 'list', 'label' => 'JSTATUS' ); $attributes = array_merge($attributes, $readOnlyXML); - ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Published Field. Type: List (joomla)"); + ComponentbuilderHelper::xmlComment( + $fieldSetXML, $this->setLine(__LINE__) + . " Published Field. Type: List (joomla)" + ); $fieldXML = $fieldSetXML->addChild('field'); ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes); // count the static field created $this->fieldCount++; - foreach (array('JPUBLISHED' => 1, 'JUNPUBLISHED' => 0, 'JARCHIVED' => 2, 'JTRASHED' => -2) as $text => $value) + foreach ( + array('JPUBLISHED' => 1, 'JUNPUBLISHED' => 0, 'JARCHIVED' => 2, + 'JTRASHED' => -2) as $text => $value + ) { $optionXML = $fieldXML->addChild('option'); $optionXML->addAttribute('value', $value); @@ -855,17 +1092,20 @@ class Fields extends Structure if (!isset($this->fieldsNames[$view_name_single]['modified'])) { $attributes = array( - 'name' => 'modified', - 'type' => 'calendar', - 'class' => 'readonly', - 'label' => $langView . '_MODIFIED_DATE_LABEL', + 'name' => 'modified', + 'type' => 'calendar', + 'class' => 'readonly', + 'label' => $langView . '_MODIFIED_DATE_LABEL', 'description' => $langView . '_MODIFIED_DATE_DESC', - 'size' => 22, - 'readonly' => "true", - 'format' => '%Y-%m-%d %H:%M:%S', - 'filter' => 'user_utc' + 'size' => 22, + 'readonly' => "true", + 'format' => '%Y-%m-%d %H:%M:%S', + 'filter' => 'user_utc' + ); + ComponentbuilderHelper::xmlComment( + $fieldSetXML, $this->setLine(__LINE__) + . " Date Modified Field. Type: Calendar (joomla)" ); - ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Date Modified Field. Type: Calendar (joomla)"); $fieldXML = $fieldSetXML->addChild('field'); ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes); // count the static field created @@ -875,33 +1115,43 @@ class Fields extends Structure if (!isset($this->fieldsNames[$view_name_single]['modified_by'])) { $attributes = array( - 'name' => 'modified_by', - 'type' => 'user', - 'label' => $langView . '_MODIFIED_BY_LABEL', + 'name' => 'modified_by', + 'type' => 'user', + 'label' => $langView . '_MODIFIED_BY_LABEL', 'description' => $langView . '_MODIFIED_BY_DESC', - 'class' => 'readonly', - 'readonly' => 'true', - 'filter' => 'unset' + 'class' => 'readonly', + 'readonly' => 'true', + 'filter' => 'unset' + ); + ComponentbuilderHelper::xmlComment( + $fieldSetXML, $this->setLine(__LINE__) + . " User Modified Field. Type: User (joomla)" ); - ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " User Modified Field. Type: User (joomla)"); $fieldXML = $fieldSetXML->addChild('field'); ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes); // count the static field created $this->fieldCount++; } // check if view has access - if (isset($this->accessBuilder[$view_name_single]) && ComponentbuilderHelper::checkString($this->accessBuilder[$view_name_single]) && !isset($this->fieldsNames[$view_name_single]['access'])) + if (isset($this->accessBuilder[$view_name_single]) + && ComponentbuilderHelper::checkString( + $this->accessBuilder[$view_name_single] + ) + && !isset($this->fieldsNames[$view_name_single]['access'])) { $attributes = array( - 'name' => 'access', - 'type' => 'accesslevel', - 'label' => 'JFIELD_ACCESS_LABEL', + 'name' => 'access', + 'type' => 'accesslevel', + 'label' => 'JFIELD_ACCESS_LABEL', 'description' => 'JFIELD_ACCESS_DESC', - 'default' => 1, - 'required' => "false" + 'default' => 1, + 'required' => "false" ); $attributes = array_merge($attributes, $readOnlyXML); - ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Access Field. Type: Accesslevel (joomla)"); + ComponentbuilderHelper::xmlComment( + $fieldSetXML, $this->setLine(__LINE__) + . " Access Field. Type: Accesslevel (joomla)" + ); $fieldXML = $fieldSetXML->addChild('field'); ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes); // count the static field created @@ -911,17 +1161,20 @@ class Fields extends Structure if (!isset($this->fieldsNames[$view_name_single]['ordering'])) { $attributes = array( - 'name' => 'ordering', - 'type' => 'number', - 'class' => 'inputbox validate-ordering', - 'label' => $langView . '_ORDERING_LABEL', + 'name' => 'ordering', + 'type' => 'number', + 'class' => 'inputbox validate-ordering', + 'label' => $langView . '_ORDERING_LABEL', 'description' => '', - 'default' => 0, - 'size' => 6, - 'required' => "false" + 'default' => 0, + 'size' => 6, + 'required' => "false" ); $attributes = array_merge($attributes, $readOnlyXML); - ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Ordering Field. Type: Numbers (joomla)"); + ComponentbuilderHelper::xmlComment( + $fieldSetXML, $this->setLine(__LINE__) + . " Ordering Field. Type: Numbers (joomla)" + ); $fieldXML = $fieldSetXML->addChild('field'); ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes); // count the static field created @@ -931,50 +1184,66 @@ class Fields extends Structure if (!isset($this->fieldsNames[$view_name_single]['version'])) { $attributes = array( - 'name' => 'version', - 'type' => 'text', - 'class' => 'readonly', - 'label' => $langView . '_VERSION_LABEL', + 'name' => 'version', + 'type' => 'text', + 'class' => 'readonly', + 'label' => $langView . '_VERSION_LABEL', 'description' => $langView . '_VERSION_DESC', - 'size' => 6, - 'readonly' => "true", - 'filter' => 'unset' + 'size' => 6, + 'readonly' => "true", + 'filter' => 'unset' + ); + ComponentbuilderHelper::xmlComment( + $fieldSetXML, + $this->setLine(__LINE__) . " Version Field. Type: Text (joomla)" ); - ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Version Field. Type: Text (joomla)"); $fieldXML = $fieldSetXML->addChild('field'); ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes); // count the static field created $this->fieldCount++; } // check if metadata is added to this view - if (isset($this->metadataBuilder[$view_name_single]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view_name_single])) + if (isset($this->metadataBuilder[$view_name_single]) + && ComponentbuilderHelper::checkString( + $this->metadataBuilder[$view_name_single] + )) { // metakey if (!isset($this->fieldsNames[$view_name_single]['metakey'])) { $attributes = array( - 'name' => 'metakey', - 'type' => 'textarea', - 'label' => 'JFIELD_META_KEYWORDS_LABEL', + 'name' => 'metakey', + 'type' => 'textarea', + 'label' => 'JFIELD_META_KEYWORDS_LABEL', 'description' => 'JFIELD_META_KEYWORDS_DESC', - 'rows' => 3, - 'cols' => 30 + 'rows' => 3, + 'cols' => 30 + ); + ComponentbuilderHelper::xmlComment( + $fieldSetXML, $this->setLine(__LINE__) + . " Metakey Field. Type: Textarea (joomla)" ); - ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Metakey Field. Type: Textarea (joomla)"); $fieldXML = $fieldSetXML->addChild('field'); - ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes); + ComponentbuilderHelper::xmlAddAttributes( + $fieldXML, $attributes + ); // count the static field created $this->fieldCount++; } // metadesc if (!isset($this->fieldsNames[$view_name_single]['metadesc'])) { - $attributes['name'] = 'metadesc'; - $attributes['label'] = 'JFIELD_META_DESCRIPTION_LABEL'; + $attributes['name'] = 'metadesc'; + $attributes['label'] = 'JFIELD_META_DESCRIPTION_LABEL'; $attributes['description'] = 'JFIELD_META_DESCRIPTION_DESC'; - ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Metadesc Field. Type: Textarea (joomla)"); + ComponentbuilderHelper::xmlComment( + $fieldSetXML, $this->setLine(__LINE__) + . " Metadesc Field. Type: Textarea (joomla)" + ); $fieldXML = $fieldSetXML->addChild('field'); - ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes); + ComponentbuilderHelper::xmlAddAttributes( + $fieldXML, $attributes + ); // count the static field created $this->fieldCount++; } @@ -982,45 +1251,61 @@ class Fields extends Structure // load the dynamic fields now if (count((array) $dynamicFieldsXML)) { - ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Dynamic Fields."); + ComponentbuilderHelper::xmlComment( + $fieldSetXML, $this->setLine(__LINE__) . " Dynamic Fields." + ); foreach ($dynamicFieldsXML as $dynamicfield) { ComponentbuilderHelper::xmlAppend($fieldSetXML, $dynamicfield); } } // check if metadata is added to this view - if (isset($this->metadataBuilder[$view_name_single]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view_name_single])) + if (isset($this->metadataBuilder[$view_name_single]) + && ComponentbuilderHelper::checkString( + $this->metadataBuilder[$view_name_single] + )) { if (!isset($this->fieldsNames[$view_name_single]['robots']) || !isset($this->fieldsNames[$view_name_single]['author']) || !isset($this->fieldsNames[$view_name_single]['rights'])) { - ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Metadata Fields"); + ComponentbuilderHelper::xmlComment( + $fieldSetXML, $this->setLine(__LINE__) . " Metadata Fields" + ); $fieldsXML = $fieldSetXML->addChild('fields'); $fieldsXML->addAttribute('name', 'metadata'); - $fieldsXML->addAttribute('label', 'JGLOBAL_FIELDSET_METADATA_OPTIONS'); + $fieldsXML->addAttribute( + 'label', 'JGLOBAL_FIELDSET_METADATA_OPTIONS' + ); $fieldsFieldSetXML = $fieldsXML->addChild('fieldset'); $fieldsFieldSetXML->addAttribute('name', 'vdmmetadata'); - $fieldsFieldSetXML->addAttribute('label', 'JGLOBAL_FIELDSET_METADATA_OPTIONS'); + $fieldsFieldSetXML->addAttribute( + 'label', 'JGLOBAL_FIELDSET_METADATA_OPTIONS' + ); // robots if (!isset($this->fieldsNames[$view_name_single]['robots'])) { - ComponentbuilderHelper::xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Robots Field. Type: List (joomla)"); - $robots = $fieldsFieldSetXML->addChild('field'); + ComponentbuilderHelper::xmlComment( + $fieldsFieldSetXML, $this->setLine(__LINE__) + . " Robots Field. Type: List (joomla)" + ); + $robots = $fieldsFieldSetXML->addChild('field'); $attributes = array( - 'name' => 'robots', - 'type' => 'list', - 'label' => 'JFIELD_METADATA_ROBOTS_LABEL', + 'name' => 'robots', + 'type' => 'list', + 'label' => 'JFIELD_METADATA_ROBOTS_LABEL', 'description' => 'JFIELD_METADATA_ROBOTS_DESC' ); - ComponentbuilderHelper::xmlAddAttributes($robots, $attributes); + ComponentbuilderHelper::xmlAddAttributes( + $robots, $attributes + ); // count the static field created $this->fieldCount++; $options = array( - 'JGLOBAL_USE_GLOBAL' => '', - 'JGLOBAL_INDEX_FOLLOW' => 'index, follow', - 'JGLOBAL_NOINDEX_FOLLOW' => 'noindex, follow', - 'JGLOBAL_INDEX_NOFOLLOW' => 'index, nofollow', + 'JGLOBAL_USE_GLOBAL' => '', + 'JGLOBAL_INDEX_FOLLOW' => 'index, follow', + 'JGLOBAL_NOINDEX_FOLLOW' => 'noindex, follow', + 'JGLOBAL_INDEX_NOFOLLOW' => 'index, nofollow', 'JGLOBAL_NOINDEX_NOFOLLOW' => 'noindex, nofollow', ); foreach ($options as $text => $value) @@ -1033,40 +1318,51 @@ class Fields extends Structure // author if (!isset($this->fieldsNames[$view_name_single]['author'])) { - ComponentbuilderHelper::xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Author Field. Type: Text (joomla)"); - $author = $fieldsFieldSetXML->addChild('field'); - $attributes = array( - 'name' => 'author', - 'type' => 'text', - 'label' => 'JAUTHOR', - 'description' => 'JFIELD_METADATA_AUTHOR_DESC', - 'size' => 20 + ComponentbuilderHelper::xmlComment( + $fieldsFieldSetXML, $this->setLine(__LINE__) + . " Author Field. Type: Text (joomla)" + ); + $author = $fieldsFieldSetXML->addChild('field'); + $attributes = array( + 'name' => 'author', + 'type' => 'text', + 'label' => 'JAUTHOR', + 'description' => 'JFIELD_METADATA_AUTHOR_DESC', + 'size' => 20 + ); + ComponentbuilderHelper::xmlAddAttributes( + $author, $attributes ); - ComponentbuilderHelper::xmlAddAttributes($author, $attributes); // count the static field created $this->fieldCount++; } // rights if (!isset($this->fieldsNames[$view_name_single]['rights'])) { - ComponentbuilderHelper::xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Rights Field. Type: Textarea (joomla)"); - $rights = $fieldsFieldSetXML->addChild('field'); - $attributes = array( - 'name' => 'rights', - 'type' => 'textarea', - 'label' => 'JFIELD_META_RIGHTS_LABEL', - 'description' => 'JFIELD_META_RIGHTS_DESC', - 'required' => 'false', - 'filter' => 'string', - 'cols' => 30, - 'rows' => 2 + ComponentbuilderHelper::xmlComment( + $fieldsFieldSetXML, $this->setLine(__LINE__) + . " Rights Field. Type: Textarea (joomla)" + ); + $rights = $fieldsFieldSetXML->addChild('field'); + $attributes = array( + 'name' => 'rights', + 'type' => 'textarea', + 'label' => 'JFIELD_META_RIGHTS_LABEL', + 'description' => 'JFIELD_META_RIGHTS_DESC', + 'required' => 'false', + 'filter' => 'string', + 'cols' => 30, + 'rows' => 2 + ); + ComponentbuilderHelper::xmlAddAttributes( + $rights, $attributes ); - ComponentbuilderHelper::xmlAddAttributes($rights, $attributes); // count the static field created $this->fieldCount++; } } } + // return the set return $this->xmlPrettyPrint($XML, 'fieldset'); } @@ -1074,8 +1370,8 @@ class Fields extends Structure /** * set Field Names * - * @param string $view View the field belongs to - * @param string $name The name of the field + * @param string $view View the field belongs to + * @param string $name The name of the field * * */ @@ -1100,8 +1396,9 @@ class Fields extends Structure * @return SimpleXMLElement The complete field in xml * */ - public function setDynamicField(&$field, &$view, &$viewType, &$langView, &$view_name_single, &$view_name_list, &$placeholders, &$dbkey, $build) - { + public function setDynamicField(&$field, &$view, &$viewType, &$langView, + &$view_name_single, &$view_name_list, &$placeholders, &$dbkey, $build + ) { // set default return if ($this->fieldBuilderType == 1) { @@ -1114,33 +1411,49 @@ class Fields extends Structure $dynamicField = false; } // make sure we have settings - if (isset($field['settings']) && ComponentbuilderHelper::checkObject($field['settings'])) + if (isset($field['settings']) + && ComponentbuilderHelper::checkObject( + $field['settings'] + )) { // reset some values - $name = $this->getFieldName($field, $view_name_list); - $typeName = $this->getFieldType($field); - $multiple = false; - $langLabel = ''; - $fieldSet = ''; + $name = $this->getFieldName($field, $view_name_list); + $typeName = $this->getFieldType($field); + $multiple = false; + $langLabel = ''; + $fieldSet = ''; $fieldAttributes = array(); // set field attributes - $fieldAttributes = $this->setFieldAttributes($field, $viewType, $name, $typeName, $multiple, $langLabel, $langView, $view_name_list, $view_name_single, $placeholders); + $fieldAttributes = $this->setFieldAttributes( + $field, $viewType, $name, $typeName, $multiple, $langLabel, + $langView, $view_name_list, $view_name_single, $placeholders + ); // check if values were set if (ComponentbuilderHelper::checkArray($fieldAttributes)) { // set the array of field names - $this->setFieldsNames($view_name_single, $fieldAttributes['name']); + $this->setFieldsNames( + $view_name_single, $fieldAttributes['name'] + ); if (ComponentbuilderHelper::fieldCheck($typeName, 'option')) { //reset options array $optionArray = array(); // now add to the field set - $dynamicField = $this->setField('option', $fieldAttributes, $name, $typeName, $langView, $view_name_single, $view_name_list, $placeholders, $optionArray); + $dynamicField = $this->setField( + 'option', $fieldAttributes, $name, $typeName, $langView, + $view_name_single, $view_name_list, $placeholders, + $optionArray + ); if ($build) { // set builders - $this->setBuilders($langLabel, $langView, $view_name_single, $view_name_list, $name, $view, $field, $typeName, $multiple, false, $optionArray); + $this->setBuilders( + $langLabel, $langView, $view_name_single, + $view_name_list, $name, $view, $field, $typeName, + $multiple, false, $optionArray + ); } } elseif (ComponentbuilderHelper::fieldCheck($typeName, 'spacer')) @@ -1149,21 +1462,31 @@ class Fields extends Structure { // make sure spacers gets loaded to layout $tabName = ''; - if (isset($view['settings']->tabs) && isset($view['settings']->tabs[(int) $field['tab']])) + if (isset($view['settings']->tabs) + && isset($view['settings']->tabs[(int) $field['tab']])) { - $tabName = $view['settings']->tabs[(int) $field['tab']]; + $tabName + = $view['settings']->tabs[(int) $field['tab']]; } elseif ((int) $field['tab'] == 15) { // set to publishing tab $tabName = 'publishing'; } - $this->setLayoutBuilder($view_name_single, $tabName, $name, $field); + $this->setLayoutBuilder( + $view_name_single, $tabName, $name, $field + ); } // now add to the field set - $dynamicField = $this->setField('spacer', $fieldAttributes, $name, $typeName, $langView, $view_name_single, $view_name_list, $placeholders, $optionArray); + $dynamicField = $this->setField( + 'spacer', $fieldAttributes, $name, $typeName, $langView, + $view_name_single, $view_name_list, $placeholders, + $optionArray + ); } - elseif (ComponentbuilderHelper::fieldCheck($typeName, 'special')) + elseif (ComponentbuilderHelper::fieldCheck( + $typeName, 'special' + )) { // set the repeatable field or subform field if ($typeName === 'repeatable' || $typeName === 'subform') @@ -1171,13 +1494,24 @@ class Fields extends Structure if ($build) { // set builders - $this->setBuilders($langLabel, $langView, $view_name_single, $view_name_list, $name, $view, $field, $typeName, $multiple, false); + $this->setBuilders( + $langLabel, $langView, $view_name_single, + $view_name_list, $name, $view, $field, + $typeName, $multiple, false + ); } // now add to the field set - $dynamicField = $this->setField('special', $fieldAttributes, $name, $typeName, $langView, $view_name_single, $view_name_list, $placeholders, $optionArray); + $dynamicField = $this->setField( + 'special', $fieldAttributes, $name, $typeName, + $langView, $view_name_single, $view_name_list, + $placeholders, $optionArray + ); } } - elseif (isset($fieldAttributes['custom']) && ComponentbuilderHelper::checkArray($fieldAttributes['custom'])) + elseif (isset($fieldAttributes['custom']) + && ComponentbuilderHelper::checkArray( + $fieldAttributes['custom'] + )) { // set the custom array $custom = $fieldAttributes['custom']; @@ -1189,103 +1523,143 @@ class Fields extends Structure if ($build) { // set builders - $this->setBuilders($langLabel, $langView, $view_name_single, $view_name_list, $name, $view, $field, $typeName, $multiple, $custom); + $this->setBuilders( + $langLabel, $langView, $view_name_single, + $view_name_list, $name, $view, $field, $typeName, + $multiple, $custom + ); } // now add to the field set - $dynamicField = $this->setField('custom', $fieldAttributes, $name, $typeName, $langView, $view_name_single, $view_name_list, $placeholders, $optionArray, $custom); + $dynamicField = $this->setField( + 'custom', $fieldAttributes, $name, $typeName, $langView, + $view_name_single, $view_name_list, $placeholders, + $optionArray, $custom + ); } else { if ($build) { // set builders - $this->setBuilders($langLabel, $langView, $view_name_single, $view_name_list, $name, $view, $field, $typeName, $multiple); + $this->setBuilders( + $langLabel, $langView, $view_name_single, + $view_name_list, $name, $view, $field, $typeName, + $multiple + ); } // now add to the field set - $dynamicField = $this->setField('plain', $fieldAttributes, $name, $typeName, $langView, $view_name_single, $view_name_list, $placeholders, $optionArray); + $dynamicField = $this->setField( + 'plain', $fieldAttributes, $name, $typeName, $langView, + $view_name_single, $view_name_list, $placeholders, + $optionArray + ); } } } + return $dynamicField; } /** * set a field * - * @param string $setType The set of fields type - * @param array $fieldAttributes The field values - * @param string $name The field name - * @param string $typeName The field type - * @param string $langView The language string of the view - * @param string $view_name_single The single view name - * @param string $view_name_list The list view name - * @param array $placeholders The place holder and replace values - * @param string $optionArray The option bucket array used to set the field options if needed. - * @param array $custom Used when field is from config - * @param string $taber The tabs to add in layout (only in string manipulation) + * @param string $setType The set of fields type + * @param array $fieldAttributes The field values + * @param string $name The field name + * @param string $typeName The field type + * @param string $langView The language string of the view + * @param string $view_name_single The single view name + * @param string $view_name_list The list view name + * @param array $placeholders The place holder and replace values + * @param string $optionArray The option bucket array used to set the field options if needed. + * @param array $custom Used when field is from config + * @param string $taber The tabs to add in layout (only in string manipulation) * * @return SimpleXMLElement The field in xml * */ - private function setField($setType, &$fieldAttributes, &$name, &$typeName, &$langView, &$view_name_single, &$view_name_list, $placeholders, &$optionArray, $custom = null, $taber = '') - { + private function setField($setType, &$fieldAttributes, &$name, &$typeName, + &$langView, &$view_name_single, &$view_name_list, $placeholders, + &$optionArray, $custom = null, $taber = '' + ) { // count the dynamic fields created $this->fieldCount++; // check what type of field builder to use if ($this->fieldBuilderType == 1) { // build field set using string manipulation - return $this->stringSetField($setType, $fieldAttributes, $name, $typeName, $langView, $view_name_single, $view_name_list, $placeholders, $optionArray, $custom, $taber); + return $this->stringSetField( + $setType, $fieldAttributes, $name, $typeName, $langView, + $view_name_single, $view_name_list, $placeholders, $optionArray, + $custom, $taber + ); } else { // build field set with simpleXMLElement class - return $this->simpleXMLSetField($setType, $fieldAttributes, $name, $typeName, $langView, $view_name_single, $view_name_list, $placeholders, $optionArray, $custom); + return $this->simpleXMLSetField( + $setType, $fieldAttributes, $name, $typeName, $langView, + $view_name_single, $view_name_list, $placeholders, $optionArray, + $custom + ); } } /** * set a field using string manipulation * - * @param string $setType The set of fields type - * @param array $fieldAttributes The field values - * @param string $name The field name - * @param string $typeName The field type - * @param string $langView The language string of the view - * @param string $view_name_single The single view name - * @param string $view_name_list The list view name - * @param array $placeholders The place holder and replace values - * @param string $optionArray The option bucket array used to set the field options if needed. - * @param array $custom Used when field is from config - * @param string $taber The tabs to add in layout + * @param string $setType The set of fields type + * @param array $fieldAttributes The field values + * @param string $name The field name + * @param string $typeName The field type + * @param string $langView The language string of the view + * @param string $view_name_single The single view name + * @param string $view_name_list The list view name + * @param array $placeholders The place holder and replace values + * @param string $optionArray The option bucket array used to set the field options if needed. + * @param array $custom Used when field is from config + * @param string $taber The tabs to add in layout * * @return SimpleXMLElement The field in xml * */ - protected function stringSetField($setType, &$fieldAttributes, &$name, &$typeName, &$langView, &$view_name_single, &$view_name_list, $placeholders, &$optionArray, $custom = null, $taber = '') - { + protected function stringSetField($setType, &$fieldAttributes, &$name, + &$typeName, &$langView, &$view_name_single, &$view_name_list, + $placeholders, &$optionArray, $custom = null, $taber = '' + ) { $field = ''; if ($setType === 'option') { // now add to the field set - $field .= PHP_EOL . $this->_t(1) . $taber . $this->_t(1) . ""; - $field .= PHP_EOL . $this->_t(1) . $taber . $this->_t(1) . "_t(1) . $taber . $this->_t(1) + . ""; + $field .= PHP_EOL . $this->_t(1) . $taber . $this->_t(1) + . " $value) { if ($property != 'option') { - $field .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1) . $property . '="' . $value . '"'; + $field .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1) + . $property . '="' . $value . '"'; } elseif ($property === 'option') { $optionSet = ''; - if (strtolower($typeName) === 'groupedlist' && strpos($value, ',') !== false && strpos($value, '@@') !== false) + if (strtolower($typeName) === 'groupedlist' + && strpos( + $value, ',' + ) !== false + && strpos($value, '@@') !== false) { // reset the group temp arrays - $groups_ = array(); - $grouped_ = array('group' => array(), 'option' => array()); - $order_ = array(); + $groups_ = array(); + $grouped_ = array('group' => array(), + 'option' => array()); + $order_ = array(); // mulitpal options $options = explode(',', $value); foreach ($options as $option) @@ -1296,13 +1670,22 @@ class Fields extends Structure $valueKeyArray = explode('@@', $option); if (count((array) $valueKeyArray) == 2) { - $langValue = $langView . '_' . ComponentbuilderHelper::safeFieldName($valueKeyArray[0], true); + $langValue = $langView . '_' + . ComponentbuilderHelper::safeFieldName( + $valueKeyArray[0], true + ); // add to lang array - $this->setLangContent($this->lang, $langValue, $valueKeyArray[0]); + $this->setLangContent( + $this->lang, $langValue, + $valueKeyArray[0] + ); // now add group label - $groups_[$valueKeyArray[1]] = PHP_EOL . $this->_t(1) . $taber . $this->_t(2) . ''; + $groups_[$valueKeyArray[1]] = PHP_EOL + . $this->_t(1) . $taber . $this->_t(2) + . ''; // set order - $order_['group' . $valueKeyArray[1]] = $valueKeyArray[1]; + $order_['group' . $valueKeyArray[1]] + = $valueKeyArray[1]; } } elseif (strpos($option, '|') !== false) @@ -1311,36 +1694,71 @@ class Fields extends Structure $valueKeyArray = explode('|', $option); if (count((array) $valueKeyArray) == 3) { - $langValue = $langView . '_' . ComponentbuilderHelper::safeFieldName($valueKeyArray[1], true); + $langValue = $langView . '_' + . ComponentbuilderHelper::safeFieldName( + $valueKeyArray[1], true + ); // add to lang array - $this->setLangContent($this->lang, $langValue, $valueKeyArray[1]); + $this->setLangContent( + $this->lang, $langValue, + $valueKeyArray[1] + ); // now add to option set - $grouped_['group'][$valueKeyArray[2]][] = PHP_EOL . $this->_t(1) . $taber . $this->_t(3) . ''; - $optionArray[$valueKeyArray[0]] = $langValue; + $grouped_['group'][$valueKeyArray[2]][] + = PHP_EOL . $this->_t(1) . $taber + . $this->_t(3) . ''; + $optionArray[$valueKeyArray[0]] + = $langValue; // set order - $order_['group' . $valueKeyArray[2]] = $valueKeyArray[2]; + $order_['group' . $valueKeyArray[2]] + = $valueKeyArray[2]; } else { - $langValue = $langView . '_' . ComponentbuilderHelper::safeFieldName($valueKeyArray[1], true); + $langValue = $langView . '_' + . ComponentbuilderHelper::safeFieldName( + $valueKeyArray[1], true + ); // add to lang array - $this->setLangContent($this->lang, $langValue, $valueKeyArray[1]); + $this->setLangContent( + $this->lang, $langValue, + $valueKeyArray[1] + ); // now add to option set - $grouped_['option'][$valueKeyArray[0]] = PHP_EOL . $this->_t(1) . $taber . $this->_t(2) . ''; - $optionArray[$valueKeyArray[0]] = $langValue; + $grouped_['option'][$valueKeyArray[0]] + = PHP_EOL . $this->_t(1) . $taber + . $this->_t(2) . ''; + $optionArray[$valueKeyArray[0]] + = $langValue; // set order - $order_['option' . $valueKeyArray[0]] = $valueKeyArray[0]; + $order_['option' . $valueKeyArray[0]] + = $valueKeyArray[0]; } } else { // text is also the value - $langValue = $langView . '_' . ComponentbuilderHelper::safeFieldName($option, true); + $langValue = $langView . '_' + . ComponentbuilderHelper::safeFieldName( + $option, true + ); // add to lang array - $this->setLangContent($this->lang, $langValue, $option); + $this->setLangContent( + $this->lang, $langValue, $option + ); // now add to option set - $grouped_['option'][$option] = PHP_EOL . $this->_t(1) . $taber . $this->_t(2) . ''; - $optionArray[$option] = $langValue; + $grouped_['option'][$option] = PHP_EOL + . $this->_t(1) . $taber . $this->_t(2) + . ''; + $optionArray[$option] = $langValue; // set order $order_['option' . $option] = $option; } @@ -1356,7 +1774,11 @@ class Fields extends Structure $key_ = 'option'; } // check if this is a group loader - if ('group' === $key_ && isset($groups_[$_id]) && isset($grouped_[$key_][$_id]) && ComponentbuilderHelper::checkArray($grouped_[$key_][$_id])) + if ('group' === $key_ && isset($groups_[$_id]) + && isset($grouped_[$key_][$_id]) + && ComponentbuilderHelper::checkArray( + $grouped_[$key_][$_id] + )) { // set group label $optionSet .= $groups_[$_id]; @@ -1367,9 +1789,13 @@ class Fields extends Structure unset($groups_[$_id]); unset($grouped_[$key_][$_id]); // close the group - $optionSet .= PHP_EOL . $this->_t(1) . $taber . $this->_t(2) . ''; + $optionSet .= PHP_EOL . $this->_t(1) . $taber + . $this->_t(2) . ''; } - elseif (isset($grouped_[$key_][$_id]) && ComponentbuilderHelper::checkString($grouped_[$key_][$_id])) + elseif (isset($grouped_[$key_][$_id]) + && ComponentbuilderHelper::checkString( + $grouped_[$key_][$_id] + )) { $optionSet .= $grouped_[$key_][$_id]; } @@ -1385,21 +1811,39 @@ class Fields extends Structure { // has other value then text list($v, $t) = explode('|', $option); - $langValue = $langView . '_' . ComponentbuilderHelper::safeFieldName($t, true); + $langValue = $langView . '_' + . ComponentbuilderHelper::safeFieldName( + $t, true + ); // add to lang array - $this->setLangContent($this->lang, $langValue, $t); + $this->setLangContent( + $this->lang, $langValue, $t + ); // now add to option set - $optionSet .= PHP_EOL . $this->_t(1) . $taber . $this->_t(2) . ''; + $optionSet .= PHP_EOL . $this->_t(1) + . $taber . $this->_t(2) . ''; $optionArray[$v] = $langValue; } else { // text is also the value - $langValue = $langView . '_' . ComponentbuilderHelper::safeFieldName($option, true); + $langValue = $langView . '_' + . ComponentbuilderHelper::safeFieldName( + $option, true + ); // add to lang array - $this->setLangContent($this->lang, $langValue, $option); + $this->setLangContent( + $this->lang, $langValue, $option + ); // now add to option set - $optionSet .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1) . ''; + $optionSet .= PHP_EOL . $this->_t(2) + . $taber . $this->_t(1) . ''; $optionArray[$option] = $langValue; } } @@ -1411,21 +1855,36 @@ class Fields extends Structure { // has other value then text list($v, $t) = explode('|', $value); - $langValue = $langView . '_' . ComponentbuilderHelper::safeFieldName($t, true); + $langValue = $langView . '_' + . ComponentbuilderHelper::safeFieldName( + $t, true + ); // add to lang array $this->setLangContent($this->lang, $langValue, $t); // now add to option set - $optionSet .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1) . ''; + $optionSet .= PHP_EOL . $this->_t(2) . $taber + . $this->_t(1) . ''; $optionArray[$v] = $langValue; } else { // text is also the value - $langValue = $langView . '_' . ComponentbuilderHelper::safeFieldName($value, true); + $langValue = $langView . '_' + . ComponentbuilderHelper::safeFieldName( + $value, true + ); // add to lang array - $this->setLangContent($this->lang, $langValue, $value); + $this->setLangContent( + $this->lang, $langValue, $value + ); // now add to option set - $optionSet .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1) . ''; + $optionSet .= PHP_EOL . $this->_t(2) + . $taber . $this->_t(1) . ''; $optionArray[$value] = $langValue; } } @@ -1435,7 +1894,8 @@ class Fields extends Structure if (ComponentbuilderHelper::checkString($optionSet)) { $field .= '>'; - $field .= PHP_EOL . $this->_t(3) . $taber . ""; + $field .= PHP_EOL . $this->_t(3) . $taber . ""; $field .= $optionSet; $field .= PHP_EOL . $this->_t(2) . $taber . ""; } @@ -1443,25 +1903,33 @@ class Fields extends Structure elseif (ComponentbuilderHelper::fieldCheck($typeName, 'list')) { $optionArray = false; - $field .= PHP_EOL . $this->_t(2) . $taber . "/>"; - $field .= PHP_EOL . $this->_t(2) . $taber . "" . PHP_EOL; + $field .= PHP_EOL . $this->_t(2) . $taber . "/>"; + $field .= PHP_EOL . $this->_t(2) . $taber . "" + . PHP_EOL; } else { $optionArray = false; - $field .= PHP_EOL . $this->_t(2) . $taber . "/>"; + $field .= PHP_EOL . $this->_t(2) . $taber . "/>"; } } elseif ($setType === 'plain') { // now add to the field set - $field .= PHP_EOL . $this->_t(2) . $taber . ""; + $field .= PHP_EOL . $this->_t(2) . $taber . ""; $field .= PHP_EOL . $this->_t(2) . $taber . " $value) { if ($property != 'option') { - $field .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1) . $property . '="' . $value . '"'; + $field .= PHP_EOL . $this->_t(2) . $taber . $this->_t(1) + . $property . '="' . $value . '"'; } } $field .= PHP_EOL . $this->_t(2) . $taber . "/>"; @@ -1469,7 +1937,10 @@ class Fields extends Structure elseif ($setType === 'spacer') { // now add to the field set - $field .= PHP_EOL . $this->_t(2) . ""; + $field .= PHP_EOL . $this->_t(2) . ""; $field .= PHP_EOL . $this->_t(2) . " $value) { @@ -1486,23 +1957,33 @@ class Fields extends Structure if ($typeName === 'repeatable') { // now add to the field set - $field .= PHP_EOL . $this->_t(2) . ""; - $field .= PHP_EOL . $this->_t(2) . "_t(2) . ""; + $field .= PHP_EOL . $this->_t(2) . " $value) { if ($property != 'fields') { - $field .= PHP_EOL . $this->_t(3) . $property . '="' . $value . '"'; + $field .= PHP_EOL . $this->_t(3) . $property . '="' + . $value . '"'; } } $field .= ">"; - $field .= PHP_EOL . $this->_t(3) . ''; - $field .= PHP_EOL . $this->_t(4) . '
', \$this->setModules[\$position]).'';"; + $addModule[] = $this->_t(5) + . "return ''.implode('', \$this->setModules[\$position]).'';"; $addModule[] = $this->_t(5) . "break;"; $addModule[] = $this->_t(4) . "case 'list':"; - $addModule[] = $this->_t(5) . "return '
  • '.implode('
  • ', \$this->setModules[\$position]).'
  • ';"; + $addModule[] = $this->_t(5) + . "return '
  • '.implode('
  • ', \$this->setModules[\$position]).'
  • ';"; $addModule[] = $this->_t(5) . "break;"; $addModule[] = $this->_t(4) . "case 'array':"; $addModule[] = $this->_t(4) . "case 'Array':"; - $addModule[] = $this->_t(5) . "return \$this->setModules[\$position];"; + $addModule[] = $this->_t(5) + . "return \$this->setModules[\$position];"; $addModule[] = $this->_t(5) . "break;"; $addModule[] = $this->_t(4) . "default:"; - $addModule[] = $this->_t(5) . "return implode('
    ', \$this->setModules[\$position]);"; + $addModule[] = $this->_t(5) + . "return implode('
    ', \$this->setModules[\$position]);"; $addModule[] = $this->_t(5) . "break;"; $addModule[] = $this->_t(4); $addModule[] = $this->_t(3) . "}"; @@ -3570,11 +5238,16 @@ class Interpretation extends Fields $addModule[] = $this->_t(2) . "return false;"; $addModule[] = $this->_t(1) . "}"; - $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET . '_GET_MODULE_JIMPORT' . $this->hhh] = PHP_EOL . "jimport('joomla.application.module.helper');"; + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . $TARGET . '_GET_MODULE_JIMPORT' . $this->hhh] + = PHP_EOL . "jimport('joomla.application.module.helper');"; return implode(PHP_EOL, $addModule); } - $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET . '_GET_MODULE_JIMPORT' . $this->hhh] = ''; + $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET + . '_GET_MODULE_JIMPORT' . $this->hhh] + = ''; + return ''; } @@ -3582,13 +5255,21 @@ class Interpretation extends Fields { if ($view['settings']->add_php_document == 1) { - $view['settings']->php_document = (array) explode(PHP_EOL, $view['settings']->php_document); - if (ComponentbuilderHelper::checkArray($view['settings']->php_document)) + $view['settings']->php_document = (array) explode( + PHP_EOL, $view['settings']->php_document + ); + if (ComponentbuilderHelper::checkArray( + $view['settings']->php_document + )) { - $_tmp = PHP_EOL . $this->_t(2) . implode(PHP_EOL . $this->_t(2), $view['settings']->php_document); + $_tmp = PHP_EOL . $this->_t(2) . implode( + PHP_EOL . $this->_t(2), $view['settings']->php_document + ); + return $this->setPlaceholders($_tmp, $this->placeholders); } } + return ''; } @@ -3606,22 +5287,36 @@ class Interpretation extends Fields } if (2 == $type) { - $viewName = ComponentbuilderHelper::safeString($view['settings']->name_single); + $viewName = ComponentbuilderHelper::safeString( + $view['settings']->name_single + ); } // set the custom buttons CUSTOM_BUTTONS_CONTROLLER - $this->fileContentDynamic[$viewName][$this->hhh . $TARGET . '_CUSTOM_BUTTONS_CONTROLLER' . $this->hhh] = ''; + $this->fileContentDynamic[$viewName][$this->hhh . $TARGET + . '_CUSTOM_BUTTONS_CONTROLLER' . $this->hhh] + = ''; // set the custom buttons CUSTOM_BUTTONS_METHOD - $this->fileContentDynamic[$viewName][$this->hhh . $TARGET . '_CUSTOM_BUTTONS_METHOD' . $this->hhh] = ''; + $this->fileContentDynamic[$viewName][$this->hhh . $TARGET + . '_CUSTOM_BUTTONS_METHOD' . $this->hhh] + = ''; } elseif (3 == $type) { // set the names - $viewName = ComponentbuilderHelper::safeString($view['settings']->name_single); - $viewsName = ComponentbuilderHelper::safeString($view['settings']->name_list); + $viewName = ComponentbuilderHelper::safeString( + $view['settings']->name_single + ); + $viewsName = ComponentbuilderHelper::safeString( + $view['settings']->name_list + ); // set the custom buttons CUSTOM_BUTTONS_CONTROLLER_LIST - $this->fileContentDynamic[$viewsName][$this->hhh . $TARGET . '_CUSTOM_BUTTONS_CONTROLLER_LIST' . $this->hhh] = ''; + $this->fileContentDynamic[$viewsName][$this->hhh . $TARGET + . '_CUSTOM_BUTTONS_CONTROLLER_LIST' . $this->hhh] + = ''; // set the custom buttons CUSTOM_BUTTONS_METHOD_LIST - $this->fileContentDynamic[$viewsName][$this->hhh . $TARGET . '_CUSTOM_BUTTONS_METHOD_LIST' . $this->hhh] = ''; + $this->fileContentDynamic[$viewsName][$this->hhh . $TARGET + . '_CUSTOM_BUTTONS_METHOD_LIST' . $this->hhh] + = ''; // validate selection $validateSelection = 'true'; } @@ -3629,88 +5324,159 @@ class Interpretation extends Fields if ($this->target === 'site') { // set the custom buttons SITE_TOP_BUTTON - $this->fileContentDynamic[$viewName][$this->hhh . 'SITE_TOP_BUTTON' . $this->hhh] = ''; + $this->fileContentDynamic[$viewName][$this->hhh . 'SITE_TOP_BUTTON' + . $this->hhh] + = ''; // set the custom buttons SITE_BOTTOM_BUTTON - $this->fileContentDynamic[$viewName][$this->hhh . 'SITE_BOTTOM_BUTTON' . $this->hhh] = ''; + $this->fileContentDynamic[$viewName][$this->hhh + . 'SITE_BOTTOM_BUTTON' . $this->hhh] + = ''; // load into place switch ($view['settings']->button_position) { case 1: // set buttons to top right of the view - $this->fileContentDynamic[$viewName][$this->hhh . 'SITE_TOP_BUTTON' . $this->hhh] = '
    toolbar->render(); ?>
    '; + $this->fileContentDynamic[$viewName][$this->hhh + . 'SITE_TOP_BUTTON' . $this->hhh] + = '
    toolbar->render(); ?>
    '; break; case 2: // set buttons to top left of the view - $this->fileContentDynamic[$viewName][$this->hhh . 'SITE_TOP_BUTTON' . $this->hhh] = 'toolbar->render(); ?>'; + $this->fileContentDynamic[$viewName][$this->hhh + . 'SITE_TOP_BUTTON' . $this->hhh] + = 'toolbar->render(); ?>'; break; case 3: // set buttons to buttom right of the view - $this->fileContentDynamic[$viewName][$this->hhh . 'SITE_BOTTOM_BUTTON' . $this->hhh] = '
    toolbar->render(); ?>
    '; + $this->fileContentDynamic[$viewName][$this->hhh + . 'SITE_BOTTOM_BUTTON' . $this->hhh] + = '
    toolbar->render(); ?>
    '; break; case 4: // set buttons to buttom left of the view - $this->fileContentDynamic[$viewName][$this->hhh . 'SITE_BOTTOM_BUTTON' . $this->hhh] = 'toolbar->render(); ?>'; + $this->fileContentDynamic[$viewName][$this->hhh + . 'SITE_BOTTOM_BUTTON' . $this->hhh] + = 'toolbar->render(); ?>'; break; case 5: // set buttons to buttom left of the view - $this->placeholders[$this->bbb . 'SITE_TOOLBAR' . $this->ddd] = 'toolbar->render(); ?>'; + $this->placeholders[$this->bbb . 'SITE_TOOLBAR' + . $this->ddd] + = 'toolbar->render(); ?>'; break; } } // check if custom button should be added - if (isset($view['settings']->add_custom_button) && $view['settings']->add_custom_button == 1) + if (isset($view['settings']->add_custom_button) + && $view['settings']->add_custom_button == 1) { - $buttons = array(); + $buttons = array(); $this->onlyFunctionButton = array(); - $functionNames = array(); - if (isset($view['settings']->custom_buttons) && ComponentbuilderHelper::checkArray($view['settings']->custom_buttons)) + $functionNames = array(); + if (isset($view['settings']->custom_buttons) + && ComponentbuilderHelper::checkArray( + $view['settings']->custom_buttons + )) { foreach ($view['settings']->custom_buttons as $custom_button) { // Load to lang - $keyLang = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($custom_button['name'], 'U'); - $keyCode = ComponentbuilderHelper::safeString($custom_button['name']); - $this->setLangContent($this->lang, $keyLang, $custom_button['name']); + $keyLang = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString( + $custom_button['name'], 'U' + ); + $keyCode = ComponentbuilderHelper::safeString( + $custom_button['name'] + ); + $this->setLangContent( + $this->lang, $keyLang, $custom_button['name'] + ); // load the button - if (3 !== $type && ($custom_button['target'] != 2 || $this->target === 'site')) + if (3 !== $type + && ($custom_button['target'] != 2 + || $this->target === 'site')) { // add cpanel button TODO does not work well on site with permissions - if ($custom_button['target'] == 2 || $this->target === 'site') + if ($custom_button['target'] == 2 + || $this->target === 'site') { - $buttons[] = $this->_t(1) . $tab . $this->_t(1) . "if (\$this->user->authorise('" . $viewName . "." . $keyCode . "', 'com_" . $this->componentCodeName . "'))"; + $buttons[] = $this->_t(1) . $tab . $this->_t(1) + . "if (\$this->user->authorise('" . $viewName + . "." . $keyCode . "', 'com_" + . $this->componentCodeName . "'))"; } else { - $buttons[] = $this->_t(1) . $tab . $this->_t(1) . "if (\$this->canDo->get('" . $viewName . "." . $keyCode . "'))"; + $buttons[] = $this->_t(1) . $tab . $this->_t(1) + . "if (\$this->canDo->get('" . $viewName . "." + . $keyCode . "'))"; } $buttons[] = $this->_t(1) . $tab . $this->_t(1) . "{"; - $buttons[] = $this->_t(1) . $tab . $this->_t(2) . "//" . $this->setLine(__LINE__) . " add " . $custom_button['name'] . " button."; - $buttons[] = $this->_t(1) . $tab . $this->_t(2) . "JToolBarHelper::custom('" . $viewName . "." . $custom_button['method'] . "', '" . $custom_button['icomoon'] . "', '', '" . $keyLang . "', false);"; + $buttons[] = $this->_t(1) . $tab . $this->_t(2) . "//" + . $this->setLine(__LINE__) . " add " + . $custom_button['name'] . " button."; + $buttons[] = $this->_t(1) . $tab . $this->_t(2) + . "JToolBarHelper::custom('" . $viewName . "." + . $custom_button['method'] . "', '" + . $custom_button['icomoon'] . "', '', '" . $keyLang + . "', false);"; $buttons[] = $this->_t(1) . $tab . $this->_t(1) . "}"; } // load the list button elseif (3 == $type && $custom_button['target'] != 1) { // This is only for list admin views - if (isset($custom_button['type']) && $custom_button['type'] == 2) + if (isset($custom_button['type']) + && $custom_button['type'] == 2) { if (!isset($this->onlyFunctionButton[$viewsName])) { $this->onlyFunctionButton[$viewsName] = array(); } - $this->onlyFunctionButton[$viewsName][] = $this->_t(1) . $tab . "if (\$this->user->authorise('" . $viewName . "." . $keyCode . "', 'com_" . $this->componentCodeName . "'))"; - $this->onlyFunctionButton[$viewsName][] = $this->_t(1) . $tab . "{"; - $this->onlyFunctionButton[$viewsName][] = $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " add " . $custom_button['name'] . " button."; - $this->onlyFunctionButton[$viewsName][] = $this->_t(1) . $tab . $this->_t(1) . "JToolBarHelper::custom('" . $viewsName . "." . $custom_button['method'] . "', '" . $custom_button['icomoon'] . "', '', '" . $keyLang . "', false);"; - $this->onlyFunctionButton[$viewsName][] = $this->_t(1) . $tab . "}"; + $this->onlyFunctionButton[$viewsName][] = $this->_t( + 1 + ) . $tab . "if (\$this->user->authorise('" + . $viewName . "." . $keyCode . "', 'com_" + . $this->componentCodeName . "'))"; + $this->onlyFunctionButton[$viewsName][] = $this->_t( + 1 + ) . $tab . "{"; + $this->onlyFunctionButton[$viewsName][] = $this->_t( + 1 + ) . $tab . $this->_t(1) . "//" . $this->setLine( + __LINE__ + ) . " add " . $custom_button['name'] + . " button."; + $this->onlyFunctionButton[$viewsName][] = $this->_t( + 1 + ) . $tab . $this->_t(1) + . "JToolBarHelper::custom('" . $viewsName . "." + . $custom_button['method'] . "', '" + . $custom_button['icomoon'] . "', '', '" + . $keyLang . "', false);"; + $this->onlyFunctionButton[$viewsName][] = $this->_t( + 1 + ) . $tab . "}"; } else { - $buttons[] = $this->_t(1) . $tab . $this->_t(1) . "if (\$this->user->authorise('" . $viewName . "." . $keyCode . "', 'com_" . $this->componentCodeName . "'))"; - $buttons[] = $this->_t(1) . $tab . $this->_t(1) . "{"; - $buttons[] = $this->_t(1) . $tab . $this->_t(2) . "//" . $this->setLine(__LINE__) . " add " . $custom_button['name'] . " button."; - $buttons[] = $this->_t(1) . $tab . $this->_t(2) . "JToolBarHelper::custom('" . $viewsName . "." . $custom_button['method'] . "', '" . $custom_button['icomoon'] . "', '', '" . $keyLang . "', '" . $validateSelection . "');"; - $buttons[] = $this->_t(1) . $tab . $this->_t(1) . "}"; + $buttons[] = $this->_t(1) . $tab . $this->_t(1) + . "if (\$this->user->authorise('" . $viewName + . "." . $keyCode . "', 'com_" + . $this->componentCodeName . "'))"; + $buttons[] = $this->_t(1) . $tab . $this->_t(1) + . "{"; + $buttons[] = $this->_t(1) . $tab . $this->_t(2) + . "//" . $this->setLine(__LINE__) . " add " + . $custom_button['name'] . " button."; + $buttons[] = $this->_t(1) . $tab . $this->_t(2) + . "JToolBarHelper::custom('" . $viewsName . "." + . $custom_button['method'] . "', '" + . $custom_button['icomoon'] . "', '', '" + . $keyLang . "', '" . $validateSelection + . "');"; + $buttons[] = $this->_t(1) . $tab . $this->_t(1) + . "}"; } } } @@ -3719,25 +5485,51 @@ class Interpretation extends Fields if (3 == $type) { // insure the controller and model strings are added - if (isset($view['settings']->php_controller_list) && ComponentbuilderHelper::checkString($view['settings']->php_controller_list) && $view['settings']->php_controller_list != '//') + if (isset($view['settings']->php_controller_list) + && ComponentbuilderHelper::checkString( + $view['settings']->php_controller_list + ) + && $view['settings']->php_controller_list != '//') { // set the custom buttons CUSTOM_BUTTONS_CONTROLLER - $this->fileContentDynamic[$viewsName][$this->hhh . $TARGET . '_CUSTOM_BUTTONS_CONTROLLER_LIST' . $this->hhh] = PHP_EOL . PHP_EOL . $this->setPlaceholders($view['settings']->php_controller_list, $this->placeholders); + $this->fileContentDynamic[$viewsName][$this->hhh . $TARGET + . '_CUSTOM_BUTTONS_CONTROLLER_LIST' . $this->hhh] + = PHP_EOL . PHP_EOL . $this->setPlaceholders( + $view['settings']->php_controller_list, + $this->placeholders + ); } // load the model - if (isset($view['settings']->php_model_list) && ComponentbuilderHelper::checkString($view['settings']->php_model_list) && $view['settings']->php_model_list != '//') + if (isset($view['settings']->php_model_list) + && ComponentbuilderHelper::checkString( + $view['settings']->php_model_list + ) + && $view['settings']->php_model_list != '//') { // set the custom buttons CUSTOM_BUTTONS_METHOD - $this->fileContentDynamic[$viewsName][$this->hhh . $TARGET . '_CUSTOM_BUTTONS_METHOD_LIST' . $this->hhh] = PHP_EOL . PHP_EOL . $this->setPlaceholders($view['settings']->php_model_list, $this->placeholders); + $this->fileContentDynamic[$viewsName][$this->hhh . $TARGET + . '_CUSTOM_BUTTONS_METHOD_LIST' . $this->hhh] + = PHP_EOL . PHP_EOL . $this->setPlaceholders( + $view['settings']->php_model_list, + $this->placeholders + ); } } else { // insure the controller and model strings are added - if (ComponentbuilderHelper::checkString($view['settings']->php_controller) && $view['settings']->php_controller != '//') + if (ComponentbuilderHelper::checkString( + $view['settings']->php_controller + ) + && $view['settings']->php_controller != '//') { // set the custom buttons CUSTOM_BUTTONS_CONTROLLER - $this->fileContentDynamic[$viewName][$this->hhh . $TARGET . '_CUSTOM_BUTTONS_CONTROLLER' . $this->hhh] = PHP_EOL . PHP_EOL . $this->setPlaceholders($view['settings']->php_controller, $this->placeholders); + $this->fileContentDynamic[$viewName][$this->hhh . $TARGET + . '_CUSTOM_BUTTONS_CONTROLLER' . $this->hhh] + = PHP_EOL . PHP_EOL . $this->setPlaceholders( + $view['settings']->php_controller, + $this->placeholders + ); if ('site' === $this->target) { // add the controller for this view @@ -3748,36 +5540,52 @@ class Interpretation extends Fields } } // load the model - if (ComponentbuilderHelper::checkString($view['settings']->php_model) && $view['settings']->php_model != '//') + if (ComponentbuilderHelper::checkString( + $view['settings']->php_model + ) + && $view['settings']->php_model != '//') { // set the custom buttons CUSTOM_BUTTONS_METHOD - $this->fileContentDynamic[$viewName][$this->hhh . $TARGET . '_CUSTOM_BUTTONS_METHOD' . $this->hhh] = PHP_EOL . PHP_EOL . $this->setPlaceholders($view['settings']->php_model, $this->placeholders); + $this->fileContentDynamic[$viewName][$this->hhh . $TARGET + . '_CUSTOM_BUTTONS_METHOD' . $this->hhh] + = PHP_EOL . PHP_EOL . $this->setPlaceholders( + $view['settings']->php_model, $this->placeholders + ); } } // return buttons if they were build if (ComponentbuilderHelper::checkArray($buttons)) { // set the custom get form method JAVASCRIPT_FOR_BUTTONS - $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET . '_JAVASCRIPT_FOR_BUTTONS' . $this->hhh] = $this->setJavaScriptForButtons(); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . $TARGET . '_JAVASCRIPT_FOR_BUTTONS' . $this->hhh] + = $this->setJavaScriptForButtons(); // insure the form is added (only if not form exist) - if (isset($view['settings']->default) && strpos($view['settings']->default, 'default) + && strpos( + $view['settings']->default, 'addCustomForm[$this->target][$view['settings']->code] = true; + $this->addCustomForm[$this->target][$view['settings']->code] + = true; } return PHP_EOL . implode(PHP_EOL, $buttons); } } + return ''; } public function setJavaScriptForButtons() { // add behavior.framework to insure Joomla function is on the page - $script = array(); - $script[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add the needed Javascript to insure that the buttons work."; + $script = array(); + $script[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Add the needed Javascript to insure that the buttons work."; $script[] = $this->_t(2) . "JHtml::_('behavior.framework', true);"; - $script[] = $this->_t(2) . "\$this->document->addScriptDeclaration(\"Joomla.submitbutton = function(task){if (task == ''){ return false; } else { Joomla.submitform(task); return true; }}\");"; + $script[] = $this->_t(2) + . "\$this->document->addScriptDeclaration(\"Joomla.submitbutton = function(task){if (task == ''){ return false; } else { Joomla.submitform(task); return true; }}\");"; // return the script return PHP_EOL . implode(PHP_EOL, $script); @@ -3786,10 +5594,16 @@ class Interpretation extends Fields public function setFunctionOnlyButtons($viewName_list) { // return buttons if they were build - if (isset($this->onlyFunctionButton[$viewName_list]) && ComponentbuilderHelper::checkArray($this->onlyFunctionButton[$viewName_list])) + if (isset($this->onlyFunctionButton[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->onlyFunctionButton[$viewName_list] + )) { - return PHP_EOL . implode(PHP_EOL, $this->onlyFunctionButton[$viewName_list]); + return PHP_EOL . implode( + PHP_EOL, $this->onlyFunctionButton[$viewName_list] + ); } + return ''; } @@ -3799,9 +5613,12 @@ class Interpretation extends Fields { if (ComponentbuilderHelper::checkString($view['settings']->css)) { - return $this->setPlaceholders($view['settings']->css, $this->placeholders); + return $this->setPlaceholders( + $view['settings']->css, $this->placeholders + ); } } + return ''; } @@ -3809,42 +5626,77 @@ class Interpretation extends Fields { if ($view['settings']->add_css_document == 1) { - $view['settings']->css_document = (array) explode(PHP_EOL, $view['settings']->css_document); - if (ComponentbuilderHelper::checkArray($view['settings']->css_document)) + $view['settings']->css_document = (array) explode( + PHP_EOL, $view['settings']->css_document + ); + if (ComponentbuilderHelper::checkArray( + $view['settings']->css_document + )) { - $script = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Set the Custom CSS script to view" . PHP_EOL . $this->_t(2) . '$this->document->addStyleDeclaration("'; - $cssDocument = PHP_EOL . $this->_t(3) . str_replace('"', '\"', implode(PHP_EOL . $this->_t(3), $view['settings']->css_document)); - return $script . $this->setPlaceholders($cssDocument, $this->placeholders) . PHP_EOL . $this->_t(2) . '");'; + $script = PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Set the Custom CSS script to view" . PHP_EOL + . $this->_t(2) . '$this->document->addStyleDeclaration("'; + $cssDocument = PHP_EOL . $this->_t(3) . str_replace( + '"', '\"', implode( + PHP_EOL . $this->_t(3), + $view['settings']->css_document + ) + ); + + return $script . $this->setPlaceholders( + $cssDocument, $this->placeholders + ) . PHP_EOL . $this->_t(2) . '");'; } } + return ''; } public function setJavaScriptFile(&$view, $TARGET) { - if ($view['settings']->add_javascript_file == 1 && ComponentbuilderHelper::checkString($view['settings']->javascript_file)) + if ($view['settings']->add_javascript_file == 1 + && ComponentbuilderHelper::checkString( + $view['settings']->javascript_file + )) { // get dates - $created = $this->getCreatedDate($view); + $created = $this->getCreatedDate($view); $modified = $this->getLastModifiedDate($view); // add file to view $target = array($this->target => $view['settings']->code); - $config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $created, $this->hhh . 'BUILDDATE' . $this->hhh => $modified, $this->hhh . 'VERSION' . $this->hhh => $view['settings']->version); + $config = array($this->hhh . 'CREATIONDATE' + . $this->hhh => $created, + $this->hhh . 'BUILDDATE' . $this->hhh => $modified, + $this->hhh . 'VERSION' + . $this->hhh => $view['settings']->version); $this->buildDynamique($target, 'javascript_file', false, $config); // set path if ('site' === $this->target) { - $path = '/components/com_' . $this->componentCodeName . '/assets/js/' . $view['settings']->code . '.js'; + $path = '/components/com_' . $this->componentCodeName + . '/assets/js/' . $view['settings']->code . '.js'; } else { - $path = '/administrator/components/com_' . $this->componentCodeName . '/assets/js/' . $view['settings']->code . '.js'; + $path = '/administrator/components/com_' + . $this->componentCodeName . '/assets/js/' + . $view['settings']->code . '.js'; } // add script to file - $this->fileContentDynamic[$view['settings']->code][$this->hhh . $TARGET . '_JAVASCRIPT_FILE' . $this->hhh] = $this->setPlaceholders($view['settings']->javascript_file, $this->placeholders); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . $TARGET . '_JAVASCRIPT_FILE' . $this->hhh] + = $this->setPlaceholders( + $view['settings']->javascript_file, $this->placeholders + ); + // add script to view - return PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add View JavaScript File" . PHP_EOL . $this->_t(2) . $this->setIncludeLibScript($path); + return PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Add View JavaScript File" . PHP_EOL . $this->_t(2) + . $this->setIncludeLibScript($path); } + return ''; } @@ -3852,29 +5704,49 @@ class Interpretation extends Fields { if ($view['settings']->add_js_document == 1) { - $view['settings']->js_document = (array) explode(PHP_EOL, $view['settings']->js_document); - if (ComponentbuilderHelper::checkArray($view['settings']->js_document)) + $view['settings']->js_document = (array) explode( + PHP_EOL, $view['settings']->js_document + ); + if (ComponentbuilderHelper::checkArray( + $view['settings']->js_document + )) { - $script = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Set the Custom JS script to view" . PHP_EOL . $this->_t(2) . '$this->document->addScriptDeclaration("'; - $jsDocument = PHP_EOL . $this->_t(3) . str_replace('"', '\"', implode(PHP_EOL . $this->_t(3), $view['settings']->js_document)); - return $script . $this->setPlaceholders($jsDocument, $this->placeholders) . PHP_EOL . $this->_t(2) . '");'; + $script = PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Set the Custom JS script to view" . PHP_EOL + . $this->_t(2) . '$this->document->addScriptDeclaration("'; + $jsDocument = PHP_EOL . $this->_t(3) . str_replace( + '"', '\"', implode( + PHP_EOL . $this->_t(3), + $view['settings']->js_document + ) + ); + + return $script . $this->setPlaceholders( + $jsDocument, $this->placeholders + ) . PHP_EOL . $this->_t(2) . '");'; } } + return ''; } public function setFootableScriptsLoader(&$view) { - if (isset($this->footableScripts[$this->target][$view['settings']->code]) && $this->footableScripts[$this->target][$view['settings']->code]) + if (isset($this->footableScripts[$this->target][$view['settings']->code]) + && $this->footableScripts[$this->target][$view['settings']->code]) { return $this->setFootableScripts(false); } + return ''; } public function setDocumentMetadata(&$view) { - if ($view['settings']->main_get->gettype == 1 && isset($view['metadata']) && $view['metadata'] == 1) + if ($view['settings']->main_get->gettype == 1 + && isset($view['metadata']) + && $view['metadata'] == 1) { return $this->setMetadataItem(); } @@ -3883,9 +5755,12 @@ class Interpretation extends Fields // lets check if we have a custom get method that has the same name as the view // if we do then it posibly can be that the metadata is loaded via that method // and we can load the full metadata structure with its vars - if (isset($view['settings']->custom_get) && ComponentbuilderHelper::checkArray($view['settings']->custom_get)) + if (isset($view['settings']->custom_get) + && ComponentbuilderHelper::checkArray( + $view['settings']->custom_get + )) { - $found = false; + $found = false; $searchFor = 'get' . $view['settings']->Code; foreach ($view['settings']->custom_get as $custom_get) { @@ -3910,48 +5785,72 @@ class Interpretation extends Fields return $this->setMetadataList(); } } + return ''; } public function setMetadataItem($item = 'item') { - $meta = array(); - $meta[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " load the meta description"; - $meta[] = $this->_t(2) . "if (isset(\$this->" . $item . "->metadesc) && \$this->" . $item . "->metadesc)"; + $meta = array(); + $meta[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " load the meta description"; + $meta[] = $this->_t(2) . "if (isset(\$this->" . $item + . "->metadesc) && \$this->" . $item . "->metadesc)"; $meta[] = $this->_t(2) . "{"; - $meta[] = $this->_t(3) . "\$this->document->setDescription(\$this->" . $item . "->metadesc);"; + $meta[] = $this->_t(3) . "\$this->document->setDescription(\$this->" + . $item . "->metadesc);"; $meta[] = $this->_t(2) . "}"; - $meta[] = $this->_t(2) . "elseif (\$this->params->get('menu-meta_description'))"; + $meta[] = $this->_t(2) + . "elseif (\$this->params->get('menu-meta_description'))"; $meta[] = $this->_t(2) . "{"; - $meta[] = $this->_t(3) . "\$this->document->setDescription(\$this->params->get('menu-meta_description'));"; + $meta[] = $this->_t(3) + . "\$this->document->setDescription(\$this->params->get('menu-meta_description'));"; $meta[] = $this->_t(2) . "}"; - $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " load the key words if set"; - $meta[] = $this->_t(2) . "if (isset(\$this->" . $item . "->metakey) && \$this->" . $item . "->metakey)"; + $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " load the key words if set"; + $meta[] = $this->_t(2) . "if (isset(\$this->" . $item + . "->metakey) && \$this->" . $item . "->metakey)"; $meta[] = $this->_t(2) . "{"; - $meta[] = $this->_t(3) . "\$this->document->setMetadata('keywords', \$this->" . $item . "->metakey);"; + $meta[] = $this->_t(3) + . "\$this->document->setMetadata('keywords', \$this->" . $item + . "->metakey);"; $meta[] = $this->_t(2) . "}"; - $meta[] = $this->_t(2) . "elseif (\$this->params->get('menu-meta_keywords'))"; + $meta[] = $this->_t(2) + . "elseif (\$this->params->get('menu-meta_keywords'))"; $meta[] = $this->_t(2) . "{"; - $meta[] = $this->_t(3) . "\$this->document->setMetadata('keywords', \$this->params->get('menu-meta_keywords'));"; + $meta[] = $this->_t(3) + . "\$this->document->setMetadata('keywords', \$this->params->get('menu-meta_keywords'));"; $meta[] = $this->_t(2) . "}"; - $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " check the robot params"; - $meta[] = $this->_t(2) . "if (isset(\$this->" . $item . "->robots) && \$this->" . $item . "->robots)"; + $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " check the robot params"; + $meta[] = $this->_t(2) . "if (isset(\$this->" . $item + . "->robots) && \$this->" . $item . "->robots)"; $meta[] = $this->_t(2) . "{"; - $meta[] = $this->_t(3) . "\$this->document->setMetadata('robots', \$this->" . $item . "->robots);"; + $meta[] = $this->_t(3) + . "\$this->document->setMetadata('robots', \$this->" . $item + . "->robots);"; $meta[] = $this->_t(2) . "}"; $meta[] = $this->_t(2) . "elseif (\$this->params->get('robots'))"; $meta[] = $this->_t(2) . "{"; - $meta[] = $this->_t(3) . "\$this->document->setMetadata('robots', \$this->params->get('robots'));"; + $meta[] = $this->_t(3) + . "\$this->document->setMetadata('robots', \$this->params->get('robots'));"; $meta[] = $this->_t(2) . "}"; - $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if autor is to be set"; - $meta[] = $this->_t(2) . "if (isset(\$this->" . $item . "->created_by) && \$this->params->get('MetaAuthor') == '1')"; + $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " check if autor is to be set"; + $meta[] = $this->_t(2) . "if (isset(\$this->" . $item + . "->created_by) && \$this->params->get('MetaAuthor') == '1')"; $meta[] = $this->_t(2) . "{"; - $meta[] = $this->_t(3) . "\$this->document->setMetaData('author', \$this->" . $item . "->created_by);"; + $meta[] = $this->_t(3) + . "\$this->document->setMetaData('author', \$this->" . $item + . "->created_by);"; $meta[] = $this->_t(2) . "}"; - $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if metadata is available"; - $meta[] = $this->_t(2) . "if (isset(\$this->" . $item . "->metadata) && \$this->" . $item . "->metadata)"; + $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " check if metadata is available"; + $meta[] = $this->_t(2) . "if (isset(\$this->" . $item + . "->metadata) && \$this->" . $item . "->metadata)"; $meta[] = $this->_t(2) . "{"; - $meta[] = $this->_t(3) . "\$mdata = json_decode(\$this->" . $item . "->metadata,true);"; + $meta[] = $this->_t(3) . "\$mdata = json_decode(\$this->" . $item + . "->metadata,true);"; $meta[] = $this->_t(3) . "foreach (\$mdata as \$k => \$v)"; $meta[] = $this->_t(3) . "{"; $meta[] = $this->_t(4) . "if (\$v)"; @@ -3966,21 +5865,29 @@ class Interpretation extends Fields public function setMetadataList() { - $meta = array(); - $meta[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " load the meta description"; - $meta[] = $this->_t(2) . "if (\$this->params->get('menu-meta_description'))"; + $meta = array(); + $meta[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " load the meta description"; + $meta[] = $this->_t(2) + . "if (\$this->params->get('menu-meta_description'))"; $meta[] = $this->_t(2) . "{"; - $meta[] = $this->_t(3) . "\$this->document->setDescription(\$this->params->get('menu-meta_description'));"; + $meta[] = $this->_t(3) + . "\$this->document->setDescription(\$this->params->get('menu-meta_description'));"; $meta[] = $this->_t(2) . "}"; - $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " load the key words if set"; - $meta[] = $this->_t(2) . "if (\$this->params->get('menu-meta_keywords'))"; + $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " load the key words if set"; + $meta[] = $this->_t(2) + . "if (\$this->params->get('menu-meta_keywords'))"; $meta[] = $this->_t(2) . "{"; - $meta[] = $this->_t(3) . "\$this->document->setMetadata('keywords', \$this->params->get('menu-meta_keywords'));"; + $meta[] = $this->_t(3) + . "\$this->document->setMetadata('keywords', \$this->params->get('menu-meta_keywords'));"; $meta[] = $this->_t(2) . "}"; - $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " check the robot params"; + $meta[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " check the robot params"; $meta[] = $this->_t(2) . "if (\$this->params->get('robots'))"; $meta[] = $this->_t(2) . "{"; - $meta[] = $this->_t(3) . "\$this->document->setMetadata('robots', \$this->params->get('robots'));"; + $meta[] = $this->_t(3) + . "\$this->document->setMetadata('robots', \$this->params->get('robots'));"; $meta[] = $this->_t(2) . "}"; return implode(PHP_EOL, $meta); @@ -3988,17 +5895,37 @@ class Interpretation extends Fields public function setGoogleChartLoader(&$view) { - if (isset($this->googleChart[$this->target][$view['settings']->code]) && $this->googleChart[$this->target][$view['settings']->code]) + if (isset($this->googleChart[$this->target][$view['settings']->code]) + && $this->googleChart[$this->target][$view['settings']->code]) { - $chart = array(); - $chart[] = PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " add the google chart builder class."; - $chart[] = $this->_t(2) . "require_once JPATH_COMPONENT_ADMINISTRATOR.'/helpers/chartbuilder.php';"; - $chart[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " load the google chart js."; - $chart[] = $this->_t(2) . "\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->componentCodeName . "/js/google.jsapi.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; - $chart[] = $this->_t(2) . "\$this->document->addScript('https://canvg.googlecode.com/svn/trunk/rgbcolor.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; - $chart[] = $this->_t(2) . "\$this->document->addScript('https://canvg.googlecode.com/svn/trunk/canvg.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; + $chart = array(); + $chart[] = PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " add the google chart builder class."; + $chart[] = $this->_t(2) + . "require_once JPATH_COMPONENT_ADMINISTRATOR.'/helpers/chartbuilder.php';"; + $chart[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " load the google chart js."; + $chart[] = $this->_t(2) + . "\$this->document->addScript(JURI::root(true) .'/media/com_" + . $this->componentCodeName . "/js/google.jsapi.js', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; + $chart[] = $this->_t(2) + . "\$this->document->addScript('https://canvg.googlecode.com/svn/trunk/rgbcolor.js', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; + $chart[] = $this->_t(2) + . "\$this->document->addScript('https://canvg.googlecode.com/svn/trunk/canvg.js', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; + return implode(PHP_EOL, $chart); } + return ''; } @@ -4007,12 +5934,12 @@ class Interpretation extends Fields // check call sig if (isset($view['settings']) && isset($view['settings']->code)) { - $code = $view['settings']->code; + $code = $view['settings']->code; $view_active = true; } elseif (isset($view->code_name)) { - $code = $view->code_name; + $code = $view->code_name; $view_active = false; } // reset bucket @@ -4020,31 +5947,56 @@ class Interpretation extends Fields // allways load these in if ($view_active) { - $setter .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " always make sure jquery is loaded."; + $setter .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " always make sure jquery is loaded."; $setter .= PHP_EOL . $this->_t(2) . "JHtml::_('jquery.framework');"; - $setter .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Load the header checker class."; + $setter .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Load the header checker class."; if ($this->target === 'site') { - $setter .= PHP_EOL . $this->_t(2) . "require_once( JPATH_COMPONENT_SITE.'/helpers/headercheck.php' );"; + $setter .= PHP_EOL . $this->_t(2) + . "require_once( JPATH_COMPONENT_SITE.'/helpers/headercheck.php' );"; } else { - $setter .= PHP_EOL . $this->_t(2) . "require_once( JPATH_COMPONENT_ADMINISTRATOR.'/helpers/headercheck.php' );"; + $setter .= PHP_EOL . $this->_t(2) + . "require_once( JPATH_COMPONENT_ADMINISTRATOR.'/helpers/headercheck.php' );"; } - $setter .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Initialize the header checker."; - $setter .= PHP_EOL . $this->_t(2) . "\$HeaderCheck = new " . $this->componentCodeName . "HeaderCheck;"; + $setter .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Initialize the header checker."; + $setter .= PHP_EOL . $this->_t(2) . "\$HeaderCheck = new " + . $this->componentCodeName . "HeaderCheck;"; } // check if this view should get libraries - if (isset($this->libManager[$this->target][$code]) && ComponentbuilderHelper::checkArray($this->libManager[$this->target][$code])) + if (isset($this->libManager[$this->target][$code]) + && ComponentbuilderHelper::checkArray( + $this->libManager[$this->target][$code] + )) { foreach ($this->libManager[$this->target][$code] as $id => $true) { - if (isset($this->libraries[$id]) && ComponentbuilderHelper::checkObject($this->libraries[$id]) && isset($this->libraries[$id]->document) && ComponentbuilderHelper::checkString($this->libraries[$id]->document)) + if (isset($this->libraries[$id]) + && ComponentbuilderHelper::checkObject( + $this->libraries[$id] + ) + && isset($this->libraries[$id]->document) + && ComponentbuilderHelper::checkString( + $this->libraries[$id]->document + )) { $setter .= PHP_EOL . PHP_EOL . $this->setPlaceholders( - str_replace('$document->', '$this->document->', $this->libraries[$id]->document), $this->placeholders); + str_replace( + '$document->', '$this->document->', + $this->libraries[$id]->document + ), $this->placeholders + ); } - elseif (isset($this->libraries[$id]) && ComponentbuilderHelper::checkObject($this->libraries[$id]) && isset($this->libraries[$id]->how)) + elseif (isset($this->libraries[$id]) + && ComponentbuilderHelper::checkObject( + $this->libraries[$id] + ) + && isset($this->libraries[$id]->how)) { $setter .= $this->setLibraryDocument($id); } @@ -4055,15 +6007,22 @@ class Interpretation extends Fields { return str_replace('$this->document->', '$document->', $setter); } + return $setter; } protected function setLibraryDocument($id) { - if (2 == $this->libraries[$id]->how && isset($this->libraries[$id]->conditions) && ComponentbuilderHelper::checkArray($this->libraries[$id]->conditions)) + if (2 == $this->libraries[$id]->how + && isset($this->libraries[$id]->conditions) + && ComponentbuilderHelper::checkArray( + $this->libraries[$id]->conditions + )) { // build document with the conditions values - $this->setLibraryDocConditions($id, $this->setLibraryScripts($id, false)); + $this->setLibraryDocConditions( + $id, $this->setLibraryScripts($id, false) + ); } elseif (1 == $this->libraries[$id]->how) { @@ -4071,10 +6030,14 @@ class Interpretation extends Fields $this->setLibraryScripts($id); } // check if the document was build - if (isset($this->libraries[$id]->document) && ComponentbuilderHelper::checkString($this->libraries[$id]->document)) + if (isset($this->libraries[$id]->document) + && ComponentbuilderHelper::checkString( + $this->libraries[$id]->document + )) { return PHP_EOL . PHP_EOL . $this->libraries[$id]->document; } + return ''; } @@ -4084,8 +6047,15 @@ class Interpretation extends Fields // Start script builder for library files if (!isset($this->libwarning[$id])) { - $this->app->enqueueMessage(JText::_('

    Conditional Script Warning

    '), 'Warning'); - $this->app->enqueueMessage(JText::sprintf('The conditional script builder for %s is not ready, sorry!', $this->libraries[$id]->name), 'Warning'); + $this->app->enqueueMessage( + JText::_('

    Conditional Script Warning

    '), 'Warning' + ); + $this->app->enqueueMessage( + JText::sprintf( + 'The conditional script builder for %s is not ready, sorry!', + $this->libraries[$id]->name + ), 'Warning' + ); // set the warning only once $this->libwarning[$id] = true; } @@ -4100,7 +6070,8 @@ class Interpretation extends Fields { $scripts = array(); // load the urls if found - if (isset($this->libraries[$id]->urls) && ComponentbuilderHelper::checkArray($this->libraries[$id]->urls)) + if (isset($this->libraries[$id]->urls) + && ComponentbuilderHelper::checkArray($this->libraries[$id]->urls)) { // set all the files foreach ($this->libraries[$id]->urls as $url) @@ -4111,23 +6082,30 @@ class Interpretation extends Fields // update the root path $path = $this->getScriptRootPath($url['path']); // load document script - $scripts[md5($url['path'])] = $this->setIncludeLibScript($path); + $scripts[md5($url['path'])] = $this->setIncludeLibScript( + $path + ); // load url also if not building document if (!$buildDoc) { // load document script - $scripts[md5($url['url'])] = $this->setIncludeLibScript($url['url'], false); + $scripts[md5($url['url'])] = $this->setIncludeLibScript( + $url['url'], false + ); } } else { // load document script - $scripts[md5($url['url'])] = $this->setIncludeLibScript($url['url'], false); + $scripts[md5($url['url'])] = $this->setIncludeLibScript( + $url['url'], false + ); } } } // load the local files if found - if (isset($this->libraries[$id]->files) && ComponentbuilderHelper::checkArray($this->libraries[$id]->files)) + if (isset($this->libraries[$id]->files) + && ComponentbuilderHelper::checkArray($this->libraries[$id]->files)) { // set all the files foreach ($this->libraries[$id]->files as $file) @@ -4140,17 +6118,25 @@ class Interpretation extends Fields if (isset($pathInfo['extension']) && $pathInfo['extension']) { // load document script - $scripts[md5($path)] = $this->setIncludeLibScript($_path, false, $pathInfo); + $scripts[md5($path)] = $this->setIncludeLibScript( + $_path, false, $pathInfo + ); } else { // load document script - $scripts[md5($path . '/' . trim($file['file'], '/'))] = $this->setIncludeLibScript($_path . '/' . trim($file['file'], '/')); + $scripts[md5($path . '/' . trim($file['file'], '/'))] + = $this->setIncludeLibScript( + $_path . '/' . trim($file['file'], '/') + ); } } } // load the local folders if found - if (isset($this->libraries[$id]->folders) && ComponentbuilderHelper::checkArray($this->libraries[$id]->folders)) + if (isset($this->libraries[$id]->folders) + && ComponentbuilderHelper::checkArray( + $this->libraries[$id]->folders + )) { // get all the file paths foreach ($this->libraries[$id]->folders as $folder) @@ -4160,7 +6146,9 @@ class Interpretation extends Fields $path = '/' . trim($folder['path'], '/'); if (isset($folder['rename']) && 1 == $folder['rename']) { - if ($_paths = ComponentbuilderHelper::getAllFilePaths($this->componentPath . $path)) + if ($_paths = ComponentbuilderHelper::getAllFilePaths( + $this->componentPath . $path + )) { $files[$path] = $_paths; } @@ -4168,7 +6156,9 @@ class Interpretation extends Fields else { $path = $path . '/' . trim($folder['folder'], '/'); - if ($_paths = ComponentbuilderHelper::getAllFilePaths($this->componentPath . $path)) + if ($_paths = ComponentbuilderHelper::getAllFilePaths( + $this->componentPath . $path + )) { $files[$path] = $_paths; } @@ -4183,14 +6173,22 @@ class Interpretation extends Fields // load per path foreach ($paths as $path) { - $scripts[md5($root . '/' . trim($path, '/'))] = $this->setIncludeLibScript($_root . '/' . trim($path, '/')); + $scripts[md5($root . '/' . trim($path, '/'))] + = $this->setIncludeLibScript( + $_root . '/' . trim($path, '/') + ); } } } // if there was any code added to document then set globaly if ($buildDoc && ComponentbuilderHelper::checkArray($scripts)) { - $this->libraries[$id]->document = $this->_t(2) . "//" . $this->setLine(__LINE__) . " always load these files." . PHP_EOL . $this->_t(2) . implode(PHP_EOL . $this->_t(2), $scripts); + $this->libraries[$id]->document = $this->_t(2) . "//" + . $this->setLine(__LINE__) . " always load these files." + . PHP_EOL . $this->_t(2) . implode( + PHP_EOL . $this->_t(2), $scripts + ); + // success return true; } @@ -4198,11 +6196,13 @@ class Interpretation extends Fields { return $scripts; } + return false; } - protected function setIncludeLibScript($path, $local = true, $pathInfo = false) - { + protected function setIncludeLibScript($path, $local = true, + $pathInfo = false + ) { // insure we have the path info if (!$pathInfo) { @@ -4220,11 +6220,17 @@ class Interpretation extends Fields switch ($pathInfo['extension']) { case 'js': - return '$this->document->addScript(' . $JURI . '"' . $path . '", (' . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript");'; + return '$this->document->addScript(' . $JURI . '"' . $path + . '", (' . $this->fileContentStatic[$this->hhh + . 'Component' . $this->hhh] + . 'Helper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript");'; break; case 'css': case 'less': - return '$this->document->addStyleSheet(' . $JURI . '"' . $path . '", (' . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/css");'; + return '$this->document->addStyleSheet(' . $JURI . '"' + . $path . '", (' . $this->fileContentStatic[$this->hhh + . 'Component' . $this->hhh] + . 'Helper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/css");'; break; case 'php': if (strpos($path, 'http') === false) @@ -4234,23 +6240,40 @@ class Interpretation extends Fields break; } } + return ''; } protected function getScriptRootPath($root) { - if (strpos($root, '/media/') !== false && strpos($root, '/admin/') === false && strpos($root, '/site/') === false) + if (strpos($root, '/media/') !== false + && strpos($root, '/admin/') === false + && strpos($root, '/site/') === false) { - return str_replace('/media/', '/media/com_' . $this->componentCodeName . '/', $root); + return str_replace( + '/media/', '/media/com_' . $this->componentCodeName . '/', $root + ); } - elseif (strpos($root, '/media/') === false && strpos($root, '/admin/') !== false && strpos($root, '/site/') === false) + elseif (strpos($root, '/media/') === false + && strpos($root, '/admin/') !== false + && strpos($root, '/site/') === false) { - return str_replace('/admin/', '/administrator/components/com_' . $this->componentCodeName . '/', $root); + return str_replace( + '/admin/', + '/administrator/components/com_' . $this->componentCodeName + . '/', $root + ); } - elseif (strpos($root, '/media/') === false && strpos($root, '/admin/') === false && strpos($root, '/site/') !== false) + elseif (strpos($root, '/media/') === false + && strpos($root, '/admin/') === false + && strpos($root, '/site/') !== false) { - return str_replace('/site/', '/components/com_' . $this->componentCodeName . '/', $root); + return str_replace( + '/site/', '/components/com_' . $this->componentCodeName . '/', + $root + ); } + return $root; } @@ -4261,120 +6284,263 @@ class Interpretation extends Fields // load the defaults needed if ($this->uikit > 0) { - $setter .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Load uikit options."; - $setter .= PHP_EOL . $this->_t(2) . "\$uikit = \$this->params->get('uikit_load');"; - $setter .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Set script size."; - $setter .= PHP_EOL . $this->_t(2) . "\$size = \$this->params->get('uikit_min');"; - $tabV = ""; + $setter .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Load uikit options."; + $setter .= PHP_EOL . $this->_t(2) + . "\$uikit = \$this->params->get('uikit_load');"; + $setter .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Set script size."; + $setter .= PHP_EOL . $this->_t(2) + . "\$size = \$this->params->get('uikit_min');"; + $tabV = ""; // if both versions should be loaded then add some more logic if (2 == $this->uikit) { - $setter .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Load uikit version."; - $setter .= PHP_EOL . $this->_t(2) . "\$this->uikitVersion = \$this->params->get('uikit_version', 2);"; - $setter .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Use Uikit Version 2"; - $setter .= PHP_EOL . $this->_t(2) . "if (2 == \$this->uikitVersion)"; + $setter .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" + . $this->setLine(__LINE__) . " Load uikit version."; + $setter .= PHP_EOL . $this->_t(2) + . "\$this->uikitVersion = \$this->params->get('uikit_version', 2);"; + $setter .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" + . $this->setLine(__LINE__) . " Use Uikit Version 2"; + $setter .= PHP_EOL . $this->_t(2) + . "if (2 == \$this->uikitVersion)"; $setter .= PHP_EOL . $this->_t(2) . "{"; - $tabV = $this->_t(1); + $tabV = $this->_t(1); } } // load the defaults needed if (2 == $this->uikit || 1 == $this->uikit) { - $setter .= PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Set css style."; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "\$style = \$this->params->get('uikit_style');"; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Set css style."; + $setter .= PHP_EOL . $tabV . $this->_t(2) + . "\$style = \$this->params->get('uikit_style');"; - $setter .= PHP_EOL . PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine(__LINE__) . " The uikit css."; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "if ((!\$HeaderCheck->css_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; + $setter .= PHP_EOL . PHP_EOL . $tabV . $this->_t(2) . "//" + . $this->setLine(__LINE__) . " The uikit css."; + $setter .= PHP_EOL . $tabV . $this->_t(2) + . "if ((!\$HeaderCheck->css_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "\$this->document->addStyleSheet(JURI::root(true) .'/media/com_" . $this->componentCodeName . "/uikit-v2/css/uikit'.\$style.\$size.'.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; + $setter .= PHP_EOL . $tabV . $this->_t(3) + . "\$this->document->addStyleSheet(JURI::root(true) .'/media/com_" + . $this->componentCodeName + . "/uikit-v2/css/uikit'.\$style.\$size.'.css', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; $setter .= PHP_EOL . $tabV . $this->_t(2) . "}"; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine(__LINE__) . " The uikit js."; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "if ((!\$HeaderCheck->js_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " The uikit js."; + $setter .= PHP_EOL . $tabV . $this->_t(2) + . "if ((!\$HeaderCheck->js_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->componentCodeName . "/uikit-v2/js/uikit'.\$size.'.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; + $setter .= PHP_EOL . $tabV . $this->_t(3) + . "\$this->document->addScript(JURI::root(true) .'/media/com_" + . $this->componentCodeName + . "/uikit-v2/js/uikit'.\$size.'.js', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; $setter .= PHP_EOL . $tabV . $this->_t(2) . "}"; } // load the components need - if ((2 == $this->uikit || 1 == $this->uikit) && isset($this->uikitComp[$view['settings']->code]) && ComponentbuilderHelper::checkArray($this->uikitComp[$view['settings']->code])) + if ((2 == $this->uikit || 1 == $this->uikit) + && isset($this->uikitComp[$view['settings']->code]) + && ComponentbuilderHelper::checkArray( + $this->uikitComp[$view['settings']->code] + )) { - $setter .= PHP_EOL . PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Load the script to find all uikit components needed."; + $setter .= PHP_EOL . PHP_EOL . $tabV . $this->_t(2) . "//" + . $this->setLine(__LINE__) + . " Load the script to find all uikit components needed."; $setter .= PHP_EOL . $tabV . $this->_t(2) . "if (\$uikit != 2)"; $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set the default uikit components in this view."; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "\$uikitComp = array();"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " Set the default uikit components in this view."; + $setter .= PHP_EOL . $tabV . $this->_t(3) + . "\$uikitComp = array();"; foreach ($this->uikitComp[$view['settings']->code] as $class) { - $setter .= PHP_EOL . $tabV . $this->_t(3) . "\$uikitComp[] = '" . $class . "';"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "\$uikitComp[] = '" + . $class . "';"; } // check content for more needed components - if (isset($this->siteFieldData['uikit'][$view['settings']->code]) && ComponentbuilderHelper::checkArray($this->siteFieldData['uikit'][$view['settings']->code])) + if (isset($this->siteFieldData['uikit'][$view['settings']->code]) + && ComponentbuilderHelper::checkArray( + $this->siteFieldData['uikit'][$view['settings']->code] + )) { - $setter .= PHP_EOL . PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get field uikit components needed in this view."; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "\$uikitFieldComp = \$this->get('UikitComp');"; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "if (isset(\$uikitFieldComp) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$uikitFieldComp))"; + $setter .= PHP_EOL . PHP_EOL . $tabV . $this->_t(3) . "//" + . $this->setLine(__LINE__) + . " Get field uikit components needed in this view."; + $setter .= PHP_EOL . $tabV . $this->_t(3) + . "\$uikitFieldComp = \$this->get('UikitComp');"; + $setter .= PHP_EOL . $tabV . $this->_t(3) + . "if (isset(\$uikitFieldComp) && " + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::checkArray(\$uikitFieldComp))"; $setter .= PHP_EOL . $tabV . $this->_t(3) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(4) . "if (isset(\$uikitComp) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$uikitComp))"; + $setter .= PHP_EOL . $tabV . $this->_t(4) + . "if (isset(\$uikitComp) && " + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::checkArray(\$uikitComp))"; $setter .= PHP_EOL . $tabV . $this->_t(4) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "\$uikitComp = array_merge(\$uikitComp, \$uikitFieldComp);"; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "\$uikitComp = array_unique(\$uikitComp);"; + $setter .= PHP_EOL . $tabV . $this->_t(5) + . "\$uikitComp = array_merge(\$uikitComp, \$uikitFieldComp);"; + $setter .= PHP_EOL . $tabV . $this->_t(5) + . "\$uikitComp = array_unique(\$uikitComp);"; $setter .= PHP_EOL . $tabV . $this->_t(4) . "}"; $setter .= PHP_EOL . $tabV . $this->_t(4) . "else"; $setter .= PHP_EOL . $tabV . $this->_t(4) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "\$uikitComp = \$uikitFieldComp;"; + $setter .= PHP_EOL . $tabV . $this->_t(5) + . "\$uikitComp = \$uikitFieldComp;"; $setter .= PHP_EOL . $tabV . $this->_t(4) . "}"; $setter .= PHP_EOL . $tabV . $this->_t(3) . "}"; } $setter .= PHP_EOL . $tabV . $this->_t(2) . "}"; - $setter .= PHP_EOL . PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Load the needed uikit components in this view."; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "if (\$uikit != 2 && isset(\$uikitComp) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$uikitComp))"; + $setter .= PHP_EOL . PHP_EOL . $tabV . $this->_t(2) . "//" + . $this->setLine(__LINE__) + . " Load the needed uikit components in this view."; + $setter .= PHP_EOL . $tabV . $this->_t(2) + . "if (\$uikit != 2 && isset(\$uikitComp) && " + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::checkArray(\$uikitComp))"; $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine(__LINE__) . " load just in case."; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "jimport('joomla.filesystem.file');"; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine(__LINE__) . " loading..."; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "foreach (\$uikitComp as \$class)"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " load just in case."; + $setter .= PHP_EOL . $tabV . $this->_t(3) + . "jimport('joomla.filesystem.file');"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " loading..."; + $setter .= PHP_EOL . $tabV . $this->_t(3) + . "foreach (\$uikitComp as \$class)"; $setter .= PHP_EOL . $tabV . $this->_t(3) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(4) . "foreach (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::\$uk_components[\$class] as \$name)"; + $setter .= PHP_EOL . $tabV . $this->_t(4) . "foreach (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::\$uk_components[\$class] as \$name)"; $setter .= PHP_EOL . $tabV . $this->_t(4) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "//" . $this->setLine(__LINE__) . " check if the CSS file exists."; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "if (JFile::exists(JPATH_ROOT.'/media/com_" . $this->componentCodeName . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))"; + $setter .= PHP_EOL . $tabV . $this->_t(5) . "//" . $this->setLine( + __LINE__ + ) . " check if the CSS file exists."; + $setter .= PHP_EOL . $tabV . $this->_t(5) + . "if (JFile::exists(JPATH_ROOT.'/media/com_" + . $this->componentCodeName + . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))"; $setter .= PHP_EOL . $tabV . $this->_t(5) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(6) . "//" . $this->setLine(__LINE__) . " load the css."; - $setter .= PHP_EOL . $tabV . $this->_t(6) . "\$this->document->addStyleSheet(JURI::root(true) .'/media/com_" . $this->componentCodeName . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; + $setter .= PHP_EOL . $tabV . $this->_t(6) . "//" . $this->setLine( + __LINE__ + ) . " load the css."; + $setter .= PHP_EOL . $tabV . $this->_t(6) + . "\$this->document->addStyleSheet(JURI::root(true) .'/media/com_" + . $this->componentCodeName + . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; $setter .= PHP_EOL . $tabV . $this->_t(5) . "}"; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "//" . $this->setLine(__LINE__) . " check if the JavaScript file exists."; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "if (JFile::exists(JPATH_ROOT.'/media/com_" . $this->componentCodeName . "/uikit-v2/js/components/'.\$name.\$size.'.js'))"; + $setter .= PHP_EOL . $tabV . $this->_t(5) . "//" . $this->setLine( + __LINE__ + ) . " check if the JavaScript file exists."; + $setter .= PHP_EOL . $tabV . $this->_t(5) + . "if (JFile::exists(JPATH_ROOT.'/media/com_" + . $this->componentCodeName + . "/uikit-v2/js/components/'.\$name.\$size.'.js'))"; $setter .= PHP_EOL . $tabV . $this->_t(5) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(6) . "//" . $this->setLine(__LINE__) . " load the js."; - $setter .= PHP_EOL . $tabV . $this->_t(6) . "\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->componentCodeName . "/uikit-v2/js/components/'.\$name.\$size.'.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);"; + $setter .= PHP_EOL . $tabV . $this->_t(6) . "//" . $this->setLine( + __LINE__ + ) . " load the js."; + $setter .= PHP_EOL . $tabV . $this->_t(6) + . "\$this->document->addScript(JURI::root(true) .'/media/com_" + . $this->componentCodeName + . "/uikit-v2/js/components/'.\$name.\$size.'.js', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);"; $setter .= PHP_EOL . $tabV . $this->_t(5) . "}"; $setter .= PHP_EOL . $tabV . $this->_t(4) . "}"; $setter .= PHP_EOL . $tabV . $this->_t(3) . "}"; $setter .= PHP_EOL . $tabV . $this->_t(2) . "}"; } - elseif ((2 == $this->uikit || 1 == $this->uikit) && isset($this->siteFieldData['uikit'][$view['settings']->code]) && ComponentbuilderHelper::checkArray($this->siteFieldData['uikit'][$view['settings']->code])) + elseif ((2 == $this->uikit || 1 == $this->uikit) + && isset($this->siteFieldData['uikit'][$view['settings']->code]) + && ComponentbuilderHelper::checkArray( + $this->siteFieldData['uikit'][$view['settings']->code] + )) { - $setter .= PHP_EOL . PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Load the needed uikit components in this view."; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "\$uikitComp = \$this->get('UikitComp');"; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "if (\$uikit != 2 && isset(\$uikitComp) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$uikitComp))"; + $setter .= PHP_EOL . PHP_EOL . $tabV . $this->_t(2) . "//" + . $this->setLine(__LINE__) + . " Load the needed uikit components in this view."; + $setter .= PHP_EOL . $tabV . $this->_t(2) + . "\$uikitComp = \$this->get('UikitComp');"; + $setter .= PHP_EOL . $tabV . $this->_t(2) + . "if (\$uikit != 2 && isset(\$uikitComp) && " + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::checkArray(\$uikitComp))"; $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine(__LINE__) . " load just in case."; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "jimport('joomla.filesystem.file');"; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine(__LINE__) . " loading..."; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "foreach (\$uikitComp as \$class)"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " load just in case."; + $setter .= PHP_EOL . $tabV . $this->_t(3) + . "jimport('joomla.filesystem.file');"; + $setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " loading..."; + $setter .= PHP_EOL . $tabV . $this->_t(3) + . "foreach (\$uikitComp as \$class)"; $setter .= PHP_EOL . $tabV . $this->_t(3) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(4) . "foreach (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::\$uk_components[\$class] as \$name)"; + $setter .= PHP_EOL . $tabV . $this->_t(4) . "foreach (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::\$uk_components[\$class] as \$name)"; $setter .= PHP_EOL . $tabV . $this->_t(4) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "//" . $this->setLine(__LINE__) . " check if the CSS file exists."; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "if (JFile::exists(JPATH_ROOT.'/media/com_" . $this->componentCodeName . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))"; + $setter .= PHP_EOL . $tabV . $this->_t(5) . "//" . $this->setLine( + __LINE__ + ) . " check if the CSS file exists."; + $setter .= PHP_EOL . $tabV . $this->_t(5) + . "if (JFile::exists(JPATH_ROOT.'/media/com_" + . $this->componentCodeName + . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))"; $setter .= PHP_EOL . $tabV . $this->_t(5) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(6) . "//" . $this->setLine(__LINE__) . " load the css."; - $setter .= PHP_EOL . $tabV . $this->_t(6) . "\$this->document->addStyleSheet(JURI::root(true) .'/media/com_" . $this->componentCodeName . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; + $setter .= PHP_EOL . $tabV . $this->_t(6) . "//" . $this->setLine( + __LINE__ + ) . " load the css."; + $setter .= PHP_EOL . $tabV . $this->_t(6) + . "\$this->document->addStyleSheet(JURI::root(true) .'/media/com_" + . $this->componentCodeName + . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; $setter .= PHP_EOL . $tabV . $this->_t(5) . "}"; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "//" . $this->setLine(__LINE__) . " check if the JavaScript file exists."; - $setter .= PHP_EOL . $tabV . $this->_t(5) . "if (JFile::exists(JPATH_ROOT.'/media/com_" . $this->componentCodeName . "/uikit-v2/js/components/'.\$name.\$size.'.js'))"; + $setter .= PHP_EOL . $tabV . $this->_t(5) . "//" . $this->setLine( + __LINE__ + ) . " check if the JavaScript file exists."; + $setter .= PHP_EOL . $tabV . $this->_t(5) + . "if (JFile::exists(JPATH_ROOT.'/media/com_" + . $this->componentCodeName + . "/uikit-v2/js/components/'.\$name.\$size.'.js'))"; $setter .= PHP_EOL . $tabV . $this->_t(5) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(6) . "//" . $this->setLine(__LINE__) . " load the js."; - $setter .= PHP_EOL . $tabV . $this->_t(6) . "\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->componentCodeName . "/uikit-v2/js/components/'.\$name.\$size.'.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);"; + $setter .= PHP_EOL . $tabV . $this->_t(6) . "//" . $this->setLine( + __LINE__ + ) . " load the js."; + $setter .= PHP_EOL . $tabV . $this->_t(6) + . "\$this->document->addScript(JURI::root(true) .'/media/com_" + . $this->componentCodeName + . "/uikit-v2/js/components/'.\$name.\$size.'.js', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);"; $setter .= PHP_EOL . $tabV . $this->_t(5) . "}"; $setter .= PHP_EOL . $tabV . $this->_t(4) . "}"; $setter .= PHP_EOL . $tabV . $this->_t(3) . "}"; @@ -4386,27 +6552,55 @@ class Interpretation extends Fields if (2 == $this->uikit) { $setter .= PHP_EOL . $this->_t(2) . "}"; - $setter .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Use Uikit Version 3"; - $setter .= PHP_EOL . $this->_t(2) . "elseif (3 == \$this->uikitVersion)"; + $setter .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Use Uikit Version 3"; + $setter .= PHP_EOL . $this->_t(2) + . "elseif (3 == \$this->uikitVersion)"; $setter .= PHP_EOL . $this->_t(2) . "{"; } // add version 3 fiels to page - $setter .= PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine(__LINE__) . " The uikit css."; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "if ((!\$HeaderCheck->css_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " The uikit css."; + $setter .= PHP_EOL . $tabV . $this->_t(2) + . "if ((!\$HeaderCheck->css_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "\$this->document->addStyleSheet(JURI::root(true) .'/media/com_" . $this->componentCodeName . "/uikit-v3/css/uikit'.\$size.'.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; + $setter .= PHP_EOL . $tabV . $this->_t(3) + . "\$this->document->addStyleSheet(JURI::root(true) .'/media/com_" + . $this->componentCodeName + . "/uikit-v3/css/uikit'.\$size.'.css', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; $setter .= PHP_EOL . $tabV . $this->_t(2) . "}"; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine(__LINE__) . " The uikit js."; - $setter .= PHP_EOL . $tabV . $this->_t(2) . "if ((!\$HeaderCheck->js_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; + $setter .= PHP_EOL . $tabV . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " The uikit js."; + $setter .= PHP_EOL . $tabV . $this->_t(2) + . "if ((!\$HeaderCheck->js_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; $setter .= PHP_EOL . $tabV . $this->_t(2) . "{"; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->componentCodeName . "/uikit-v3/js/uikit'.\$size.'.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; - $setter .= PHP_EOL . $tabV . $this->_t(3) . "\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->componentCodeName . "/uikit-v3/js/uikit-icons'.\$size.'.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; + $setter .= PHP_EOL . $tabV . $this->_t(3) + . "\$this->document->addScript(JURI::root(true) .'/media/com_" + . $this->componentCodeName + . "/uikit-v3/js/uikit'.\$size.'.js', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; + $setter .= PHP_EOL . $tabV . $this->_t(3) + . "\$this->document->addScript(JURI::root(true) .'/media/com_" + . $this->componentCodeName + . "/uikit-v3/js/uikit-icons'.\$size.'.js', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; $setter .= PHP_EOL . $tabV . $this->_t(2) . "}"; if (2 == $this->uikit) { $setter .= PHP_EOL . $this->_t(2) . "}"; } } + return $setter; } @@ -4414,8 +6608,11 @@ class Interpretation extends Fields { if ($view['settings']->add_php_jview == 1) { - return PHP_EOL . PHP_EOL . $this->setPlaceholders($view['settings']->php_jview, $this->placeholders); + return PHP_EOL . PHP_EOL . $this->setPlaceholders( + $view['settings']->php_jview, $this->placeholders + ); } + return ''; } @@ -4423,88 +6620,131 @@ class Interpretation extends Fields { if (ComponentbuilderHelper::checkString($view['settings']->default)) { - if ($view['settings']->main_get->gettype == 2 && $view['settings']->main_get->pagination == 1) + if ($view['settings']->main_get->gettype == 2 + && $view['settings']->main_get->pagination == 1) { // build body $body = array(); // add limit box - if (strpos($view['settings']->default, $this->bbb . 'LIMITBOX' . $this->ddd) !== false) + if (strpos( + $view['settings']->default, + $this->bbb . 'LIMITBOX' . $this->ddd + ) !== false) { - $this->placeholders[$this->bbb . 'LIMITBOX' . $this->ddd] = 'pagination->getLimitBox(); ?>'; + $this->placeholders[$this->bbb . 'LIMITBOX' . $this->ddd] + = 'pagination->getLimitBox(); ?>'; } - $body[] = $this->setPlaceholders($view['settings']->default, $this->placeholders); - $body[] = PHP_EOL . 'items) && isset($this->pagination) && isset($this->pagination->pagesTotal) && $this->pagination->pagesTotal > 1): ?>'; + $body[] = $this->setPlaceholders( + $view['settings']->default, $this->placeholders + ); + $body[] = PHP_EOL + . 'items) && isset($this->pagination) && isset($this->pagination->pagesTotal) && $this->pagination->pagesTotal > 1): ?>'; $body[] = $this->_t(1) . ''; $body[] = ''; // insure the form is added (only if no form exist) if (strpos($view['settings']->default, 'addCustomForm[$this->target][$view['settings']->code] = true; + $this->addCustomForm[$this->target][$view['settings']->code] + = true; } + // return the body return implode(PHP_EOL, $body); } else { // insure the form is added (only if no form exist) - if ('site' !== $this->target && strpos($view['settings']->default, 'target + && strpos( + $view['settings']->default, 'addCustomForm[$this->target][$view['settings']->code] = true; + $this->addCustomForm[$this->target][$view['settings']->code] + = true; } - return PHP_EOL . $this->setPlaceholders($view['settings']->default, $this->placeholders); + + return PHP_EOL . $this->setPlaceholders( + $view['settings']->default, $this->placeholders + ); } } + return ''; } public function setCustomViewForm(&$view, &$gettype, $type) { - if (isset($this->addCustomForm[$this->target]) && isset($this->addCustomForm[$this->target][$view]) && $this->addCustomForm[$this->target][$view]) + if (isset($this->addCustomForm[$this->target]) + && isset($this->addCustomForm[$this->target][$view]) + && $this->addCustomForm[$this->target][$view]) { - switch($type) + switch ($type) { case 1: // top if ('site' === $this->target) { - return '' . PHP_EOL; + return '' + . PHP_EOL; } else { if ($gettype == 2) { - return '' . PHP_EOL; + return '' + . PHP_EOL; } else { - return '' . PHP_EOL; + return '' + . PHP_EOL; } } break; case 2: // bottom $input = ''; - if ('admin' === $this->target && isset($this->customAdminViewListId[$view])) + if ('admin' === $this->target + && isset($this->customAdminViewListId[$view])) { - $input = PHP_EOL . $this->_t(1) . ''; + $input = PHP_EOL . $this->_t(1) + . ''; } - return $input . PHP_EOL . '' . PHP_EOL . "" . PHP_EOL . ''; + + return $input . PHP_EOL + . '' + . PHP_EOL . "" + . PHP_EOL . ''; break; } } + return ''; } @@ -4513,16 +6753,22 @@ class Interpretation extends Fields if (ComponentbuilderHelper::checkString($view['settings']->default)) { // add the script only if there is none set - if (strpos($view['settings']->default, 'Joomla.submitbutton = function(') === false) + if (strpos( + $view['settings']->default, + 'Joomla.submitbutton = function(' + ) === false) { - $script = array(); + $script = array(); $script[] = PHP_EOL . ""; - $fadein[] = "
    componentCodeName . "_loader\" style=\"display: none;\">"; + $fadein[] = "
    componentCodeName + . "_loader\" style=\"display: none;\">"; return implode(PHP_EOL, $fadein); } + return "
    componentCodeName . "_loader\">"; } @@ -8465,12 +12710,16 @@ class Interpretation extends Fields if (ComponentbuilderHelper::checkString($items)) { // LAYOUTITEMS <<>> - $this->fileContentDynamic[$viewName_single . '_' . $layoutName][$this->hhh . 'LAYOUTITEMS' . $this->hhh] = $items; + $this->fileContentDynamic[$viewName_single . '_' + . $layoutName][$this->hhh . 'LAYOUTITEMS' . $this->hhh] + = $items; } else { // LAYOUTITEMS <<>> - $this->fileContentDynamic[$viewName_single . '_' . $layoutName][$this->hhh . 'bogus' . $this->hhh] = 'boom'; + $this->fileContentDynamic[$viewName_single . '_' + . $layoutName][$this->hhh . 'bogus' . $this->hhh] + = 'boom'; } } @@ -8490,67 +12739,119 @@ class Interpretation extends Fields */ extract($args, EXTR_PREFIX_SAME, "oops"); $single = ''; - $list = ''; + $list = ''; foreach ($this->componentData->admin_views as $array) { if ($array['adminview'] == $viewId) { - $single = ComponentbuilderHelper::safeString($array['settings']->name_single); - $list = ComponentbuilderHelper::safeString($array['settings']->name_list); + $single = ComponentbuilderHelper::safeString( + $array['settings']->name_single + ); + $list = ComponentbuilderHelper::safeString( + $array['settings']->name_list + ); break; } } - if (ComponentbuilderHelper::checkString($single) && ComponentbuilderHelper::checkString($list)) + if (ComponentbuilderHelper::checkString($single) + && ComponentbuilderHelper::checkString($list)) { - $head = $this->setListHeadLinked($single, $list, $addNewButon, $view_name_single); - $body = $this->setListBodyLinked($single, $list, $view_name_single); + $head = $this->setListHeadLinked( + $single, $list, $addNewButon, $view_name_single + ); + $body = $this->setListBodyLinked( + $single, $list, $view_name_single + ); $functionName = ComponentbuilderHelper::safeString($codeName, 'F'); // LAYOUTITEMSTABLE <<>> - $this->fileContentDynamic[$view_name_single . '_' . $layoutCodeName][$this->hhh . 'LAYOUTITEMSTABLE' . $this->hhh] = $head . $body; + $this->fileContentDynamic[$view_name_single . '_' + . $layoutCodeName][$this->hhh . 'LAYOUTITEMSTABLE' . $this->hhh] + = $head . $body; // LAYOUTITEMSHEADER <<>> - $headerscript = '//' . $this->setLine(__LINE__) . ' set the edit URL'; - $headerscript .= PHP_EOL . '$edit = "index.php?option=com_' . $this->componentCodeName . '&view=' . $list . '&task=' . $single . '.edit";'; - $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) . ' set a return value'; - $headerscript .= PHP_EOL . '$return = ($id) ? "index.php?option=com_' . $this->componentCodeName . '&view=' . $view_name_single . '&layout=edit&id=" . $id : "";'; - $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) . ' check for a return value'; - $headerscript .= PHP_EOL . '$jinput = JFactory::getApplication()->input;'; - $headerscript .= PHP_EOL . "if (\$_return = \$jinput->get('return', null, 'base64'))"; + $headerscript = '//' . $this->setLine(__LINE__) + . ' set the edit URL'; + $headerscript .= PHP_EOL . '$edit = "index.php?option=com_' + . $this->componentCodeName . '&view=' . $list . '&task=' + . $single . '.edit";'; + $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) + . ' set a return value'; + $headerscript .= PHP_EOL + . '$return = ($id) ? "index.php?option=com_' + . $this->componentCodeName . '&view=' . $view_name_single + . '&layout=edit&id=" . $id : "";'; + $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) + . ' check for a return value'; + $headerscript .= PHP_EOL + . '$jinput = JFactory::getApplication()->input;'; + $headerscript .= PHP_EOL + . "if (\$_return = \$jinput->get('return', null, 'base64'))"; $headerscript .= PHP_EOL . '{'; - $headerscript .= PHP_EOL . $this->_t(1) . '$return .= "&return=" . $_return;'; + $headerscript .= PHP_EOL . $this->_t(1) + . '$return .= "&return=" . $_return;'; $headerscript .= PHP_EOL . '}'; - $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) . ' check if return value was set'; - $headerscript .= PHP_EOL . 'if (' . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper::checkString($return))'; + $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) + . ' check if return value was set'; + $headerscript .= PHP_EOL . 'if (' + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . 'Helper::checkString($return))'; $headerscript .= PHP_EOL . '{'; - $headerscript .= PHP_EOL . $this->_t(1) . '//' . $this->setLine(__LINE__) . ' set the referral values'; - $headerscript .= PHP_EOL . $this->_t(1) . '$ref = ($id) ? "&ref=' . $view_name_single . '&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "&return=" . urlencode(base64_encode($return));'; + $headerscript .= PHP_EOL . $this->_t(1) . '//' . $this->setLine( + __LINE__ + ) . ' set the referral values'; + $headerscript .= PHP_EOL . $this->_t(1) . '$ref = ($id) ? "&ref=' + . $view_name_single + . '&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "&return=" . urlencode(base64_encode($return));'; $headerscript .= PHP_EOL . '}'; $headerscript .= PHP_EOL . 'else'; $headerscript .= PHP_EOL . '{'; - $headerscript .= PHP_EOL . $this->_t(1) . '$ref = ($id) ? "&ref=' . $view_name_single . '&refid=" . $id : "";'; + $headerscript .= PHP_EOL . $this->_t(1) . '$ref = ($id) ? "&ref=' + . $view_name_single . '&refid=" . $id : "";'; $headerscript .= PHP_EOL . '}'; if ($addNewButon > 0) { // add the link for new if ($addNewButon == 1 || $addNewButon == 2) { - $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) . ' set the create new URL'; - $headerscript .= PHP_EOL . '$new = "index.php?option=com_' . $this->componentCodeName . '&view=' . $list . '&task=' . $single . '.edit" . $ref;'; + $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) + . ' set the create new URL'; + $headerscript .= PHP_EOL . '$new = "index.php?option=com_' + . $this->componentCodeName . '&view=' . $list . '&task=' + . $single . '.edit" . $ref;'; } // and the link for close and new if ($addNewButon == 2 || $addNewButon == 3) { - $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) . ' set the create new and close URL'; - $headerscript .= PHP_EOL . '$close_new = "index.php?option=com_' . $this->componentCodeName . '&view=' . $list . '&task=' . $single . '.edit";'; + $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) + . ' set the create new and close URL'; + $headerscript .= PHP_EOL + . '$close_new = "index.php?option=com_' + . $this->componentCodeName . '&view=' . $list . '&task=' + . $single . '.edit";'; } - $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) . ' load the action object'; - $headerscript .= PHP_EOL . '$can = ' . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper::getActions(' . "'" . $single . "'" . ');'; + $headerscript .= PHP_EOL . '//' . $this->setLine(__LINE__) + . ' load the action object'; + $headerscript .= PHP_EOL . '$can = ' + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . 'Helper::getActions(' . "'" . $single . "'" + . ');'; } - $this->fileContentDynamic[$view_name_single . '_' . $layoutCodeName][$this->hhh . 'LAYOUTITEMSHEADER' . $this->hhh] = $headerscript; + $this->fileContentDynamic[$view_name_single . '_' + . $layoutCodeName][$this->hhh . 'LAYOUTITEMSHEADER' . $this->hhh] + = $headerscript; // LINKEDVIEWITEMS <<>> - $this->fileContentDynamic[$view_name_single][$this->hhh . 'LINKEDVIEWITEMS' . $this->hhh] .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get Linked view data" . PHP_EOL . $this->_t(2) . "\$this->" . $codeName . " = \$this->get('" . $functionName . "');"; + $this->fileContentDynamic[$view_name_single][$this->hhh + . 'LINKEDVIEWITEMS' . $this->hhh] + .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Get Linked view data" . PHP_EOL . $this->_t(2) + . "\$this->" . $codeName . " = \$this->get('" . $functionName + . "');"; // LINKEDVIEWTABLESCRIPTS <<>> - $this->fileContentDynamic[$view_name_single][$this->hhh . 'LINKEDVIEWTABLESCRIPTS' . $this->hhh] = $this->setFootableScripts(); - if (strpos($parentKey, '-R>') !== false || strpos($parentKey, '-A>') !== false) + $this->fileContentDynamic[$view_name_single][$this->hhh + . 'LINKEDVIEWTABLESCRIPTS' . $this->hhh] + = $this->setFootableScripts(); + if (strpos($parentKey, '-R>') !== false + || strpos($parentKey, '-A>') !== false) { list($parent_key) = explode('-', $parentKey); } @@ -8577,102 +12878,211 @@ class Interpretation extends Fields $_key = $key; } // LINKEDVIEWGLOBAL <<>> - if (isset($parent_keys) && ComponentbuilderHelper::checkArray($parent_keys)) + if (isset($parent_keys) + && ComponentbuilderHelper::checkArray( + $parent_keys + )) { $globalKey = array(); foreach ($parent_keys as $parent_key) { - $globalKey[$parent_key] = ComponentbuilderHelper::safeString($_key . $this->uniquekey(4)); - $this->fileContentDynamic[$view_name_single][$this->hhh . 'LINKEDVIEWGLOBAL' . $this->hhh] .= PHP_EOL . $this->_t(2) . "\$this->" . $globalKey[$parent_key] . " = \$item->" . $parent_key . ";"; + $globalKey[$parent_key] + = ComponentbuilderHelper::safeString( + $_key . $this->uniquekey(4) + ); + $this->fileContentDynamic[$view_name_single][$this->hhh + . 'LINKEDVIEWGLOBAL' . $this->hhh] + .= PHP_EOL . $this->_t(2) . "\$this->" + . $globalKey[$parent_key] . " = \$item->" . $parent_key + . ";"; } } else { // set the global key - $globalKey = ComponentbuilderHelper::safeString($_key . $this->uniquekey(4)); - $this->fileContentDynamic[$view_name_single][$this->hhh . 'LINKEDVIEWGLOBAL' . $this->hhh] .= PHP_EOL . $this->_t(2) . "\$this->" . $globalKey . " = \$item->" . $parent_key . ";"; + $globalKey = ComponentbuilderHelper::safeString( + $_key . $this->uniquekey(4) + ); + $this->fileContentDynamic[$view_name_single][$this->hhh + . 'LINKEDVIEWGLOBAL' . $this->hhh] + .= PHP_EOL . $this->_t(2) . "\$this->" . $globalKey + . " = \$item->" . $parent_key . ";"; } // LINKEDVIEWMETHODS <<>> - $this->fileContentDynamic[$view_name_single][$this->hhh . 'LINKEDVIEWMETHODS' . $this->hhh] .= $this->setListQueryLinked($single, $list, $functionName, $key, $_key, $parentKey, $parent_key, $globalKey); + $this->fileContentDynamic[$view_name_single][$this->hhh + . 'LINKEDVIEWMETHODS' . $this->hhh] + .= $this->setListQueryLinked( + $single, $list, $functionName, $key, $_key, $parentKey, + $parent_key, $globalKey + ); } else { - $this->fileContentDynamic[$view_name_single . '_' . $layoutCodeName][$this->hhh . 'LAYOUTITEMSTABLE' . $this->hhh] = 'oops! error.....'; - $this->fileContentDynamic[$view_name_single . '_' . $layoutCodeName][$this->hhh . 'LAYOUTITEMSHEADER' . $this->hhh] = ''; + $this->fileContentDynamic[$view_name_single . '_' + . $layoutCodeName][$this->hhh . 'LAYOUTITEMSTABLE' . $this->hhh] + = 'oops! error.....'; + $this->fileContentDynamic[$view_name_single . '_' + . $layoutCodeName][$this->hhh . 'LAYOUTITEMSHEADER' . $this->hhh] + = ''; } } /** - * @param bool $init + * @param bool $init + * * @return string */ public function setFootableScripts($init = true) { - if (!isset($this->footableVersion) || 2 == $this->footableVersion) // loading version 2 + if (!isset($this->footableVersion) + || 2 == $this->footableVersion) // loading version 2 { - $foo = PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add the CSS for Footable."; - $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->componentCodeName . "/footable-v2/css/footable.core.min.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; - $foo .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Use the Metro Style"; - $foo .= PHP_EOL . $this->_t(2) . "if (!isset(\$this->fooTableStyle) || 0 == \$this->fooTableStyle)"; + $foo = PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Add the CSS for Footable."; + $foo .= PHP_EOL . $this->_t(2) + . "\$this->document->addStyleSheet(JURI::root() .'media/com_" + . $this->componentCodeName + . "/footable-v2/css/footable.core.min.css', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; + $foo .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Use the Metro Style"; + $foo .= PHP_EOL . $this->_t(2) + . "if (!isset(\$this->fooTableStyle) || 0 == \$this->fooTableStyle)"; $foo .= PHP_EOL . $this->_t(2) . "{"; - $foo .= PHP_EOL . $this->_t(3) . "\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->componentCodeName . "/footable-v2/css/footable.metro.min.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; + $foo .= PHP_EOL . $this->_t(3) + . "\$this->document->addStyleSheet(JURI::root() .'media/com_" + . $this->componentCodeName + . "/footable-v2/css/footable.metro.min.css', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; $foo .= PHP_EOL . $this->_t(2) . "}"; - $foo .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Use the Legacy Style."; - $foo .= PHP_EOL . $this->_t(2) . "elseif (isset(\$this->fooTableStyle) && 1 == \$this->fooTableStyle)"; + $foo .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Use the Legacy Style."; + $foo .= PHP_EOL . $this->_t(2) + . "elseif (isset(\$this->fooTableStyle) && 1 == \$this->fooTableStyle)"; $foo .= PHP_EOL . $this->_t(2) . "{"; - $foo .= PHP_EOL . $this->_t(3) . "\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->componentCodeName . "/footable-v2/css/footable.standalone.min.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; + $foo .= PHP_EOL . $this->_t(3) + . "\$this->document->addStyleSheet(JURI::root() .'media/com_" + . $this->componentCodeName + . "/footable-v2/css/footable.standalone.min.css', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; $foo .= PHP_EOL . $this->_t(2) . "}"; - $foo .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add the JavaScript for Footable"; - $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addScript(JURI::root() .'media/com_" . $this->componentCodeName . "/footable-v2/js/footable.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; - $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addScript(JURI::root() .'media/com_" . $this->componentCodeName . "/footable-v2/js/footable.sort.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; - $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addScript(JURI::root() .'media/com_" . $this->componentCodeName . "/footable-v2/js/footable.filter.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; - $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addScript(JURI::root() .'media/com_" . $this->componentCodeName . "/footable-v2/js/footable.paginate.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; + $foo .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Add the JavaScript for Footable"; + $foo .= PHP_EOL . $this->_t(2) + . "\$this->document->addScript(JURI::root() .'media/com_" + . $this->componentCodeName . "/footable-v2/js/footable.js', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; + $foo .= PHP_EOL . $this->_t(2) + . "\$this->document->addScript(JURI::root() .'media/com_" + . $this->componentCodeName + . "/footable-v2/js/footable.sort.js', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; + $foo .= PHP_EOL . $this->_t(2) + . "\$this->document->addScript(JURI::root() .'media/com_" + . $this->componentCodeName + . "/footable-v2/js/footable.filter.js', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; + $foo .= PHP_EOL . $this->_t(2) + . "\$this->document->addScript(JURI::root() .'media/com_" + . $this->componentCodeName + . "/footable-v2/js/footable.paginate.js', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; if ($init) { - $foo .= PHP_EOL . PHP_EOL . $this->_t(2) . '$footable = "jQuery(document).ready(function() { jQuery(function () { jQuery(' . "'.footable'" . ').footable(); }); jQuery(' . "'.nav-tabs'" . ').on(' . "'click'" . ', ' . "'li'" . ', function() { setTimeout(tableFix, 10); }); }); function tableFix() { jQuery(' . "'.footable'" . ').trigger(' . "'footable_resize'" . '); }";'; - $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addScriptDeclaration(\$footable);" . PHP_EOL; + $foo .= PHP_EOL . PHP_EOL . $this->_t(2) + . '$footable = "jQuery(document).ready(function() { jQuery(function () { jQuery(' + . "'.footable'" . ').footable(); }); jQuery(' + . "'.nav-tabs'" . ').on(' . "'click'" . ', ' . "'li'" + . ', function() { setTimeout(tableFix, 10); }); }); function tableFix() { jQuery(' + . "'.footable'" . ').trigger(' . "'footable_resize'" + . '); }";'; + $foo .= PHP_EOL . $this->_t(2) + . "\$this->document->addScriptDeclaration(\$footable);" + . PHP_EOL; } } elseif (3 == $this->footableVersion) // loading version 3 { - $foo = PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add the CSS for Footable"; - $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addStyleSheet('https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css');"; - $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->componentCodeName . "/footable-v3/css/footable.standalone.min.css', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; - $foo .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add the JavaScript for Footable (adding all funtions)"; - $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addScript(JURI::root() .'media/com_" . $this->componentCodeName . "/footable-v3/js/footable.min.js', (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; + $foo = PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Add the CSS for Footable"; + $foo .= PHP_EOL . $this->_t(2) + . "\$this->document->addStyleSheet('https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css');"; + $foo .= PHP_EOL . $this->_t(2) + . "\$this->document->addStyleSheet(JURI::root() .'media/com_" + . $this->componentCodeName + . "/footable-v3/css/footable.standalone.min.css', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');"; + $foo .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Add the JavaScript for Footable (adding all funtions)"; + $foo .= PHP_EOL . $this->_t(2) + . "\$this->document->addScript(JURI::root() .'media/com_" + . $this->componentCodeName + . "/footable-v3/js/footable.min.js', (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + . "Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');"; if ($init) { - $foo .= PHP_EOL . PHP_EOL . $this->_t(2) . '$footable = "jQuery(document).ready(function() { jQuery(function () { jQuery(' . "'.footable'" . ').footable();});});";'; - $foo .= PHP_EOL . $this->_t(2) . "\$this->document->addScriptDeclaration(\$footable);" . PHP_EOL; + $foo .= PHP_EOL . PHP_EOL . $this->_t(2) + . '$footable = "jQuery(document).ready(function() { jQuery(function () { jQuery(' + . "'.footable'" . ').footable();});});";'; + $foo .= PHP_EOL . $this->_t(2) + . "\$this->document->addScriptDeclaration(\$footable);" + . PHP_EOL; } } + return $foo; } /** * set the list body of the linked admin view * - * @param string $viewName_single - * @param string $viewName_list - * @param string $refview + * @param string $viewName_single + * @param string $viewName_list + * @param string $refview * * @return string */ - public function setListBodyLinked($viewName_single, $viewName_list, $refview) - { - if (isset($this->listBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->listBuilder[$viewName_list])) + public function setListBodyLinked($viewName_single, $viewName_list, $refview + ) { + if (isset($this->listBuilder[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->listBuilder[$viewName_list] + )) { // component helper name - $Helper = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper'; + $Helper = $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . 'Helper'; // make sure the custom links are only added once $firstTimeBeingAdded = true; // setup correct core target $coreLoad = false; - $core = null; + $core = null; if (isset($this->permissionCore[$viewName_single])) { - $core = $this->permissionCore[$viewName_single]; + $core = $this->permissionCore[$viewName_single]; $coreLoad = true; } $counter = 0; @@ -8680,9 +13090,13 @@ class Interpretation extends Fields $body = PHP_EOL . ""; $body .= PHP_EOL . " \$item): ?>"; $body .= PHP_EOL . $this->_t(1) . "_t(2) . "\$canCheckin = \$user->authorise('core.manage', 'com_checkin') || \$item->checked_out == \$user->id || \$item->checked_out == 0;"; - $body .= PHP_EOL . $this->_t(2) . "\$userChkOut = JFactory::getUser(\$item->checked_out);"; - $body .= PHP_EOL . $this->_t(2) . "\$canDo = " . $Helper . "::getActions('" . $viewName_single . "',\$item,'" . $viewName_list . "');"; + $body .= PHP_EOL . $this->_t(2) + . "\$canCheckin = \$user->authorise('core.manage', 'com_checkin') || \$item->checked_out == \$user->id || \$item->checked_out == 0;"; + $body .= PHP_EOL . $this->_t(2) + . "\$userChkOut = JFactory::getUser(\$item->checked_out);"; + $body .= PHP_EOL . $this->_t(2) . "\$canDo = " . $Helper + . "::getActions('" . $viewName_single . "',\$item,'" + . $viewName_list . "');"; $body .= PHP_EOL . $this->_t(1) . "?>"; $body .= PHP_EOL . $this->_t(1) . ''; // check if this view has fields that should not be escaped @@ -8702,12 +13116,19 @@ class Interpretation extends Fields // set some defaults $customAdminViewButtons = ''; // set the item row - $itemRow = $this->getListItemBuilder($item, $viewName_single, $viewName_list, $itemClass, $doNotEscape, $coreLoad, $core, false, $ref, '$displayData->escape', '$user', $refview); + $itemRow = $this->getListItemBuilder( + $item, $viewName_single, $viewName_list, $itemClass, + $doNotEscape, $coreLoad, $core, false, $ref, + '$displayData->escape', '$user', $refview + ); // check if buttons was aready added if ($firstTimeBeingAdded) // TODO we must improve this to allow more items to be targeted instead of just the first item :) { // get custom admin view buttons - $customAdminViewButtons = $this->getCustomAdminViewButtons($viewName_list, $ref); + $customAdminViewButtons + = $this->getCustomAdminViewButtons( + $viewName_list, $ref + ); // make sure the custom admin view buttons are only added once $firstTimeBeingAdded = false; } @@ -8720,39 +13141,61 @@ class Interpretation extends Fields $counter++; } } - $counter = $counter + 2; - $data_value = (3 == $this->footableVersion) ? 'data-sort-value' : 'data-value'; + $counter = $counter + 2; + $data_value = (3 == $this->footableVersion) ? 'data-sort-value' + : 'data-value'; // add the defaults - $body .= PHP_EOL . $this->_t(2) . "published == 1):?>"; - $body .= PHP_EOL . $this->_t(3) . ''; - $body .= PHP_EOL . $this->_t(4) . 'langPrefix . "_PUBLISHED'" . '); ?>">'; - $body .= PHP_EOL . $this->_t(5) . 'langPrefix . "_PUBLISHED'" . '); ?>'; + $body .= PHP_EOL . $this->_t(2) + . "published == 1):?>"; + $body .= PHP_EOL . $this->_t(3) . ''; + $body .= PHP_EOL . $this->_t(4) + . 'langPrefix . "_PUBLISHED'" . '); ?>">'; + $body .= PHP_EOL . $this->_t(5) . 'langPrefix . "_PUBLISHED'" . '); ?>'; $body .= PHP_EOL . $this->_t(4) . ''; $body .= PHP_EOL . $this->_t(3) . ''; - $body .= PHP_EOL . $this->_t(2) . "published == 0):?>"; - $body .= PHP_EOL . $this->_t(3) . ''; - $body .= PHP_EOL . $this->_t(4) . 'langPrefix . "_INACTIVE'" . '); ?>">'; - $body .= PHP_EOL . $this->_t(5) . 'langPrefix . "_INACTIVE'" . '); ?>'; + $body .= PHP_EOL . $this->_t(2) + . "published == 0):?>"; + $body .= PHP_EOL . $this->_t(3) . ''; + $body .= PHP_EOL . $this->_t(4) + . 'langPrefix . "_INACTIVE'" . '); ?>">'; + $body .= PHP_EOL . $this->_t(5) . 'langPrefix . "_INACTIVE'" . '); ?>'; $body .= PHP_EOL . $this->_t(4) . ''; $body .= PHP_EOL . $this->_t(3) . ''; - $body .= PHP_EOL . $this->_t(2) . "published == 2):?>"; - $body .= PHP_EOL . $this->_t(3) . ''; - $body .= PHP_EOL . $this->_t(4) . 'langPrefix . "_ARCHIVED'" . '); ?>">'; - $body .= PHP_EOL . $this->_t(5) . 'langPrefix . "_ARCHIVED'" . '); ?>'; + $body .= PHP_EOL . $this->_t(2) + . "published == 2):?>"; + $body .= PHP_EOL . $this->_t(3) . ''; + $body .= PHP_EOL . $this->_t(4) + . 'langPrefix . "_ARCHIVED'" . '); ?>">'; + $body .= PHP_EOL . $this->_t(5) . 'langPrefix . "_ARCHIVED'" . '); ?>'; $body .= PHP_EOL . $this->_t(4) . ''; $body .= PHP_EOL . $this->_t(3) . ''; - $body .= PHP_EOL . $this->_t(2) . "published == -2):?>"; - $body .= PHP_EOL . $this->_t(3) . ''; - $body .= PHP_EOL . $this->_t(4) . 'langPrefix . "_TRASHED'" . '); ?>">'; - $body .= PHP_EOL . $this->_t(5) . 'langPrefix . "_TRASHED'" . '); ?>'; + $body .= PHP_EOL . $this->_t(2) + . "published == -2):?>"; + $body .= PHP_EOL . $this->_t(3) . ''; + $body .= PHP_EOL . $this->_t(4) + . 'langPrefix . "_TRASHED'" . '); ?>">'; + $body .= PHP_EOL . $this->_t(5) . 'langPrefix . "_TRASHED'" . '); ?>'; $body .= PHP_EOL . $this->_t(4) . ''; $body .= PHP_EOL . $this->_t(3) . ''; $body .= PHP_EOL . $this->_t(2) . ''; - $body .= PHP_EOL . $this->_t(2) . ''; + $body .= PHP_EOL . $this->_t(2) + . ''; $body .= PHP_EOL . $this->_t(3) . "id; ?>"; $body .= PHP_EOL . $this->_t(2) . ""; $body .= PHP_EOL . $this->_t(1) . ""; @@ -8762,41 +13205,52 @@ class Interpretation extends Fields { $body .= PHP_EOL . ''; $body .= PHP_EOL . $this->_t(1) . ''; - $body .= PHP_EOL . $this->_t(2) . ''; - $body .= PHP_EOL . $this->_t(3) . ''; + $body .= PHP_EOL . $this->_t(2) . ''; + $body .= PHP_EOL . $this->_t(3) + . ''; $body .= PHP_EOL . $this->_t(2) . ''; $body .= PHP_EOL . $this->_t(1) . ''; $body .= PHP_EOL . ''; } $body .= PHP_EOL . ''; $body .= PHP_EOL . ''; - $body .= PHP_EOL . $this->_t(1) . '
    '; - $body .= PHP_EOL . $this->_t(2) . ''; + $body .= PHP_EOL . $this->_t(1) + . '
    '; + $body .= PHP_EOL . $this->_t(2) . ''; $body .= PHP_EOL . $this->_t(1) . '
    '; $body .= PHP_EOL . ''; + // return the build return $body; } + return ''; } /** * set the list body table head linked admin view * - * @param string $viewName_single - * @param string $viewName_list - * @param bool $addNewButon - * @param string $refview + * @param string $viewName_single + * @param string $viewName_list + * @param bool $addNewButon + * @param string $refview * * @return string */ - public function setListHeadLinked($viewName_single, $viewName_list, $addNewButon, $refview) - { - if (isset($this->listBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->listBuilder[$viewName_list])) + public function setListHeadLinked($viewName_single, $viewName_list, + $addNewButon, $refview + ) { + if (isset($this->listBuilder[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->listBuilder[$viewName_list] + )) { // component helper name - $Helper = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper'; - $head = ''; + $Helper = $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . 'Helper'; + $head = ''; // only add new button if set if ($addNewButon > 0) { @@ -8804,11 +13258,19 @@ class Interpretation extends Fields $coreLoad = false; if (isset($this->permissionCore[$viewName_single])) { - $core = $this->permissionCore[$viewName_single]; + $core = $this->permissionCore[$viewName_single]; $coreLoad = true; } // check if the item has permissions. - if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.create']])) + if ($coreLoad && isset($core['core.create']) + && isset($this->permissionBuilder['global'][$core['core.create']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.create']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder['global'][$core['core.create']] + )) { // set permissions. $accessCheck = "\$can->get('" . $core['core.create'] . "')"; @@ -8830,12 +13292,20 @@ class Interpretation extends Fields // add the new buttons if ($addNewButon == 1 || $addNewButon == 2) { - $head .= PHP_EOL . $tabB . $this->_t(1) . ' langPrefix . "_NEW'" . '); ?>'; + $head .= PHP_EOL . $tabB . $this->_t(1) + . ' langPrefix . "_NEW'" + . '); ?>'; } // add the close and new button if ($addNewButon == 2 || $addNewButon == 3) { - $head .= PHP_EOL . $tabB . $this->_t(1) . ' langPrefix . "_CLOSE_NEW'" . '); ?>'; + $head .= PHP_EOL . $tabB . $this->_t(1) + . ' langPrefix . "_CLOSE_NEW'" + . '); ?>'; } // close group button if needed if ($addNewButon == 2) @@ -8852,15 +13322,22 @@ class Interpretation extends Fields // set the style for V2 $metro_blue = (2 == $this->footableVersion) ? ' metro-blue' : ''; // set the toggle for V3 - $toggle = (3 == $this->footableVersion) ? ' data-show-toggle="true" data-toggle-column="first"' : ''; + $toggle = (3 == $this->footableVersion) + ? ' data-show-toggle="true" data-toggle-column="first"' : ''; // set paging - $paging = (2 == $this->footableVersion) ? ' data-page-size="20" data-filter="#filter_' . $viewName_list . '"' : ' data-sorting="true" data-paging="true" data-paging-size="20" data-filtering="true"'; + $paging = (2 == $this->footableVersion) + ? ' data-page-size="20" data-filter="#filter_' . $viewName_list + . '"' + : ' data-sorting="true" data-paging="true" data-paging-size="20" data-filtering="true"'; // add html fix for V3 - $htmlFix = (3 == $this->footableVersion) ? ' data-type="html" data-sort-use="text"' : ''; - $head .= PHP_EOL . ''; - $head .= PHP_EOL . ""; + $htmlFix = (3 == $this->footableVersion) + ? ' data-type="html" data-sort-use="text"' : ''; + $head .= PHP_EOL . '
    '; + $head .= PHP_EOL . ""; // main lang prefix - $langView = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($viewName_single, 'U'); + $langView = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString($viewName_single, 'U'); // set status lang $statusLangName = $langView . '_STATUS'; // set id lang @@ -8881,47 +13358,66 @@ class Interpretation extends Fields if (1 == $item['target'] || 4 == $item['target']) { // check if we have an over-ride - if (isset($this->listHeadOverRide[$viewName_list]) && ComponentbuilderHelper::checkArray($this->listHeadOverRide[$viewName_list]) && isset($this->listHeadOverRide[$viewName_list][$item['id']])) + if (isset($this->listHeadOverRide[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->listHeadOverRide[$viewName_list] + ) + && isset($this->listHeadOverRide[$viewName_list][$item['id']])) { - $item['lang'] = $this->listHeadOverRide[$viewName_list][$item['id']]; + $item['lang'] + = $this->listHeadOverRide[$viewName_list][$item['id']]; } - $setin = (2 == $this->footableVersion) ? ' data-hide="phone"' : ' data-breakpoints="xs sm"'; + $setin = (2 == $this->footableVersion) + ? ' data-hide="phone"' : ' data-breakpoints="xs sm"'; if ($controller > 3) { - $setin = (2 == $this->footableVersion) ? ' data-hide="phone,tablet"' : ' data-breakpoints="xs sm md"'; + $setin = (2 == $this->footableVersion) + ? ' data-hide="phone,tablet"' + : ' data-breakpoints="xs sm md"'; } if ($controller > 6) { - $setin = (2 == $this->footableVersion) ? ' data-hide="all"' : ' data-breakpoints="all"'; + $setin = (2 == $this->footableVersion) + ? ' data-hide="all"' : ' data-breakpoints="all"'; } if ($item['link'] && $firstLink) { - $setin = (2 == $this->footableVersion) ? ' data-toggle="true"' : ''; + $setin = (2 == $this->footableVersion) + ? ' data-toggle="true"' : ''; $firstLink = false; } - $head .= PHP_EOL . $this->_t(2) . ""; - $head .= PHP_EOL . $this->_t(3) . ""; + $head .= PHP_EOL . $this->_t(2) . ""; + $head .= PHP_EOL . $this->_t(3) . ""; $head .= PHP_EOL . $this->_t(2) . ""; $controller++; } } // set some V3 attr - $data_hide = (2 == $this->footableVersion) ? 'data-hide="phone,tablet"' : 'data-breakpoints="xs sm md"'; - $data_type = (2 == $this->footableVersion) ? 'data-type="numeric"' : 'data-type="number"'; + $data_hide = (2 == $this->footableVersion) + ? 'data-hide="phone,tablet"' : 'data-breakpoints="xs sm md"'; + $data_type = (2 == $this->footableVersion) ? 'data-type="numeric"' + : 'data-type="number"'; // set default - $head .= PHP_EOL . $this->_t(2) . '"; - $head .= PHP_EOL . $this->_t(2) . '"; $head .= PHP_EOL . $this->_t(1) . ""; $head .= PHP_EOL . ""; return $head; } + return ''; } @@ -8934,15 +13430,20 @@ class Interpretation extends Fields * @param $parentKey * @param $parent_key * @param $globalKey + * * @return string */ - public function setListQueryLinked($viewName_single, $viewName_list, $functionName, $key, $_key, $parentKey, $parent_key, $globalKey) - { + public function setListQueryLinked($viewName_single, $viewName_list, + $functionName, $key, $_key, $parentKey, $parent_key, $globalKey + ) { // check if this view has category added - if (isset($this->categoryBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$viewName_list])) + if (isset($this->categoryBuilder[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->categoryBuilder[$viewName_list] + )) { $categoryCodeName = $this->categoryBuilder[$viewName_list]['code']; - $addCategory = true; + $addCategory = true; } else { @@ -8951,54 +13452,86 @@ class Interpretation extends Fields $query = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; $query .= PHP_EOL . $this->_t(1) . " * Method to get list data."; $query .= PHP_EOL . $this->_t(1) . " *"; - $query .= PHP_EOL . $this->_t(1) . " * @return mixed An array of data items on success, false on failure."; + $query .= PHP_EOL . $this->_t(1) + . " * @return mixed An array of data items on success, false on failure."; $query .= PHP_EOL . $this->_t(1) . " */"; - $query .= PHP_EOL . $this->_t(1) . "public function get" . $functionName . "()"; + $query .= PHP_EOL . $this->_t(1) . "public function get" . $functionName + . "()"; $query .= PHP_EOL . $this->_t(1) . "{"; // setup the query - $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the user object."; + $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Get the user object."; $query .= PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();"; - $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Create a new query object."; + $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Create a new query object."; $query .= PHP_EOL . $this->_t(2) . "\$db = JFactory::getDBO();"; $query .= PHP_EOL . $this->_t(2) . "\$query = \$db->getQuery(true);"; - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Select some fields"; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Select some fields"; $query .= PHP_EOL . $this->_t(2) . "\$query->select('a.*');"; // add the category if ($addCategory) { - $query .= PHP_EOL . $this->_t(2) . "\$query->select(\$db->quoteName('c.title','category_title'));"; + $query .= PHP_EOL . $this->_t(2) + . "\$query->select(\$db->quoteName('c.title','category_title'));"; } - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " From the " . $this->componentCodeName . "_" . $viewName_single . " table"; - $query .= PHP_EOL . $this->_t(2) . "\$query->from(\$db->quoteName('#__" . $this->componentCodeName . "_" . $viewName_single . "', 'a'));"; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " From the " . $this->componentCodeName . "_" . $viewName_single + . " table"; + $query .= PHP_EOL . $this->_t(2) . "\$query->from(\$db->quoteName('#__" + . $this->componentCodeName . "_" . $viewName_single . "', 'a'));"; // add the category if ($addCategory) { - $query .= PHP_EOL . $this->_t(2) . "\$query->join('LEFT', \$db->quoteName('#__categories', 'c') . ' ON (' . \$db->quoteName('a." . $categoryCodeName . "') . ' = ' . \$db->quoteName('c.id') . ')');"; + $query .= PHP_EOL . $this->_t(2) + . "\$query->join('LEFT', \$db->quoteName('#__categories', 'c') . ' ON (' . \$db->quoteName('a." + . $categoryCodeName + . "') . ' = ' . \$db->quoteName('c.id') . ')');"; } // add custom filtering php - $query .= $this->getCustomScriptBuilder('php_getlistquery', $viewName_single, PHP_EOL . PHP_EOL); + $query .= $this->getCustomScriptBuilder( + 'php_getlistquery', $viewName_single, PHP_EOL . PHP_EOL + ); // add the custom fields query $query .= $this->setCustomQuery($viewName_list, $viewName_single); - if (ComponentbuilderHelper::checkString($globalKey) && - $key && strpos($key, '-R>') === false && strpos($key, '-A>') === false && strpos($key, '-OR>') === false && - $parentKey && strpos($parentKey, '-R>') === false && strpos($parentKey, '-A>') === false && strpos($parentKey, '-OR>') === false) + if (ComponentbuilderHelper::checkString($globalKey) && $key + && strpos( + $key, '-R>' + ) === false + && strpos($key, '-A>') === false + && strpos($key, '-OR>') === false + && $parentKey + && strpos($parentKey, '-R>') === false + && strpos($parentKey, '-A>') === false + && strpos($parentKey, '-OR>') === false) { - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Filter by " . $globalKey . " global."; - $query .= PHP_EOL . $this->_t(2) . "\$" . $globalKey . " = \$this->" . $globalKey . ";"; - $query .= PHP_EOL . $this->_t(2) . "if (is_numeric(\$" . $globalKey . " ))"; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Filter by " . $globalKey . " global."; + $query .= PHP_EOL . $this->_t(2) . "\$" . $globalKey . " = \$this->" + . $globalKey . ";"; + $query .= PHP_EOL . $this->_t(2) . "if (is_numeric(\$" . $globalKey + . " ))"; $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $key . " = ' . (int) \$" . $globalKey . " );"; + $query .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $key + . " = ' . (int) \$" . $globalKey . " );"; $query .= PHP_EOL . $this->_t(2) . "}"; - $query .= PHP_EOL . $this->_t(2) . "elseif (is_string(\$" . $globalKey . "))"; + $query .= PHP_EOL . $this->_t(2) . "elseif (is_string(\$" + . $globalKey . "))"; $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $key . " = ' . \$db->quote(\$" . $globalKey . "));"; + $query .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $key + . " = ' . \$db->quote(\$" . $globalKey . "));"; $query .= PHP_EOL . $this->_t(2) . "}"; $query .= PHP_EOL . $this->_t(2) . "else"; $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $key . " = -5');"; + $query .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $key + . " = -5');"; $query .= PHP_EOL . $this->_t(2) . "}"; } - elseif (strpos($parentKey, '-OR>') !== false || strpos($key, '-OR>') !== false) + elseif (strpos($parentKey, '-OR>') !== false + || strpos($key, '-OR>') !== false) { // get both strings if (strpos($key, '-OR>') !== false) @@ -9021,68 +13554,125 @@ class Interpretation extends Fields $ORquery = array('s' => array(), 'i' => array()); foreach ($ORarray as $ORkey) { - $ORquery['i'][] = "a." . $ORkey . " = ' . (int) \$" . $_globalKey; - $ORquery['s'][] = "a." . $ORkey . " = ' . \$db->quote(\$" . $_globalKey . ")"; + $ORquery['i'][] = "a." . $ORkey . " = ' . (int) \$" + . $_globalKey; + $ORquery['s'][] = "a." . $ORkey . " = ' . \$db->quote(\$" + . $_globalKey . ")"; } - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Filter by " . $_globalKey . " global."; - $query .= PHP_EOL . $this->_t(2) . "\$" . $_globalKey . " = \$this->" . $_globalKey . ";"; - $query .= PHP_EOL . $this->_t(2) . "if (is_numeric(\$" . $_globalKey . " ))"; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" + . $this->setLine(__LINE__) . " Filter by " . $_globalKey + . " global."; + $query .= PHP_EOL . $this->_t(2) . "\$" . $_globalKey + . " = \$this->" . $_globalKey . ";"; + $query .= PHP_EOL . $this->_t(2) . "if (is_numeric(\$" + . $_globalKey . " ))"; $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "\$query->where('" . implode(" . ' OR ", $ORquery['i']) . ", ' OR');"; + $query .= PHP_EOL . $this->_t(3) . "\$query->where('" . implode( + " . ' OR ", $ORquery['i'] + ) . ", ' OR');"; $query .= PHP_EOL . $this->_t(2) . "}"; - $query .= PHP_EOL . $this->_t(2) . "elseif (is_string(\$" . $_globalKey . "))"; + $query .= PHP_EOL . $this->_t(2) . "elseif (is_string(\$" + . $_globalKey . "))"; $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "\$query->where('" . implode(" . ' OR ", $ORquery['s']) . ", ' OR');"; + $query .= PHP_EOL . $this->_t(3) . "\$query->where('" . implode( + " . ' OR ", $ORquery['s'] + ) . ", ' OR');"; $query .= PHP_EOL . $this->_t(2) . "}"; $query .= PHP_EOL . $this->_t(2) . "else"; $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $ORkey . " = -5');"; + $query .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $ORkey + . " = -5');"; $query .= PHP_EOL . $this->_t(2) . "}"; } } - if (isset($this->accessBuilder[$viewName_single]) && ComponentbuilderHelper::checkString($this->accessBuilder[$viewName_single])) + if (isset($this->accessBuilder[$viewName_single]) + && ComponentbuilderHelper::checkString( + $this->accessBuilder[$viewName_single] + )) { - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Join over the asset groups."; - $query .= PHP_EOL . $this->_t(2) . "\$query->select('ag.title AS access_level');"; - $query .= PHP_EOL . $this->_t(2) . "\$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');"; - $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Filter by access level."; - $query .= PHP_EOL . $this->_t(2) . "if (\$access = \$this->getState('filter.access'))"; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Join over the asset groups."; + $query .= PHP_EOL . $this->_t(2) + . "\$query->select('ag.title AS access_level');"; + $query .= PHP_EOL . $this->_t(2) + . "\$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');"; + $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Filter by access level."; + $query .= PHP_EOL . $this->_t(2) + . "if (\$access = \$this->getState('filter.access'))"; $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "\$query->where('a.access = ' . (int) \$access);"; + $query .= PHP_EOL . $this->_t(3) + . "\$query->where('a.access = ' . (int) \$access);"; $query .= PHP_EOL . $this->_t(2) . "}"; - $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Implement View Level Access"; - $query .= PHP_EOL . $this->_t(2) . "if (!\$user->authorise('core.options', 'com_" . $this->componentCodeName . "'))"; + $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Implement View Level Access"; + $query .= PHP_EOL . $this->_t(2) + . "if (!\$user->authorise('core.options', 'com_" + . $this->componentCodeName . "'))"; $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "\$groups = implode(',', \$user->getAuthorisedViewLevels());"; - $query .= PHP_EOL . $this->_t(3) . "\$query->where('a.access IN (' . \$groups . ')');"; + $query .= PHP_EOL . $this->_t(3) + . "\$groups = implode(',', \$user->getAuthorisedViewLevels());"; + $query .= PHP_EOL . $this->_t(3) + . "\$query->where('a.access IN (' . \$groups . ')');"; $query .= PHP_EOL . $this->_t(2) . "}"; } - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Order the results by ordering"; - $query .= PHP_EOL . $this->_t(2) . "\$query->order('a.published ASC');"; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Order the results by ordering"; + $query .= PHP_EOL . $this->_t(2) + . "\$query->order('a.published ASC');"; $query .= PHP_EOL . $this->_t(2) . "\$query->order('a.ordering ASC');"; - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Load the items"; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Load the items"; $query .= PHP_EOL . $this->_t(2) . "\$db->setQuery(\$query);"; $query .= PHP_EOL . $this->_t(2) . "\$db->execute();"; $query .= PHP_EOL . $this->_t(2) . "if (\$db->getNumRows())"; $query .= PHP_EOL . $this->_t(2) . "{"; $query .= PHP_EOL . $this->_t(3) . "\$items = \$db->loadObjectList();"; // add the fixing strings method - $query .= $this->setGetItemsMethodStringFix($viewName_single, $viewName_list, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh], $this->_t(1)); + $query .= $this->setGetItemsMethodStringFix( + $viewName_single, $viewName_list, + $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh], + $this->_t(1) + ); // add translations - $query .= $this->setSelectionTranslationFix($viewName_list, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh], $this->_t(1)); + $query .= $this->setSelectionTranslationFix( + $viewName_list, + $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh], + $this->_t(1) + ); // filter by child repetable field values - if (ComponentbuilderHelper::checkString($globalKey) && $key && strpos($key, '-R>') !== false && strpos($key, '-A>') === false) + if (ComponentbuilderHelper::checkString($globalKey) && $key + && strpos( + $key, '-R>' + ) !== false + && strpos($key, '-A>') === false) { list($field, $target) = explode('-R>', $key); - $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Filter by " . $globalKey . " in this Repetable Field"; - $query .= PHP_EOL . $this->_t(3) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$items) && isset(\$this->" . $globalKey . "))"; + $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " Filter by " . $globalKey . " in this Repetable Field"; + $query .= PHP_EOL . $this->_t(3) . "if (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::checkArray(\$items) && isset(\$this->" + . $globalKey . "))"; $query .= PHP_EOL . $this->_t(3) . "{"; - $query .= PHP_EOL . $this->_t(4) . "foreach (\$items as \$nr => &\$item)"; + $query .= PHP_EOL . $this->_t(4) + . "foreach (\$items as \$nr => &\$item)"; $query .= PHP_EOL . $this->_t(4) . "{"; - $query .= PHP_EOL . $this->_t(5) . "if (isset(\$item->" . $field . ") && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkJson(\$item->" . $field . "))"; + $query .= PHP_EOL . $this->_t(5) . "if (isset(\$item->" . $field + . ") && " . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::checkJson(\$item->" . $field . "))"; $query .= PHP_EOL . $this->_t(5) . "{"; - $query .= PHP_EOL . $this->_t(6) . "\$tmpArray = json_decode(\$item->" . $field . ",true);"; - $query .= PHP_EOL . $this->_t(6) . "if (!isset(\$tmpArray['" . $target . "']) || !" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$tmpArray['" . $target . "']) || !in_array(\$this->" . $globalKey . ", \$tmpArray['" . $target . "']))"; + $query .= PHP_EOL . $this->_t(6) + . "\$tmpArray = json_decode(\$item->" . $field . ",true);"; + $query .= PHP_EOL . $this->_t(6) . "if (!isset(\$tmpArray['" + . $target . "']) || !" . $this->fileContentStatic[$this->hhh + . 'Component' . $this->hhh] . "Helper::checkArray(\$tmpArray['" + . $target . "']) || !in_array(\$this->" . $globalKey + . ", \$tmpArray['" . $target . "']))"; $query .= PHP_EOL . $this->_t(6) . "{"; $query .= PHP_EOL . $this->_t(7) . "unset(\$items[\$nr]);"; $query .= PHP_EOL . $this->_t(7) . "continue;"; @@ -9101,40 +13691,66 @@ class Interpretation extends Fields $query .= PHP_EOL . $this->_t(3) . "}"; } // filter by child array field values - if (ComponentbuilderHelper::checkString($globalKey) && $key && strpos($key, '-R>') === false && strpos($key, '-A>') !== false) + if (ComponentbuilderHelper::checkString($globalKey) && $key + && strpos( + $key, '-R>' + ) === false + && strpos($key, '-A>') !== false) { - $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Filter by " . $globalKey . " Array Field"; - $query .= PHP_EOL . $this->_t(3) . "\$" . $globalKey . " = \$this->" . $globalKey . ";"; - $query .= PHP_EOL . $this->_t(3) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$items) && \$" . $globalKey . ")"; + $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " Filter by " . $globalKey . " Array Field"; + $query .= PHP_EOL . $this->_t(3) . "\$" . $globalKey . " = \$this->" + . $globalKey . ";"; + $query .= PHP_EOL . $this->_t(3) . "if (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::checkArray(\$items) && \$" . $globalKey + . ")"; $query .= PHP_EOL . $this->_t(3) . "{"; - $query .= PHP_EOL . $this->_t(4) . "foreach (\$items as \$nr => &\$item)"; + $query .= PHP_EOL . $this->_t(4) + . "foreach (\$items as \$nr => &\$item)"; $query .= PHP_EOL . $this->_t(4) . "{"; list($bin, $target) = explode('-A>', $key); if (ComponentbuilderHelper::checkString($target)) { - $query .= PHP_EOL . $this->_t(5) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkJson(\$item->" . $target . "))"; + $query .= PHP_EOL . $this->_t(5) . "if (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::checkJson(\$item->" . $target + . "))"; $query .= PHP_EOL . $this->_t(5) . "{"; - $query .= PHP_EOL . $this->_t(6) . "\$item->" . $target . " = json_decode(\$item->" . $target . ", true);"; + $query .= PHP_EOL . $this->_t(6) . "\$item->" . $target + . " = json_decode(\$item->" . $target . ", true);"; $query .= PHP_EOL . $this->_t(5) . "}"; - $query .= PHP_EOL . $this->_t(5) . "elseif (!isset(\$item->" . $target . ") || !" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$item->" . $target . "))"; + $query .= PHP_EOL . $this->_t(5) . "elseif (!isset(\$item->" + . $target . ") || !" . $this->fileContentStatic[$this->hhh + . 'Component' . $this->hhh] . "Helper::checkArray(\$item->" + . $target . "))"; $query .= PHP_EOL . $this->_t(5) . "{"; $query .= PHP_EOL . $this->_t(6) . "unset(\$items[\$nr]);"; $query .= PHP_EOL . $this->_t(6) . "continue;"; $query .= PHP_EOL . $this->_t(5) . "}"; - $query .= PHP_EOL . $this->_t(5) . "if (!in_array(\$" . $globalKey . ",\$item->" . $target . "))"; + $query .= PHP_EOL . $this->_t(5) . "if (!in_array(\$" + . $globalKey . ",\$item->" . $target . "))"; } else { - $query .= PHP_EOL . $this->_t(5) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkJson(\$item->" . $_key . "))"; + $query .= PHP_EOL . $this->_t(5) . "if (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::checkJson(\$item->" . $_key . "))"; $query .= PHP_EOL . $this->_t(5) . "{"; - $query .= PHP_EOL . $this->_t(6) . "\$item->" . $_key . " = json_decode(\$item->" . $_key . ", true);"; + $query .= PHP_EOL . $this->_t(6) . "\$item->" . $_key + . " = json_decode(\$item->" . $_key . ", true);"; $query .= PHP_EOL . $this->_t(5) . "}"; - $query .= PHP_EOL . $this->_t(5) . "elseif (!isset(\$item->" . $_key . ") || !" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$item->" . $_key . "))"; + $query .= PHP_EOL . $this->_t(5) . "elseif (!isset(\$item->" + . $_key . ") || !" . $this->fileContentStatic[$this->hhh + . 'Component' . $this->hhh] . "Helper::checkArray(\$item->" + . $_key . "))"; $query .= PHP_EOL . $this->_t(5) . "{"; $query .= PHP_EOL . $this->_t(6) . "unset(\$items[\$nr]);"; $query .= PHP_EOL . $this->_t(6) . "continue;"; $query .= PHP_EOL . $this->_t(5) . "}"; - $query .= PHP_EOL . $this->_t(5) . "if (!in_array(\$" . $globalKey . ",\$item->" . $_key . "))"; + $query .= PHP_EOL . $this->_t(5) . "if (!in_array(\$" + . $globalKey . ",\$item->" . $_key . "))"; } $query .= PHP_EOL . $this->_t(5) . "{"; $query .= PHP_EOL . $this->_t(6) . "unset(\$items[\$nr]);"; @@ -9148,18 +13764,36 @@ class Interpretation extends Fields $query .= PHP_EOL . $this->_t(3) . "}"; } // filter by parent repetable field values - if (ComponentbuilderHelper::checkString($globalKey) && $key && strpos($parentKey, '-R>') !== false && strpos($parentKey, '-A>') === false) + if (ComponentbuilderHelper::checkString($globalKey) && $key + && strpos( + $parentKey, '-R>' + ) !== false + && strpos($parentKey, '-A>') === false) { list($bin, $target) = explode('-R>', $parentKey); - $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Filter by " . $_key . " Repetable Field"; - $query .= PHP_EOL . $this->_t(3) . "\$" . $globalKey . " = json_decode(\$this->" . $globalKey . ",true);"; - $query .= PHP_EOL . $this->_t(3) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$items) && isset(\$" . $globalKey . ") && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$" . $globalKey . "))"; + $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " Filter by " . $_key . " Repetable Field"; + $query .= PHP_EOL . $this->_t(3) . "\$" . $globalKey + . " = json_decode(\$this->" . $globalKey . ",true);"; + $query .= PHP_EOL . $this->_t(3) . "if (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::checkArray(\$items) && isset(\$" + . $globalKey . ") && " . $this->fileContentStatic[$this->hhh + . 'Component' . $this->hhh] . "Helper::checkArray(\$" + . $globalKey . "))"; $query .= PHP_EOL . $this->_t(3) . "{"; - $query .= PHP_EOL . $this->_t(4) . "foreach (\$items as \$nr => &\$item)"; + $query .= PHP_EOL . $this->_t(4) + . "foreach (\$items as \$nr => &\$item)"; $query .= PHP_EOL . $this->_t(4) . "{"; - $query .= PHP_EOL . $this->_t(5) . "if (\$item->" . $_key . " && isset(\$" . $globalKey . "['" . $target . "']) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$" . $globalKey . "['" . $target . "']))"; + $query .= PHP_EOL . $this->_t(5) . "if (\$item->" . $_key + . " && isset(\$" . $globalKey . "['" . $target . "']) && " + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::checkArray(\$" . $globalKey . "['" + . $target . "']))"; $query .= PHP_EOL . $this->_t(5) . "{"; - $query .= PHP_EOL . $this->_t(6) . "if (!in_array(\$item->" . $_key . ",\$" . $globalKey . "['" . $target . "']))"; + $query .= PHP_EOL . $this->_t(6) . "if (!in_array(\$item->" . $_key + . ",\$" . $globalKey . "['" . $target . "']))"; $query .= PHP_EOL . $this->_t(6) . "{"; $query .= PHP_EOL . $this->_t(7) . "unset(\$items[\$nr]);"; $query .= PHP_EOL . $this->_t(7) . "continue;"; @@ -9178,26 +13812,43 @@ class Interpretation extends Fields $query .= PHP_EOL . $this->_t(3) . "}"; } // filter by parent array field values - if (ComponentbuilderHelper::checkString($globalKey) && $key && strpos($parentKey, '-R>') === false && strpos($parentKey, '-A>') !== false) + if (ComponentbuilderHelper::checkString($globalKey) && $key + && strpos( + $parentKey, '-R>' + ) === false + && strpos($parentKey, '-A>') !== false) { - $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Filter by " . $globalKey . " Array Field"; - $query .= PHP_EOL . $this->_t(3) . "\$" . $globalKey . " = \$this->" . $globalKey . ";"; - $query .= PHP_EOL . $this->_t(3) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$items) && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$" . $globalKey . "))"; + $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " Filter by " . $globalKey . " Array Field"; + $query .= PHP_EOL . $this->_t(3) . "\$" . $globalKey . " = \$this->" + . $globalKey . ";"; + $query .= PHP_EOL . $this->_t(3) . "if (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::checkArray(\$items) && " + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::checkArray(\$" . $globalKey . "))"; $query .= PHP_EOL . $this->_t(3) . "{"; - $query .= PHP_EOL . $this->_t(4) . "foreach (\$items as \$nr => &\$item)"; + $query .= PHP_EOL . $this->_t(4) + . "foreach (\$items as \$nr => &\$item)"; $query .= PHP_EOL . $this->_t(4) . "{"; list($bin, $target) = explode('-A>', $parentKey); if (ComponentbuilderHelper::checkString($target)) { - $query .= PHP_EOL . $this->_t(5) . "if (\$item->" . $_key . " && " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$" . $globalKey . "['" . $target . "']))"; + $query .= PHP_EOL . $this->_t(5) . "if (\$item->" . $_key + . " && " . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::checkArray(\$" . $globalKey . "['" + . $target . "']))"; $query .= PHP_EOL . $this->_t(5) . "{"; - $query .= PHP_EOL . $this->_t(6) . "if (!in_array(\$item->" . $_key . ",\$" . $globalKey . "['" . $target . "']))"; + $query .= PHP_EOL . $this->_t(6) . "if (!in_array(\$item->" + . $_key . ",\$" . $globalKey . "['" . $target . "']))"; } else { $query .= PHP_EOL . $this->_t(5) . "if (\$item->" . $_key . ")"; $query .= PHP_EOL . $this->_t(5) . "{"; - $query .= PHP_EOL . $this->_t(6) . "if (!in_array(\$item->" . $_key . ",\$" . $globalKey . "))"; + $query .= PHP_EOL . $this->_t(6) . "if (!in_array(\$item->" + . $_key . ",\$" . $globalKey . "))"; } $query .= PHP_EOL . $this->_t(6) . "{"; $query .= PHP_EOL . $this->_t(7) . "unset(\$items[\$nr]);"; @@ -9217,41 +13868,68 @@ class Interpretation extends Fields $query .= PHP_EOL . $this->_t(3) . "}"; } // add custom php to getitems method after all - $query .= $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL . PHP_EOL . $this->_t(1)); + $query .= $this->getCustomScriptBuilder( + 'php_getitems_after_all', $viewName_single, + PHP_EOL . PHP_EOL . $this->_t(1) + ); $query .= PHP_EOL . $this->_t(3) . "return \$items;"; $query .= PHP_EOL . $this->_t(2) . "}"; $query .= PHP_EOL . $this->_t(2) . "return false;"; $query .= PHP_EOL . $this->_t(1) . "}"; // SELECTIONTRANSLATIONFIXFUNC<<>> - $query .= $this->setSelectionTranslationFixFunc($viewName_list, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]); + $query .= $this->setSelectionTranslationFixFunc( + $viewName_list, + $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] + ); // fixe mothod name clash - $query = str_replace('selectionTranslation(', 'selectionTranslation' . $functionName . '(', $query); + $query = str_replace( + 'selectionTranslation(', + 'selectionTranslation' . $functionName . '(', $query + ); return $query; } /** * @param $viewName_list + * * @return array|string */ public function setCustomAdminDynamicButton($viewName_list) { $buttons = ''; - if (isset($this->customAdminDynamicButtons[$viewName_list]) && ComponentbuilderHelper::checkArray($this->customAdminDynamicButtons[$viewName_list])) + if (isset($this->customAdminDynamicButtons[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->customAdminDynamicButtons[$viewName_list] + )) { $buttons = array(); - foreach ($this->customAdminDynamicButtons[$viewName_list] as $custom_button) + foreach ( + $this->customAdminDynamicButtons[$viewName_list] as + $custom_button + ) { // Load to lang $keyLang = $this->langPrefix . '_' . $custom_button['NAME']; - $this->setLangContent($this->lang, $keyLang, ComponentbuilderHelper::safeString($custom_button['name'], 'Ww')); + $this->setLangContent( + $this->lang, $keyLang, ComponentbuilderHelper::safeString( + $custom_button['name'], 'Ww' + ) + ); // add cpanel button - $buttons[] = $this->_t(2) . "if (\$this->canDo->get('" . $custom_button['link'] . ".access'))"; + $buttons[] = $this->_t(2) . "if (\$this->canDo->get('" + . $custom_button['link'] . ".access'))"; $buttons[] = $this->_t(2) . "{"; - $buttons[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " add " . $custom_button['name'] . " button."; - $buttons[] = $this->_t(3) . "JToolBarHelper::custom('" . $viewName_list . ".redirectTo" . ComponentbuilderHelper::safeString($custom_button['link'], 'F') . "', '" . $custom_button['icon'] . "', '', '" . $keyLang . "', true);"; + $buttons[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " add " . $custom_button['name'] . " button."; + $buttons[] = $this->_t(3) . "JToolBarHelper::custom('" + . $viewName_list . ".redirectTo" + . ComponentbuilderHelper::safeString( + $custom_button['link'], 'F' + ) . "', '" . $custom_button['icon'] . "', '', '" . $keyLang + . "', true);"; $buttons[] = $this->_t(2) . "}"; } if (ComponentbuilderHelper::checkArray($buttons)) @@ -9259,116 +13937,198 @@ class Interpretation extends Fields return implode(PHP_EOL, $buttons); } } + return $buttons; } /** * @param $viewName_list + * * @return array|string */ public function setCustomAdminDynamicButtonController($viewName_list) { $method = ''; - if (isset($this->customAdminDynamicButtons[$viewName_list]) && ComponentbuilderHelper::checkArray($this->customAdminDynamicButtons[$viewName_list])) + if (isset($this->customAdminDynamicButtons[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->customAdminDynamicButtons[$viewName_list] + )) { $method = array(); - foreach ($this->customAdminDynamicButtons[$viewName_list] as $custom_button) + foreach ( + $this->customAdminDynamicButtons[$viewName_list] as + $custom_button + ) { // add the custom redirect method - $method[] = PHP_EOL . PHP_EOL . $this->_t(1) . "public function redirectTo" . ComponentbuilderHelper::safeString($custom_button['link'], 'F') . "()"; + $method[] = PHP_EOL . PHP_EOL . $this->_t(1) + . "public function redirectTo" + . ComponentbuilderHelper::safeString( + $custom_button['link'], 'F' + ) . "()"; $method[] = $this->_t(1) . "{"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check for request forgeries"; - $method[] = $this->_t(2) . "JSession::checkToken() or die(JText:" . ":_('JINVALID_TOKEN'));"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if export is allowed for this user."; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Check for request forgeries"; + $method[] = $this->_t(2) + . "JSession::checkToken() or die(JText:" + . ":_('JINVALID_TOKEN'));"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " check if export is allowed for this user."; $method[] = $this->_t(2) . "\$user = JFactory::getUser();"; - $method[] = $this->_t(2) . "if (\$user->authorise('" . $custom_button['link'] . ".access', 'com_" . $this->componentCodeName . "'))"; + $method[] = $this->_t(2) . "if (\$user->authorise('" + . $custom_button['link'] . ".access', 'com_" + . $this->componentCodeName . "'))"; $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get the input"; - $method[] = $this->_t(3) . "\$input = JFactory::getApplication()->input;"; - $method[] = $this->_t(3) . "\$pks = \$input->post->get('cid', array(), 'array');"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Sanitize the input"; + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Get the input"; + $method[] = $this->_t(3) + . "\$input = JFactory::getApplication()->input;"; + $method[] = $this->_t(3) + . "\$pks = \$input->post->get('cid', array(), 'array');"; + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Sanitize the input"; $method[] = $this->_t(3) . "JArrayHelper::toInteger(\$pks);"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " convert to string"; + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " convert to string"; $method[] = $this->_t(3) . "\$ids = implode('_', \$pks);"; - $method[] = $this->_t(3) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->componentCodeName . "&view=" . $custom_button['link'] . "&cid='.\$ids, false));"; + $method[] = $this->_t(3) + . "\$this->setRedirect(JRoute::_('index.php?option=com_" + . $this->componentCodeName . "&view=" + . $custom_button['link'] . "&cid='.\$ids, false));"; $method[] = $this->_t(3) . "return;"; $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Redirect to the list screen with error."; - $method[] = $this->_t(2) . "\$message = JText:" . ":_('" . $this->langPrefix . "_ACCESS_TO_" . $custom_button['NAME'] . "_FAILED');"; - $method[] = $this->_t(2) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->componentCodeName . "&view=" . $viewName_list . "', false), \$message, 'error');"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Redirect to the list screen with error."; + $method[] = $this->_t(2) . "\$message = JText:" . ":_('" + . $this->langPrefix . "_ACCESS_TO_" . $custom_button['NAME'] + . "_FAILED');"; + $method[] = $this->_t(2) + . "\$this->setRedirect(JRoute::_('index.php?option=com_" + . $this->componentCodeName . "&view=" . $viewName_list + . "', false), \$message, 'error');"; $method[] = $this->_t(2) . "return;"; $method[] = $this->_t(1) . "}"; // add to lang array - $lankey = $this->langPrefix . "_ACCESS_TO_" . $custom_button['NAME'] . "_FAILED"; - $this->setLangContent($this->lang, $lankey, 'Access to ' . $custom_button['link'] . ' was denied.'); + $lankey = $this->langPrefix . "_ACCESS_TO_" + . $custom_button['NAME'] . "_FAILED"; + $this->setLangContent( + $this->lang, $lankey, + 'Access to ' . $custom_button['link'] . ' was denied.' + ); } return implode(PHP_EOL, $method); } + return $method; } /** * A function that builds get Items Method for model * - * @param string $viewName_single The single view name - * @param string $viewName_list The list view name - * @param array $config The config details to adapt the method being build + * @param string $viewName_single The single view name + * @param string $viewName_list The list view name + * @param array $config The config details to adapt the method being build * * @return string */ - public function setGetItemsModelMethod($viewName_single, $viewName_list, $config = array('functionName' => 'getExportData', 'docDesc' => 'Method to get list export data.', 'type' => 'export')) - { + public function setGetItemsModelMethod($viewName_single, $viewName_list, + $config + = array('functionName' => 'getExportData', + 'docDesc' => 'Method to get list export data.', + 'type' => 'export') + ) { // start the query string $query = ''; // check if this is the export method $isExport = ('export' === $config['type']); // check if this view has export feature, and or if this is not an export method - if ((isset($this->eximportView[$viewName_list]) && $this->eximportView[$viewName_list]) || !$isExport) + if ((isset($this->eximportView[$viewName_list]) + && $this->eximportView[$viewName_list]) + || !$isExport) { $query = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; $query .= PHP_EOL . $this->_t(1) . " * " . $config['docDesc']; $query .= PHP_EOL . $this->_t(1) . " *"; - $query .= PHP_EOL . $this->_t(1) . " * @param array \$pks The ids of the items to get"; - $query .= PHP_EOL . $this->_t(1) . " * @param JUser \$user The user making the request"; + $query .= PHP_EOL . $this->_t(1) + . " * @param array \$pks The ids of the items to get"; + $query .= PHP_EOL . $this->_t(1) + . " * @param JUser \$user The user making the request"; $query .= PHP_EOL . $this->_t(1) . " *"; - $query .= PHP_EOL . $this->_t(1) . " * @return mixed An array of data items on success, false on failure."; + $query .= PHP_EOL . $this->_t(1) + . " * @return mixed An array of data items on success, false on failure."; $query .= PHP_EOL . $this->_t(1) . " */"; - $query .= PHP_EOL . $this->_t(1) . "public function " . $config['functionName'] . "(\$pks, \$user = null)"; + $query .= PHP_EOL . $this->_t(1) . "public function " + . $config['functionName'] . "(\$pks, \$user = null)"; $query .= PHP_EOL . $this->_t(1) . "{"; - $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " setup the query"; - $query .= PHP_EOL . $this->_t(2) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$pks))"; + $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " setup the query"; + $query .= PHP_EOL . $this->_t(2) . "if (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::checkArray(\$pks))"; $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set a value to know this is " . $config['type'] . " method. (USE IN CUSTOM CODE TO ALTER OUTCOME)"; - $query .= PHP_EOL . $this->_t(3) . "\$_" . $config['type'] . " = true;"; - $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get the user object if not set."; - $query .= PHP_EOL . $this->_t(3) . "if (!isset(\$user) || !" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkObject(\$user))"; + $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Set a value to know this is " . $config['type'] + . " method. (USE IN CUSTOM CODE TO ALTER OUTCOME)"; + $query .= PHP_EOL . $this->_t(3) . "\$_" . $config['type'] + . " = true;"; + $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Get the user object if not set."; + $query .= PHP_EOL . $this->_t(3) . "if (!isset(\$user) || !" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::checkObject(\$user))"; $query .= PHP_EOL . $this->_t(3) . "{"; $query .= PHP_EOL . $this->_t(4) . "\$user = JFactory::getUser();"; $query .= PHP_EOL . $this->_t(3) . "}"; - $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Create a new query object."; + $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Create a new query object."; $query .= PHP_EOL . $this->_t(3) . "\$db = JFactory::getDBO();"; - $query .= PHP_EOL . $this->_t(3) . "\$query = \$db->getQuery(true);"; - $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Select some fields"; + $query .= PHP_EOL . $this->_t(3) + . "\$query = \$db->getQuery(true);"; + $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " Select some fields"; $query .= PHP_EOL . $this->_t(3) . "\$query->select('a.*');"; - $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " From the " . $this->componentCodeName . "_" . $viewName_single . " table"; - $query .= PHP_EOL . $this->_t(3) . "\$query->from(\$db->quoteName('#__" . $this->componentCodeName . "_" . $viewName_single . "', 'a'));"; - $query .= PHP_EOL . $this->_t(3) . "\$query->where('a.id IN (' . implode(',',\$pks) . ')');"; + $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " From the " . $this->componentCodeName . "_" + . $viewName_single . " table"; + $query .= PHP_EOL . $this->_t(3) + . "\$query->from(\$db->quoteName('#__" + . $this->componentCodeName . "_" . $viewName_single + . "', 'a'));"; + $query .= PHP_EOL . $this->_t(3) + . "\$query->where('a.id IN (' . implode(',',\$pks) . ')');"; // add custom filtering php - $query .= $this->getCustomScriptBuilder('php_getlistquery', $viewName_single, PHP_EOL . PHP_EOL . $this->_t(1)); + $query .= $this->getCustomScriptBuilder( + 'php_getlistquery', $viewName_single, + PHP_EOL . PHP_EOL . $this->_t(1) + ); // first check if we export of text only is avalable if ($this->exportTextOnly) { // add switch - $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get global switch to activate text only export"; - $query .= PHP_EOL . $this->_t(3) . "\$export_text_only = JComponentHelper::getParams('com_" . $this->componentCodeName . "')->get('export_text_only', 0);"; + $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " Get global switch to activate text only export"; + $query .= PHP_EOL . $this->_t(3) + . "\$export_text_only = JComponentHelper::getParams('com_" + . $this->componentCodeName + . "')->get('export_text_only', 0);"; // first check if we have custom queries - $custom_query = $this->setCustomQuery($viewName_list, $viewName_single, $this->_t(2), true); + $custom_query = $this->setCustomQuery( + $viewName_list, $viewName_single, $this->_t(2), true + ); } // if values were returned add the area - if (isset($custom_query) && ComponentbuilderHelper::checkString($custom_query)) + if (isset($custom_query) + && ComponentbuilderHelper::checkString( + $custom_query + )) { - $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Add these queries only if text only is required"; + $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " Add these queries only if text only is required"; $query .= PHP_EOL . $this->_t(3) . "if (\$export_text_only)"; $query .= PHP_EOL . $this->_t(3) . "{"; // add the custom fields query @@ -9376,45 +14136,75 @@ class Interpretation extends Fields $query .= PHP_EOL . $this->_t(3) . "}"; } // add access levels if the view has access set - if (isset($this->accessBuilder[$viewName_single]) && ComponentbuilderHelper::checkString($this->accessBuilder[$viewName_single])) + if (isset($this->accessBuilder[$viewName_single]) + && ComponentbuilderHelper::checkString( + $this->accessBuilder[$viewName_single] + )) { - $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Implement View Level Access"; - $query .= PHP_EOL . $this->_t(3) . "if (!\$user->authorise('core.options', 'com_" . $this->componentCodeName . "'))"; + $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " Implement View Level Access"; + $query .= PHP_EOL . $this->_t(3) + . "if (!\$user->authorise('core.options', 'com_" + . $this->componentCodeName . "'))"; $query .= PHP_EOL . $this->_t(3) . "{"; - $query .= PHP_EOL . $this->_t(4) . "\$groups = implode(',', \$user->getAuthorisedViewLevels());"; - $query .= PHP_EOL . $this->_t(4) . "\$query->where('a.access IN (' . \$groups . ')');"; + $query .= PHP_EOL . $this->_t(4) + . "\$groups = implode(',', \$user->getAuthorisedViewLevels());"; + $query .= PHP_EOL . $this->_t(4) + . "\$query->where('a.access IN (' . \$groups . ')');"; $query .= PHP_EOL . $this->_t(3) . "}"; } - $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Order the results by ordering"; - $query .= PHP_EOL . $this->_t(3) . "\$query->order('a.ordering ASC');"; - $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Load the items"; + $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " Order the results by ordering"; + $query .= PHP_EOL . $this->_t(3) + . "\$query->order('a.ordering ASC');"; + $query .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " Load the items"; $query .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query);"; $query .= PHP_EOL . $this->_t(3) . "\$db->execute();"; $query .= PHP_EOL . $this->_t(3) . "if (\$db->getNumRows())"; $query .= PHP_EOL . $this->_t(3) . "{"; - $query .= PHP_EOL . $this->_t(4) . "\$items = \$db->loadObjectList();"; + $query .= PHP_EOL . $this->_t(4) + . "\$items = \$db->loadObjectList();"; // set the string fixing code - $query .= $this->setGetItemsMethodStringFix($viewName_single, $viewName_list, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh], $this->_t(2), $isExport, true); + $query .= $this->setGetItemsMethodStringFix( + $viewName_single, $viewName_list, + $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh], + $this->_t(2), $isExport, true + ); // first check if we export of text only is avalable if ($this->exportTextOnly) { - $query_translations = $this->setSelectionTranslationFix($viewName_list, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh], $this->_t(3)); + $query_translations = $this->setSelectionTranslationFix( + $viewName_list, + $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh], $this->_t(3) + ); } // add translations - if (isset($query_translations) && ComponentbuilderHelper::checkString($query_translations)) + if (isset($query_translations) + && ComponentbuilderHelper::checkString($query_translations)) { - $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Add these translation only if text only is required"; + $query .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " Add these translation only if text only is required"; $query .= PHP_EOL . $this->_t(3) . "if (\$export_text_only)"; $query .= PHP_EOL . $this->_t(3) . "{"; $query .= $query_translations; $query .= PHP_EOL . $this->_t(3) . "}"; } // add custom php to getItems method after all - $query .= $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL . PHP_EOL . $this->_t(2)); + $query .= $this->getCustomScriptBuilder( + 'php_getitems_after_all', $viewName_single, + PHP_EOL . PHP_EOL . $this->_t(2) + ); // in privacy export we must return array of arrays if ('privacy' === $config['type']) { - $query .= PHP_EOL . $this->_t(4) . "return json_decode(json_encode(\$items), true);"; + $query .= PHP_EOL . $this->_t(4) + . "return json_decode(json_encode(\$items), true);"; } else { @@ -9430,135 +14220,231 @@ class Interpretation extends Fields $header = ComponentbuilderHelper::getDynamicScripts('headers'); // add getExImPortHeaders - $query .= $this->getCustomScriptBuilder('php_import_headers', 'import_' . $viewName_list, PHP_EOL . PHP_EOL, null, true, + $query .= $this->getCustomScriptBuilder( + 'php_import_headers', 'import_' . $viewName_list, + PHP_EOL . PHP_EOL, null, true, // set a default script for those with no custom script - PHP_EOL . PHP_EOL . $this->setPlaceholders($header, $this->placeholders)); + PHP_EOL . PHP_EOL . $this->setPlaceholders( + $header, $this->placeholders + ) + ); } } + return $query; } - public function setControllerEximportMethod($viewName_single, $viewName_list) - { + public function setControllerEximportMethod($viewName_single, $viewName_list + ) { $method = ''; - if (isset($this->eximportView[$viewName_list]) && $this->eximportView[$viewName_list]) + if (isset($this->eximportView[$viewName_list]) + && $this->eximportView[$viewName_list]) { $method = array(); // add the export method - $method[] = PHP_EOL . PHP_EOL . $this->_t(1) . "public function exportData()"; + $method[] = PHP_EOL . PHP_EOL . $this->_t(1) + . "public function exportData()"; $method[] = $this->_t(1) . "{"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check for request forgeries"; - $method[] = $this->_t(2) . "JSession::checkToken() or die(JText:" . ":_('JINVALID_TOKEN'));"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if export is allowed for this user."; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Check for request forgeries"; + $method[] = $this->_t(2) . "JSession::checkToken() or die(JText:" + . ":_('JINVALID_TOKEN'));"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " check if export is allowed for this user."; $method[] = $this->_t(2) . "\$user = JFactory::getUser();"; - $method[] = $this->_t(2) . "if (\$user->authorise('" . $viewName_single . ".export', 'com_" . $this->componentCodeName . "') && \$user->authorise('core.export', 'com_" . $this->componentCodeName . "'))"; + $method[] = $this->_t(2) . "if (\$user->authorise('" + . $viewName_single . ".export', 'com_" + . $this->componentCodeName + . "') && \$user->authorise('core.export', 'com_" + . $this->componentCodeName . "'))"; $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get the input"; - $method[] = $this->_t(3) . "\$input = JFactory::getApplication()->input;"; - $method[] = $this->_t(3) . "\$pks = \$input->post->get('cid', array(), 'array');"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Sanitize the input"; + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Get the input"; + $method[] = $this->_t(3) + . "\$input = JFactory::getApplication()->input;"; + $method[] = $this->_t(3) + . "\$pks = \$input->post->get('cid', array(), 'array');"; + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Sanitize the input"; $method[] = $this->_t(3) . "JArrayHelper::toInteger(\$pks);"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get the model"; - $method[] = $this->_t(3) . "\$model = \$this->getModel('" . ComponentbuilderHelper::safeString($viewName_list, 'F') . "');"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " get the data to export"; - $method[] = $this->_t(3) . "\$data = \$model->getExportData(\$pks);"; - $method[] = $this->_t(3) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkArray(\$data))"; + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Get the model"; + $method[] = $this->_t(3) . "\$model = \$this->getModel('" + . ComponentbuilderHelper::safeString($viewName_list, 'F') + . "');"; + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " get the data to export"; + $method[] = $this->_t(3) + . "\$data = \$model->getExportData(\$pks);"; + $method[] = $this->_t(3) . "if (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::checkArray(\$data))"; $method[] = $this->_t(3) . "{"; - $method[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " now set the data to the spreadsheet"; + $method[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + . " now set the data to the spreadsheet"; $method[] = $this->_t(4) . "\$date = JFactory::getDate();"; - $method[] = $this->_t(4) . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::xls(\$data,'" . ComponentbuilderHelper::safeString($viewName_list, 'F') . "_'.\$date->format('jS_F_Y'),'" . ComponentbuilderHelper::safeString($viewName_list, 'Ww') . " exported ('.\$date->format('jS F, Y').')','" . ComponentbuilderHelper::safeString($viewName_list, 'w') . "');"; + $method[] = $this->_t(4) . $this->fileContentStatic[$this->hhh + . 'Component' . $this->hhh] . "Helper::xls(\$data,'" + . ComponentbuilderHelper::safeString($viewName_list, 'F') + . "_'.\$date->format('jS_F_Y'),'" + . ComponentbuilderHelper::safeString($viewName_list, 'Ww') + . " exported ('.\$date->format('jS F, Y').')','" + . ComponentbuilderHelper::safeString($viewName_list, 'w') + . "');"; $method[] = $this->_t(3) . "}"; $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Redirect to the list screen with error."; - $method[] = $this->_t(2) . "\$message = JText:" . ":_('" . $this->langPrefix . "_EXPORT_FAILED');"; - $method[] = $this->_t(2) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->componentCodeName . "&view=" . $viewName_list . "', false), \$message, 'error');"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Redirect to the list screen with error."; + $method[] = $this->_t(2) . "\$message = JText:" . ":_('" + . $this->langPrefix . "_EXPORT_FAILED');"; + $method[] = $this->_t(2) + . "\$this->setRedirect(JRoute::_('index.php?option=com_" + . $this->componentCodeName . "&view=" . $viewName_list + . "', false), \$message, 'error');"; $method[] = $this->_t(2) . "return;"; $method[] = $this->_t(1) . "}"; // add the import method - $method[] = PHP_EOL . PHP_EOL . $this->_t(1) . "public function importData()"; + $method[] = PHP_EOL . PHP_EOL . $this->_t(1) + . "public function importData()"; $method[] = $this->_t(1) . "{"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check for request forgeries"; - $method[] = $this->_t(2) . "JSession::checkToken() or die(JText:" . ":_('JINVALID_TOKEN'));"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if import is allowed for this user."; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Check for request forgeries"; + $method[] = $this->_t(2) . "JSession::checkToken() or die(JText:" + . ":_('JINVALID_TOKEN'));"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " check if import is allowed for this user."; $method[] = $this->_t(2) . "\$user = JFactory::getUser();"; - $method[] = $this->_t(2) . "if (\$user->authorise('" . $viewName_single . ".import', 'com_" . $this->componentCodeName . "') && \$user->authorise('core.import', 'com_" . $this->componentCodeName . "'))"; + $method[] = $this->_t(2) . "if (\$user->authorise('" + . $viewName_single . ".import', 'com_" + . $this->componentCodeName + . "') && \$user->authorise('core.import', 'com_" + . $this->componentCodeName . "'))"; $method[] = $this->_t(2) . "{"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get the import model"; - $method[] = $this->_t(3) . "\$model = \$this->getModel('" . ComponentbuilderHelper::safeString($viewName_list, 'F') . "');"; - $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " get the headers to import"; - $method[] = $this->_t(3) . "\$headers = \$model->getExImPortHeaders();"; - $method[] = $this->_t(3) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkObject(\$headers))"; + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Get the import model"; + $method[] = $this->_t(3) . "\$model = \$this->getModel('" + . ComponentbuilderHelper::safeString($viewName_list, 'F') + . "');"; + $method[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " get the headers to import"; + $method[] = $this->_t(3) + . "\$headers = \$model->getExImPortHeaders();"; + $method[] = $this->_t(3) . "if (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::checkObject(\$headers))"; $method[] = $this->_t(3) . "{"; - $method[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Load headers to session."; + $method[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + . " Load headers to session."; $method[] = $this->_t(4) . "\$session = JFactory::getSession();"; $method[] = $this->_t(4) . "\$headers = json_encode(\$headers);"; - $method[] = $this->_t(4) . "\$session->set('" . $viewName_single . "_VDM_IMPORTHEADERS', \$headers);"; - $method[] = $this->_t(4) . "\$session->set('backto_VDM_IMPORT', '" . $viewName_list . "');"; - $method[] = $this->_t(4) . "\$session->set('dataType_VDM_IMPORTINTO', '" . $viewName_single . "');"; - $method[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Redirect to import view."; + $method[] = $this->_t(4) . "\$session->set('" . $viewName_single + . "_VDM_IMPORTHEADERS', \$headers);"; + $method[] = $this->_t(4) . "\$session->set('backto_VDM_IMPORT', '" + . $viewName_list . "');"; + $method[] = $this->_t(4) + . "\$session->set('dataType_VDM_IMPORTINTO', '" + . $viewName_single . "');"; + $method[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + . " Redirect to import view."; // add to lang array - $selectImportFileNote = $this->langPrefix . "_IMPORT_SELECT_FILE_FOR_" . ComponentbuilderHelper::safeString($viewName_list, 'U'); - $this->setLangContent($this->lang, $selectImportFileNote, 'Select the file to import data to ' . $viewName_list . '.'); - $method[] = $this->_t(4) . "\$message = JText:" . ":_('" . $selectImportFileNote . "');"; + $selectImportFileNote = $this->langPrefix + . "_IMPORT_SELECT_FILE_FOR_" + . ComponentbuilderHelper::safeString($viewName_list, 'U'); + $this->setLangContent( + $this->lang, $selectImportFileNote, + 'Select the file to import data to ' . $viewName_list . '.' + ); + $method[] = $this->_t(4) . "\$message = JText:" . ":_('" + . $selectImportFileNote . "');"; // if this view has custom script it must have as custom import (model, veiw, controller) - if (isset($this->importCustomScripts[$viewName_list]) && $this->importCustomScripts[$viewName_list]) + if (isset($this->importCustomScripts[$viewName_list]) + && $this->importCustomScripts[$viewName_list]) { - $method[] = $this->_t(4) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->componentCodeName . "&view=import_" . $viewName_list . "', false), \$message);"; + $method[] = $this->_t(4) + . "\$this->setRedirect(JRoute::_('index.php?option=com_" + . $this->componentCodeName . "&view=import_" + . $viewName_list . "', false), \$message);"; } else { - $method[] = $this->_t(4) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->componentCodeName . "&view=import', false), \$message);"; + $method[] = $this->_t(4) + . "\$this->setRedirect(JRoute::_('index.php?option=com_" + . $this->componentCodeName + . "&view=import', false), \$message);"; } $method[] = $this->_t(4) . "return;"; $method[] = $this->_t(3) . "}"; $method[] = $this->_t(2) . "}"; - $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Redirect to the list screen with error."; - $method[] = $this->_t(2) . "\$message = JText:" . ":_('" . $this->langPrefix . "_IMPORT_FAILED');"; - $method[] = $this->_t(2) . "\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->componentCodeName . "&view=" . $viewName_list . "', false), \$message, 'error');"; + $method[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Redirect to the list screen with error."; + $method[] = $this->_t(2) . "\$message = JText:" . ":_('" + . $this->langPrefix . "_IMPORT_FAILED');"; + $method[] = $this->_t(2) + . "\$this->setRedirect(JRoute::_('index.php?option=com_" + . $this->componentCodeName . "&view=" . $viewName_list + . "', false), \$message, 'error');"; $method[] = $this->_t(2) . "return;"; $method[] = $this->_t(1) . "}"; + return implode(PHP_EOL, $method); } + return $method; } public function setExportButton($viewName_single, $viewName_list) { $button = ''; - if (isset($this->eximportView[$viewName_list]) && $this->eximportView[$viewName_list]) + if (isset($this->eximportView[$viewName_list]) + && $this->eximportView[$viewName_list]) { // main lang prefix - $langExport = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Export Data', 'U'); + $langExport = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString('Export Data', 'U'); // add to lang array $this->setLangContent($this->lang, $langExport, 'Export Data'); - $button = array(); - $button[] = PHP_EOL . PHP_EOL . $this->_t(3) . "if (\$this->canDo->get('core.export') && \$this->canDo->get('" . $viewName_single . ".export'))"; + $button = array(); + $button[] = PHP_EOL . PHP_EOL . $this->_t(3) + . "if (\$this->canDo->get('core.export') && \$this->canDo->get('" + . $viewName_single . ".export'))"; $button[] = $this->_t(3) . "{"; - $button[] = $this->_t(4) . "JToolBarHelper::custom('" . $viewName_list . ".exportData', 'download', '', '" . $langExport . "', true);"; + $button[] = $this->_t(4) . "JToolBarHelper::custom('" + . $viewName_list . ".exportData', 'download', '', '" + . $langExport . "', true);"; $button[] = $this->_t(3) . "}"; + return implode(PHP_EOL, $button); } + return $button; } public function setImportButton($viewName_single, $viewName_list) { $button = ''; - if (isset($this->eximportView[$viewName_list]) && $this->eximportView[$viewName_list]) + if (isset($this->eximportView[$viewName_list]) + && $this->eximportView[$viewName_list]) { // main lang prefix - $langImport = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Import Data', 'U'); + $langImport = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString('Import Data', 'U'); // add to lang array $this->setLangContent($this->lang, $langImport, 'Import Data'); - $button = array(); - $button[] = PHP_EOL . PHP_EOL . $this->_t(2) . "if (\$this->canDo->get('core.import') && \$this->canDo->get('" . $viewName_single . ".import'))"; + $button = array(); + $button[] = PHP_EOL . PHP_EOL . $this->_t(2) + . "if (\$this->canDo->get('core.import') && \$this->canDo->get('" + . $viewName_single . ".import'))"; $button[] = $this->_t(2) . "{"; - $button[] = $this->_t(3) . "JToolBarHelper::custom('" . $viewName_list . ".importData', 'upload', '', '" . $langImport . "', false);"; + $button[] = $this->_t(3) . "JToolBarHelper::custom('" + . $viewName_list . ".importData', 'upload', '', '" . $langImport + . "', false);"; $button[] = $this->_t(2) . "}"; + return implode(PHP_EOL, $button); } + return $button; } @@ -9569,34 +14455,81 @@ class Interpretation extends Fields $this->buildDynamique($target, 'customimport'); // load the custom script to the files // IMPORT_EXT_METHOD_CUSTOM <<>> - $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'IMPORT_EXT_METHOD_CUSTOM' . $this->hhh] = $this->getCustomScriptBuilder('php_import_ext', 'import_' . $viewName_list, PHP_EOL, null, true); + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh + . 'IMPORT_EXT_METHOD_CUSTOM' . $this->hhh] + = $this->getCustomScriptBuilder( + 'php_import_ext', 'import_' . $viewName_list, PHP_EOL, null, true + ); // IMPORT_DISPLAY_METHOD_CUSTOM <<>> - $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'IMPORT_DISPLAY_METHOD_CUSTOM' . $this->hhh] = $this->getCustomScriptBuilder('php_import_display', 'import_' . $viewName_list, PHP_EOL, null, true); + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh + . 'IMPORT_DISPLAY_METHOD_CUSTOM' . $this->hhh] + = $this->getCustomScriptBuilder( + 'php_import_display', 'import_' . $viewName_list, PHP_EOL, null, + true + ); // IMPORT_SETDATE_METHOD_CUSTOM <<>> - $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'IMPORT_SETDATE_METHOD_CUSTOM' . $this->hhh] = $this->getCustomScriptBuilder('php_import_setdata', 'import_' . $viewName_list, PHP_EOL, null, true); + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh + . 'IMPORT_SETDATE_METHOD_CUSTOM' . $this->hhh] + = $this->getCustomScriptBuilder( + 'php_import_setdata', 'import_' . $viewName_list, PHP_EOL, null, + true + ); // IMPORT_METHOD_CUSTOM <<>> - $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'IMPORT_METHOD_CUSTOM' . $this->hhh] = $this->getCustomScriptBuilder('php_import', 'import_' . $viewName_list, PHP_EOL, null, true); + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh + . 'IMPORT_METHOD_CUSTOM' . $this->hhh] + = $this->getCustomScriptBuilder( + 'php_import', 'import_' . $viewName_list, PHP_EOL, null, true + ); // IMPORT_SAVE_METHOD_CUSTOM <<>> - $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'IMPORT_SAVE_METHOD_CUSTOM' . $this->hhh] = $this->getCustomScriptBuilder('php_import_save', 'import_' . $viewName_list, PHP_EOL, null, true); + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh + . 'IMPORT_SAVE_METHOD_CUSTOM' . $this->hhh] + = $this->getCustomScriptBuilder( + 'php_import_save', 'import_' . $viewName_list, PHP_EOL, null, true + ); // IMPORT_DEFAULT_VIEW_CUSTOM <<>> - $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'IMPORT_DEFAULT_VIEW_CUSTOM' . $this->hhh] = $this->getCustomScriptBuilder('html_import_view', 'import_' . $viewName_list, PHP_EOL, null, true); + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh + . 'IMPORT_DEFAULT_VIEW_CUSTOM' . $this->hhh] + = $this->getCustomScriptBuilder( + 'html_import_view', 'import_' . $viewName_list, PHP_EOL, null, true + ); // insure we have the view placeholders setup - $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'VIEW' . $this->hhh] = 'IMPORT_' . $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh]; - $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'View' . $this->hhh] = 'Import_' . $this->placeholders[$this->hhh . 'views' . $this->hhh]; - $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'view' . $this->hhh] = 'import_' . $this->placeholders[$this->hhh . 'views' . $this->hhh]; - $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'VIEWS' . $this->hhh] = 'IMPORT_' . $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh]; - $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'Views' . $this->hhh] = 'Import_' . $this->placeholders[$this->hhh . 'views' . $this->hhh]; - $this->fileContentDynamic['import_' . $viewName_list][$this->hhh . 'views' . $this->hhh] = 'import_' . $this->placeholders[$this->hhh . 'views' . $this->hhh]; + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh + . 'VIEW' . $this->hhh] + = 'IMPORT_' . $this->placeholders[$this->hhh . 'VIEWS' + . $this->hhh]; + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh + . 'View' . $this->hhh] + = 'Import_' . $this->placeholders[$this->hhh . 'views' + . $this->hhh]; + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh + . 'view' . $this->hhh] + = 'import_' . $this->placeholders[$this->hhh . 'views' + . $this->hhh]; + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh + . 'VIEWS' . $this->hhh] + = 'IMPORT_' . $this->placeholders[$this->hhh . 'VIEWS' + . $this->hhh]; + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh + . 'Views' . $this->hhh] + = 'Import_' . $this->placeholders[$this->hhh . 'views' + . $this->hhh]; + $this->fileContentDynamic['import_' . $viewName_list][$this->hhh + . 'views' . $this->hhh] + = 'import_' . $this->placeholders[$this->hhh . 'views' + . $this->hhh]; } public function setListQuery($viewName_single, $viewName_list) { // check if this view has category added - if (isset($this->categoryBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$viewName_list])) + if (isset($this->categoryBuilder[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->categoryBuilder[$viewName_list] + )) { $categoryCodeName = $this->categoryBuilder[$viewName_list]['code']; - $addCategory = true; + $addCategory = true; } else { @@ -9605,52 +14538,84 @@ class Interpretation extends Fields // setup the query $query = "//" . $this->setLine(__LINE__) . " Get the user object."; $query .= PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();"; - $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Create a new query object."; + $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Create a new query object."; $query .= PHP_EOL . $this->_t(2) . "\$db = JFactory::getDBO();"; $query .= PHP_EOL . $this->_t(2) . "\$query = \$db->getQuery(true);"; - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Select some fields"; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Select some fields"; $query .= PHP_EOL . $this->_t(2) . "\$query->select('a.*');"; // add the category if ($addCategory) { - $query .= PHP_EOL . $this->_t(2) . "\$query->select(\$db->quoteName('c.title','category_title'));"; + $query .= PHP_EOL . $this->_t(2) + . "\$query->select(\$db->quoteName('c.title','category_title'));"; } - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " From the " . $this->componentCodeName . "_item table"; - $query .= PHP_EOL . $this->_t(2) . "\$query->from(\$db->quoteName('#__" . $this->componentCodeName . "_" . $viewName_single . "', 'a'));"; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " From the " . $this->componentCodeName . "_item table"; + $query .= PHP_EOL . $this->_t(2) . "\$query->from(\$db->quoteName('#__" + . $this->componentCodeName . "_" . $viewName_single . "', 'a'));"; // add the category if ($addCategory) { - $query .= PHP_EOL . $this->_t(2) . "\$query->join('LEFT', \$db->quoteName('#__categories', 'c') . ' ON (' . \$db->quoteName('a." . $categoryCodeName . "') . ' = ' . \$db->quoteName('c.id') . ')');"; + $query .= PHP_EOL . $this->_t(2) + . "\$query->join('LEFT', \$db->quoteName('#__categories', 'c') . ' ON (' . \$db->quoteName('a." + . $categoryCodeName + . "') . ' = ' . \$db->quoteName('c.id') . ')');"; } // add custom filtering php - $query .= $this->getCustomScriptBuilder('php_getlistquery', $viewName_single, PHP_EOL . PHP_EOL); + $query .= $this->getCustomScriptBuilder( + 'php_getlistquery', $viewName_single, PHP_EOL . PHP_EOL + ); // add the custom fields query $query .= $this->setCustomQuery($viewName_list, $viewName_single); - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Filter by published state"; - $query .= PHP_EOL . $this->_t(2) . "\$published = \$this->getState('filter.published');"; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Filter by published state"; + $query .= PHP_EOL . $this->_t(2) + . "\$published = \$this->getState('filter.published');"; $query .= PHP_EOL . $this->_t(2) . "if (is_numeric(\$published))"; $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "\$query->where('a.published = ' . (int) \$published);"; + $query .= PHP_EOL . $this->_t(3) + . "\$query->where('a.published = ' . (int) \$published);"; $query .= PHP_EOL . $this->_t(2) . "}"; $query .= PHP_EOL . $this->_t(2) . "elseif (\$published === '')"; $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "\$query->where('(a.published = 0 OR a.published = 1)');"; + $query .= PHP_EOL . $this->_t(3) + . "\$query->where('(a.published = 0 OR a.published = 1)');"; $query .= PHP_EOL . $this->_t(2) . "}"; - if (isset($this->accessBuilder[$viewName_single]) && ComponentbuilderHelper::checkString($this->accessBuilder[$viewName_single])) + if (isset($this->accessBuilder[$viewName_single]) + && ComponentbuilderHelper::checkString( + $this->accessBuilder[$viewName_single] + )) { - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Join over the asset groups."; - $query .= PHP_EOL . $this->_t(2) . "\$query->select('ag.title AS access_level');"; - $query .= PHP_EOL . $this->_t(2) . "\$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');"; - $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Filter by access level."; - $query .= PHP_EOL . $this->_t(2) . "if (\$access = \$this->getState('filter.access'))"; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Join over the asset groups."; + $query .= PHP_EOL . $this->_t(2) + . "\$query->select('ag.title AS access_level');"; + $query .= PHP_EOL . $this->_t(2) + . "\$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');"; + $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Filter by access level."; + $query .= PHP_EOL . $this->_t(2) + . "if (\$access = \$this->getState('filter.access'))"; $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "\$query->where('a.access = ' . (int) \$access);"; + $query .= PHP_EOL . $this->_t(3) + . "\$query->where('a.access = ' . (int) \$access);"; $query .= PHP_EOL . $this->_t(2) . "}"; - $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Implement View Level Access"; - $query .= PHP_EOL . $this->_t(2) . "if (!\$user->authorise('core.options', 'com_" . $this->componentCodeName . "'))"; + $query .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Implement View Level Access"; + $query .= PHP_EOL . $this->_t(2) + . "if (!\$user->authorise('core.options', 'com_" + . $this->componentCodeName . "'))"; $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "\$groups = implode(',', \$user->getAuthorisedViewLevels());"; - $query .= PHP_EOL . $this->_t(3) . "\$query->where('a.access IN (' . \$groups . ')');"; + $query .= PHP_EOL . $this->_t(3) + . "\$groups = implode(',', \$user->getAuthorisedViewLevels());"; + $query .= PHP_EOL . $this->_t(3) + . "\$query->where('a.access IN (' . \$groups . ')');"; $query .= PHP_EOL . $this->_t(2) . "}"; } // set the search query @@ -9660,34 +14625,50 @@ class Interpretation extends Fields // add the category if ($addCategory) { - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Filter by a single or group of categories."; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Filter by a single or group of categories."; $query .= PHP_EOL . $this->_t(2) . "\$baselevel = 1;"; - $query .= PHP_EOL . $this->_t(2) . "\$categoryId = \$this->getState('filter.category_id');"; + $query .= PHP_EOL . $this->_t(2) + . "\$categoryId = \$this->getState('filter.category_id');"; $query .= PHP_EOL; $query .= PHP_EOL . $this->_t(2) . "if (is_numeric(\$categoryId))"; $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "\$cat_tbl = JTable::getInstance('Category', 'JTable');"; + $query .= PHP_EOL . $this->_t(3) + . "\$cat_tbl = JTable::getInstance('Category', 'JTable');"; $query .= PHP_EOL . $this->_t(3) . "\$cat_tbl->load(\$categoryId);"; $query .= PHP_EOL . $this->_t(3) . "\$rgt = \$cat_tbl->rgt;"; $query .= PHP_EOL . $this->_t(3) . "\$lft = \$cat_tbl->lft;"; - $query .= PHP_EOL . $this->_t(3) . "\$baselevel = (int) \$cat_tbl->level;"; - $query .= PHP_EOL . $this->_t(3) . "\$query->where('c.lft >= ' . (int) \$lft)"; - $query .= PHP_EOL . $this->_t(4) . "->where('c.rgt <= ' . (int) \$rgt);"; + $query .= PHP_EOL . $this->_t(3) + . "\$baselevel = (int) \$cat_tbl->level;"; + $query .= PHP_EOL . $this->_t(3) + . "\$query->where('c.lft >= ' . (int) \$lft)"; + $query .= PHP_EOL . $this->_t(4) + . "->where('c.rgt <= ' . (int) \$rgt);"; $query .= PHP_EOL . $this->_t(2) . "}"; - $query .= PHP_EOL . $this->_t(2) . "elseif (is_array(\$categoryId))"; + $query .= PHP_EOL . $this->_t(2) + . "elseif (is_array(\$categoryId))"; $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "JArrayHelper::toInteger(\$categoryId);"; - $query .= PHP_EOL . $this->_t(3) . "\$categoryId = implode(',', \$categoryId);"; - $query .= PHP_EOL . $this->_t(3) . "\$query->where('a.category IN (' . \$categoryId . ')');"; + $query .= PHP_EOL . $this->_t(3) + . "JArrayHelper::toInteger(\$categoryId);"; + $query .= PHP_EOL . $this->_t(3) + . "\$categoryId = implode(',', \$categoryId);"; + $query .= PHP_EOL . $this->_t(3) + . "\$query->where('a.category IN (' . \$categoryId . ')');"; $query .= PHP_EOL . $this->_t(2) . "}"; $query .= PHP_EOL; } - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add the list ordering clause."; - $query .= PHP_EOL . $this->_t(2) . "\$orderCol = \$this->state->get('list.ordering', 'a.id');"; - $query .= PHP_EOL . $this->_t(2) . "\$orderDirn = \$this->state->get('list.direction', 'asc'); "; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Add the list ordering clause."; + $query .= PHP_EOL . $this->_t(2) + . "\$orderCol = \$this->state->get('list.ordering', 'a.id');"; + $query .= PHP_EOL . $this->_t(2) + . "\$orderDirn = \$this->state->get('list.direction', 'asc'); "; $query .= PHP_EOL . $this->_t(2) . "if (\$orderCol != '')"; $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "\$query->order(\$db->escape(\$orderCol . ' ' . \$orderDirn));"; + $query .= PHP_EOL . $this->_t(3) + . "\$query->order(\$db->escape(\$orderCol . ' ' . \$orderDirn));"; $query .= PHP_EOL . $this->_t(2) . "}"; $query .= PHP_EOL; $query .= PHP_EOL . $this->_t(2) . "return \$query;"; @@ -9697,7 +14678,10 @@ class Interpretation extends Fields public function setSearchQuery($viewName_list) { - if (isset($this->searchBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->searchBuilder[$viewName_list])) + if (isset($this->searchBuilder[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->searchBuilder[$viewName_list] + )) { // setup the searh options $search = "'("; @@ -9707,163 +14691,295 @@ class Interpretation extends Fields if ($nr == 0) { $search .= "a." . $array['code'] . " LIKE '.\$search.'"; - if (ComponentbuilderHelper::checkArray($array['custom']) && 1 == $array['list']) + if (ComponentbuilderHelper::checkArray($array['custom']) + && 1 == $array['list']) { - $search .= " OR " . $array['custom']['db'] . "." . $array['custom']['text'] . " LIKE '.\$search.'"; + $search .= " OR " . $array['custom']['db'] . "." + . $array['custom']['text'] . " LIKE '.\$search.'"; } } else { $search .= " OR a." . $array['code'] . " LIKE '.\$search.'"; - if (ComponentbuilderHelper::checkArray($array['custom']) && 1 == $array['list']) + if (ComponentbuilderHelper::checkArray($array['custom']) + && 1 == $array['list']) { - $search .= " OR " . $array['custom']['db'] . "." . $array['custom']['text'] . " LIKE '.\$search.'"; + $search .= " OR " . $array['custom']['db'] . "." + . $array['custom']['text'] . " LIKE '.\$search.'"; } } } $search .= ")'"; // now setup query - $query = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Filter by search."; - $query .= PHP_EOL . $this->_t(2) . "\$search = \$this->getState('filter.search');"; + $query = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Filter by search."; + $query .= PHP_EOL . $this->_t(2) + . "\$search = \$this->getState('filter.search');"; $query .= PHP_EOL . $this->_t(2) . "if (!empty(\$search))"; $query .= PHP_EOL . $this->_t(2) . "{"; - $query .= PHP_EOL . $this->_t(3) . "if (stripos(\$search, 'id:') === 0)"; + $query .= PHP_EOL . $this->_t(3) + . "if (stripos(\$search, 'id:') === 0)"; $query .= PHP_EOL . $this->_t(3) . "{"; - $query .= PHP_EOL . $this->_t(4) . "\$query->where('a.id = ' . (int) substr(\$search, 3));"; + $query .= PHP_EOL . $this->_t(4) + . "\$query->where('a.id = ' . (int) substr(\$search, 3));"; $query .= PHP_EOL . $this->_t(3) . "}"; $query .= PHP_EOL . $this->_t(3) . "else"; $query .= PHP_EOL . $this->_t(3) . "{"; - $query .= PHP_EOL . $this->_t(4) . "\$search = \$db->quote('%' . \$db->escape(\$search) . '%');"; - $query .= PHP_EOL . $this->_t(4) . "\$query->where(" . $search . ");"; + $query .= PHP_EOL . $this->_t(4) + . "\$search = \$db->quote('%' . \$db->escape(\$search) . '%');"; + $query .= PHP_EOL . $this->_t(4) . "\$query->where(" . $search + . ");"; $query .= PHP_EOL . $this->_t(3) . "}"; $query .= PHP_EOL . $this->_t(2) . "}"; $query .= PHP_EOL; return $query; } + return ''; } - public function setCustomQuery($viewName_list, $viewName_single, $tab = '', $just_text = false) - { - if (isset($this->customBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->customBuilder[$viewName_list])) + public function setCustomQuery($viewName_list, $viewName_single, $tab = '', + $just_text = false + ) { + if (isset($this->customBuilder[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->customBuilder[$viewName_list] + )) { $query = ""; foreach ($this->customBuilder[$viewName_list] as $filter) { // only load this if table is set - if ((isset($this->customBuilderList[$viewName_list]) && ComponentbuilderHelper::checkArray($this->customBuilderList[$viewName_list]) && in_array($filter['code'], $this->customBuilderList[$viewName_list]) && isset($filter['custom']['table']) && ComponentbuilderHelper::checkString($filter['custom']['table']) && $filter['method'] == 0) - || ($just_text && isset($filter['custom']['table']) && ComponentbuilderHelper::checkString($filter['custom']['table']) && $filter['method'] == 0)) + if ((isset($this->customBuilderList[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->customBuilderList[$viewName_list] + ) + && in_array( + $filter['code'], + $this->customBuilderList[$viewName_list] + ) + && isset($filter['custom']['table']) + && ComponentbuilderHelper::checkString( + $filter['custom']['table'] + ) + && $filter['method'] == 0) + || ($just_text && isset($filter['custom']['table']) + && ComponentbuilderHelper::checkString( + $filter['custom']['table'] + ) + && $filter['method'] == 0)) { - $query .= PHP_EOL . PHP_EOL . $this->_t(2) . $tab . "//" . $this->setLine(__LINE__) . " From the " . ComponentbuilderHelper::safeString(ComponentbuilderHelper::safeString($filter['custom']['table'], 'w')) . " table."; + $query .= PHP_EOL . PHP_EOL . $this->_t(2) . $tab . "//" + . $this->setLine(__LINE__) . " From the " + . ComponentbuilderHelper::safeString( + ComponentbuilderHelper::safeString( + $filter['custom']['table'], 'w' + ) + ) . " table."; // we want to at times just have the words and not the ids as well if ($just_text) { - $query .= PHP_EOL . $this->_t(2) . $tab . "\$query->select(\$db->quoteName('" . $filter['custom']['db'] . "." . $filter['custom']['text'] . "','" . $filter['code'] . "'));"; + $query .= PHP_EOL . $this->_t(2) . $tab + . "\$query->select(\$db->quoteName('" + . $filter['custom']['db'] . "." + . $filter['custom']['text'] . "','" + . $filter['code'] . "'));"; } else { - $query .= PHP_EOL . $this->_t(2) . $tab . "\$query->select(\$db->quoteName('" . $filter['custom']['db'] . "." . $filter['custom']['text'] . "','" . $filter['code'] . "_" . $filter['custom']['text'] . "'));"; + $query .= PHP_EOL . $this->_t(2) . $tab + . "\$query->select(\$db->quoteName('" + . $filter['custom']['db'] . "." + . $filter['custom']['text'] . "','" + . $filter['code'] . "_" . $filter['custom']['text'] + . "'));"; } - $query .= PHP_EOL . $this->_t(2) . $tab . "\$query->join('LEFT', \$db->quoteName('" . $filter['custom']['table'] . "', '" . $filter['custom']['db'] . "') . ' ON (' . \$db->quoteName('a." . $filter['code'] . "') . ' = ' . \$db->quoteName('" . $filter['custom']['db'] . "." . $filter['custom']['id'] . "') . ')');"; + $query .= PHP_EOL . $this->_t(2) . $tab + . "\$query->join('LEFT', \$db->quoteName('" + . $filter['custom']['table'] . "', '" + . $filter['custom']['db'] + . "') . ' ON (' . \$db->quoteName('a." . $filter['code'] + . "') . ' = ' . \$db->quoteName('" + . $filter['custom']['db'] . "." + . $filter['custom']['id'] . "') . ')');"; } // build the field type file - $this->setCustomFieldTypeFile($filter, $viewName_list, $viewName_single); + $this->setCustomFieldTypeFile( + $filter, $viewName_list, $viewName_single + ); } + return $query; } } public function setFilterQuery($viewName_list) { - if (isset($this->filterBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->filterBuilder[$viewName_list])) + if (isset($this->filterBuilder[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->filterBuilder[$viewName_list] + )) { $filterQuery = ""; foreach ($this->filterBuilder[$viewName_list] as $filter) { - if ($filter['type'] != 'category' && ComponentbuilderHelper::checkArray($filter['custom'])) + if ($filter['type'] != 'category' + && ComponentbuilderHelper::checkArray($filter['custom'])) { - $filterQuery .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Filter by " . $filter['code'] . "."; - $filterQuery .= PHP_EOL . $this->_t(2) . "if (\$" . $filter['code'] . " = \$this->getState('filter." . $filter['code'] . "'))"; + $filterQuery .= PHP_EOL . $this->_t(2) . "//" + . $this->setLine(__LINE__) . " Filter by " + . $filter['code'] . "."; + $filterQuery .= PHP_EOL . $this->_t(2) . "if (\$" + . $filter['code'] . " = \$this->getState('filter." + . $filter['code'] . "'))"; $filterQuery .= PHP_EOL . $this->_t(2) . "{"; - $filterQuery .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $filter['code'] . " = ' . \$db->quote(\$db->escape(\$" . $filter['code'] . ")));"; + $filterQuery .= PHP_EOL . $this->_t(3) + . "\$query->where('a." . $filter['code'] + . " = ' . \$db->quote(\$db->escape(\$" . $filter['code'] + . ")));"; $filterQuery .= PHP_EOL . $this->_t(2) . "}"; } elseif ($filter['type'] != 'category') { - $filterQuery .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Filter by " . ucwords($filter['code']) . "."; - $filterQuery .= PHP_EOL . $this->_t(2) . "if (\$" . $filter['code'] . " = \$this->getState('filter." . $filter['code'] . "'))"; + $filterQuery .= PHP_EOL . $this->_t(2) . "//" + . $this->setLine(__LINE__) . " Filter by " . ucwords( + $filter['code'] + ) . "."; + $filterQuery .= PHP_EOL . $this->_t(2) . "if (\$" + . $filter['code'] . " = \$this->getState('filter." + . $filter['code'] . "'))"; $filterQuery .= PHP_EOL . $this->_t(2) . "{"; - $filterQuery .= PHP_EOL . $this->_t(3) . "\$query->where('a." . $filter['code'] . " = ' . \$db->quote(\$db->escape(\$" . $filter['code'] . ")));"; + $filterQuery .= PHP_EOL . $this->_t(3) + . "\$query->where('a." . $filter['code'] + . " = ' . \$db->quote(\$db->escape(\$" . $filter['code'] + . ")));"; $filterQuery .= PHP_EOL . $this->_t(2) . "}"; } } + return $filterQuery; } + return ''; } public function buildTheViewScript($viewArray) { // set the view name - $viewName = ComponentbuilderHelper::safeString($viewArray['settings']->name_single); + $viewName = ComponentbuilderHelper::safeString( + $viewArray['settings']->name_single + ); // add conditions to this view - if (isset($viewArray['settings']->conditions) && ComponentbuilderHelper::checkArray($viewArray['settings']->conditions)) + if (isset($viewArray['settings']->conditions) + && ComponentbuilderHelper::checkArray( + $viewArray['settings']->conditions + )) { // reset defaults - $getValue = array(); - $ifValue = array(); + $getValue = array(); + $ifValue = array(); $targetControls = array(); - $functions = array(); + $functions = array(); foreach ($viewArray['settings']->conditions as $condition) { - if (isset($condition['match_name']) && ComponentbuilderHelper::checkString($condition['match_name'])) + if (isset($condition['match_name']) + && ComponentbuilderHelper::checkString( + $condition['match_name'] + )) { - $uniqueVar = $this->uniquekey(7); - $matchName = $condition['match_name'] . '_' . $uniqueVar; - $targetBehavior = ($condition['target_behavior'] == 1 || $condition['target_behavior'] == 3) ? 'show' : 'hide'; - $targetDefault = ($condition['target_behavior'] == 1 || $condition['target_behavior'] == 3) ? 'hide' : 'show'; + $uniqueVar = $this->uniquekey(7); + $matchName = $condition['match_name'] . '_' + . $uniqueVar; + $targetBehavior = ($condition['target_behavior'] == 1 + || $condition['target_behavior'] == 3) ? 'show' + : 'hide'; + $targetDefault = ($condition['target_behavior'] == 1 + || $condition['target_behavior'] == 3) ? 'hide' + : 'show'; // set the realtation if any if ($condition['target_relation']) { // chain to other items of the same target - $relations = $this->getTargetRelationScript($viewArray['settings']->conditions, $condition, $viewName); + $relations = $this->getTargetRelationScript( + $viewArray['settings']->conditions, $condition, + $viewName + ); if (ComponentbuilderHelper::checkArray($relations)) { // set behavior and default array $behaviors[$matchName] = $targetBehavior; - $defaults[$matchName] = $targetDefault; - $toggleSwitch[$matchName] = ($condition['target_behavior'] == 1 || $condition['target_behavior'] == 2) ? true : false; + $defaults[$matchName] = $targetDefault; + $toggleSwitch[$matchName] + = ($condition['target_behavior'] + == 1 + || $condition['target_behavior'] == 2) ? true + : false; // set the type buket $typeBuket[$matchName] = $condition['match_type']; // set function array $functions[$uniqueVar][0] = $matchName; - $matchNames[$matchName] = $condition['match_name']; + $matchNames[$matchName] + = $condition['match_name']; // get the select value - $getValue[$matchName] = $this->getValueScript($condition['match_type'], $condition['match_name'], $condition['match_extends'], $uniqueVar); + $getValue[$matchName] = $this->getValueScript( + $condition['match_type'], + $condition['match_name'], + $condition['match_extends'], $uniqueVar + ); // get the options - $options = $this->getOptionsScript($condition['match_type'], $condition['match_options']); + $options = $this->getOptionsScript( + $condition['match_type'], + $condition['match_options'] + ); // set the if values - $ifValue[$matchName] = $this->ifValueScript($matchName, $condition['match_behavior'], $condition['match_type'], $options); + $ifValue[$matchName] = $this->ifValueScript( + $matchName, $condition['match_behavior'], + $condition['match_type'], $options + ); // set the target controls - $targetControls[$matchName] = $this->setTargetControlsScript($toggleSwitch[$matchName], $condition['target_field'], $targetBehavior, $targetDefault, $uniqueVar, $viewName); + $targetControls[$matchName] + = $this->setTargetControlsScript( + $toggleSwitch[$matchName], + $condition['target_field'], $targetBehavior, + $targetDefault, $uniqueVar, $viewName + ); foreach ($relations as $relation) { - if (ComponentbuilderHelper::checkString($relation['match_name'])) + if (ComponentbuilderHelper::checkString( + $relation['match_name'] + )) { - $relationName = $relation['match_name'] . '_' . $uniqueVar; + $relationName = $relation['match_name'] + . '_' . $uniqueVar; // set the type buket - $typeBuket[$relationName] = $relation['match_type']; + $typeBuket[$relationName] + = $relation['match_type']; // set function array $functions[$uniqueVar][] = $relationName; - $matchNames[$relationName] = $relation['match_name']; + $matchNames[$relationName] + = $relation['match_name']; // get the relation option - $relationOptions = $this->getOptionsScript($relation['match_type'], $relation['match_options']); - $getValue[$relationName] = $this->getValueScript($relation['match_type'], $relation['match_name'], $condition['match_extends'], $uniqueVar); - $ifValue[$relationName] = $this->ifValueScript($relationName, $relation['match_behavior'], $relation['match_type'], $relationOptions); + $relationOptions = $this->getOptionsScript( + $relation['match_type'], + $relation['match_options'] + ); + $getValue[$relationName] + = $this->getValueScript( + $relation['match_type'], + $relation['match_name'], + $condition['match_extends'], $uniqueVar + ); + $ifValue[$relationName] + = $this->ifValueScript( + $relationName, + $relation['match_behavior'], + $relation['match_type'], + $relationOptions + ); } } } @@ -9872,39 +14988,60 @@ class Interpretation extends Fields { // set behavior and default array $behaviors[$matchName] = $targetBehavior; - $defaults[$matchName] = $targetDefault; - $toggleSwitch[$matchName] = ($condition['target_behavior'] == 1 || $condition['target_behavior'] == 2) ? true : false; + $defaults[$matchName] = $targetDefault; + $toggleSwitch[$matchName] + = ($condition['target_behavior'] + == 1 + || $condition['target_behavior'] == 2) ? true + : false; // set the type buket $typeBuket[$matchName] = $condition['match_type']; // set function array $functions[$uniqueVar][0] = $matchName; - $matchNames[$matchName] = $condition['match_name']; + $matchNames[$matchName] = $condition['match_name']; // get the select value - $getValue[$matchName] = $this->getValueScript($condition['match_type'], $condition['match_name'], $condition['match_extends'], $uniqueVar); + $getValue[$matchName] = $this->getValueScript( + $condition['match_type'], $condition['match_name'], + $condition['match_extends'], $uniqueVar + ); // get the options - $options = $this->getOptionsScript($condition['match_type'], $condition['match_options']); + $options = $this->getOptionsScript( + $condition['match_type'], + $condition['match_options'] + ); // set the if values - $ifValue[$matchName] = $this->ifValueScript($matchName, $condition['match_behavior'], $condition['match_type'], $options); + $ifValue[$matchName] = $this->ifValueScript( + $matchName, $condition['match_behavior'], + $condition['match_type'], $options + ); // set the target controls - $targetControls[$matchName] = $this->setTargetControlsScript($toggleSwitch[$matchName], $condition['target_field'], $targetBehavior, $targetDefault, $uniqueVar, $viewName); + $targetControls[$matchName] + = $this->setTargetControlsScript( + $toggleSwitch[$matchName], + $condition['target_field'], $targetBehavior, + $targetDefault, $uniqueVar, $viewName + ); } } } // reset buckets - $initial = ''; - $func = ''; + $initial = ''; + $func = ''; $validation = ''; - $isSet = ''; - $listener = ''; + $isSet = ''; + $listener = ''; if (ComponentbuilderHelper::checkArray($functions)) { // now build the initial script - $initial .= "//" . $this->setLine(__LINE__) . " Initial Script" . PHP_EOL . "jQuery(document).ready(function()"; + $initial .= "//" . $this->setLine(__LINE__) . " Initial Script" + . PHP_EOL . "jQuery(document).ready(function()"; $initial .= PHP_EOL . "{"; foreach ($functions as $function => $matchKeys) { - $func_call = $this->buildFunctionCall($function, $matchKeys, $getValue); - $initial .= $func_call['code']; + $func_call = $this->buildFunctionCall( + $function, $matchKeys, $getValue + ); + $initial .= $func_call['code']; } $initial .= "});" . PHP_EOL; // for modal fields @@ -9915,29 +15052,50 @@ class Interpretation extends Fields $funcCall = ''; foreach ($l_matchKeys as $l_matchKey) { - $name = $matchNames[$l_matchKey]; + $name = $matchNames[$l_matchKey]; $matchTypeKey = $typeBuket[$l_matchKey]; - $funcCall = $this->buildFunctionCall($l_function, $l_matchKeys, $getValue); + $funcCall = $this->buildFunctionCall( + $l_function, $l_matchKeys, $getValue + ); - if (isset($this->setScriptMediaSwitch) && ComponentbuilderHelper::checkArray($this->setScriptMediaSwitch) && in_array($matchTypeKey, $this->setScriptMediaSwitch)) + if (isset($this->setScriptMediaSwitch) + && ComponentbuilderHelper::checkArray( + $this->setScriptMediaSwitch + ) + && in_array( + $matchTypeKey, $this->setScriptMediaSwitch + )) { $modal .= $funcCall['code']; } else { - if (isset($this->setScriptUserSwitch) && ComponentbuilderHelper::checkArray($this->setScriptUserSwitch) && in_array($matchTypeKey, $this->setScriptUserSwitch)) + if (isset($this->setScriptUserSwitch) + && ComponentbuilderHelper::checkArray( + $this->setScriptUserSwitch + ) + && in_array( + $matchTypeKey, $this->setScriptUserSwitch + )) { $name = $name . '_id'; } - $listener .= PHP_EOL . "//" . $this->setLine(__LINE__) . " #jform_" . $name . " listeners for " . $l_matchKey . " function"; - $listener .= PHP_EOL . "jQuery('#jform_" . $name . "').on('keyup',function()"; + $listener .= PHP_EOL . "//" . $this->setLine( + __LINE__ + ) . " #jform_" . $name . " listeners for " + . $l_matchKey . " function"; + $listener .= PHP_EOL . "jQuery('#jform_" . $name + . "').on('keyup',function()"; $listener .= PHP_EOL . "{"; $listener .= $funcCall['code']; $listener .= PHP_EOL . "});"; - $listener .= PHP_EOL . "jQuery('#adminForm').on('change', '#jform_" . $name . "',function (e)"; + $listener .= PHP_EOL + . "jQuery('#adminForm').on('change', '#jform_" + . $name . "',function (e)"; $listener .= PHP_EOL . "{"; - $listener .= PHP_EOL . $this->_t(1) . "e.preventDefault();"; + $listener .= PHP_EOL . $this->_t(1) + . "e.preventDefault();"; $listener .= $funcCall['code']; $listener .= PHP_EOL . "});" . PHP_EOL; } @@ -9960,14 +15118,17 @@ class Interpretation extends Fields $map = ''; // does this function require an array $addArray = false; - $func_ = $this->buildFunctionCall($f_function, $f_matchKeys, $getValue); + $func_ = $this->buildFunctionCall( + $f_function, $f_matchKeys, $getValue + ); // set array switch if ($func_['array']) { $addArray = true; } - $func .= PHP_EOL . "//" . $this->setLine(__LINE__) . " the " . $f_function . " function"; - $func .= PHP_EOL . "function " . $f_function . "("; + $func .= PHP_EOL . "//" . $this->setLine(__LINE__) + . " the " . $f_function . " function"; + $func .= PHP_EOL . "function " . $f_function . "("; $fucounter = 0; foreach ($f_matchKeys as $fu_matchKey) { @@ -9991,19 +15152,37 @@ class Interpretation extends Fields foreach ($f_matchKeys as $a_matchKey) { $name = $matchNames[$a_matchKey]; - $func .= PHP_EOL . $this->_t(1) . "if (isSet(" . $a_matchKey . ") && " . $a_matchKey . ".constructor !== Array)" . PHP_EOL . $this->_t(1) . "{" . PHP_EOL . $this->_t(2) . "var temp_" . $f_function . " = " . $a_matchKey . ";" . PHP_EOL . $this->_t(2) . "var " . $a_matchKey . " = [];" . PHP_EOL . $this->_t(2) . $a_matchKey . ".push(temp_" . $f_function . ");" . PHP_EOL . $this->_t(1) . "}"; - $func .= PHP_EOL . $this->_t(1) . "else if (!isSet(" . $a_matchKey . "))" . PHP_EOL . $this->_t(1) . "{"; - $func .= PHP_EOL . $this->_t(2) . "var " . $a_matchKey . " = [];"; + $func .= PHP_EOL . $this->_t(1) . "if (isSet(" + . $a_matchKey . ") && " . $a_matchKey + . ".constructor !== Array)" . PHP_EOL + . $this->_t(1) . "{" . PHP_EOL . $this->_t(2) + . "var temp_" . $f_function . " = " + . $a_matchKey . ";" . PHP_EOL . $this->_t(2) + . "var " . $a_matchKey . " = [];" . PHP_EOL + . $this->_t(2) . $a_matchKey . ".push(temp_" + . $f_function . ");" . PHP_EOL . $this->_t(1) + . "}"; + $func .= PHP_EOL . $this->_t(1) . "else if (!isSet(" + . $a_matchKey . "))" . PHP_EOL . $this->_t(1) + . "{"; + $func .= PHP_EOL . $this->_t(2) . "var " + . $a_matchKey . " = [];"; $func .= PHP_EOL . $this->_t(1) . "}"; - $func .= PHP_EOL . $this->_t(1) . "var " . $name . " = " . $a_matchKey . ".some(" . $a_matchKey . "_SomeFunc);" . PHP_EOL; + $func .= PHP_EOL . $this->_t(1) . "var " . $name + . " = " . $a_matchKey . ".some(" . $a_matchKey + . "_SomeFunc);" . PHP_EOL; // setup the map function - $map .= PHP_EOL . "//" . $this->setLine(__LINE__) . " the " . $f_function . " Some function"; - $map .= PHP_EOL . "function " . $a_matchKey . "_SomeFunc(" . $a_matchKey . ")"; + $map .= PHP_EOL . "//" . $this->setLine(__LINE__) + . " the " . $f_function . " Some function"; + $map .= PHP_EOL . "function " . $a_matchKey + . "_SomeFunc(" . $a_matchKey . ")"; $map .= PHP_EOL . "{"; - $map .= PHP_EOL . $this->_t(1) . "//" . $this->setLine(__LINE__) . " set the function logic"; + $map .= PHP_EOL . $this->_t(1) . "//" + . $this->setLine(__LINE__) + . " set the function logic"; $map .= PHP_EOL . $this->_t(1) . "if ("; - $if = $ifValue[$a_matchKey]; + $if = $ifValue[$a_matchKey]; if (ComponentbuilderHelper::checkString($if)) { $map .= $if; @@ -10011,10 +15190,13 @@ class Interpretation extends Fields $map .= ")"; $map .= PHP_EOL . $this->_t(1) . "{"; $map .= PHP_EOL . $this->_t(2) . "return true;"; - $map .= PHP_EOL . $this->_t(1) . "}" . PHP_EOL . $this->_t(1) . "return false;"; + $map .= PHP_EOL . $this->_t(1) . "}" . PHP_EOL + . $this->_t(1) . "return false;"; $map .= PHP_EOL . "}" . PHP_EOL; } - $func .= PHP_EOL . PHP_EOL . $this->_t(1) . "//" . $this->setLine(__LINE__) . " set this function logic"; + $func .= PHP_EOL . PHP_EOL . $this->_t(1) . "//" + . $this->setLine(__LINE__) + . " set this function logic"; $func .= PHP_EOL . $this->_t(1) . "if ("; // set if counter $aifcounter = 0; @@ -10035,7 +15217,9 @@ class Interpretation extends Fields } else { - $func .= PHP_EOL . $this->_t(1) . "//" . $this->setLine(__LINE__) . " set the function logic"; + $func .= PHP_EOL . $this->_t(1) . "//" . $this->setLine( + __LINE__ + ) . " set the function logic"; $func .= PHP_EOL . $this->_t(1) . "if ("; // set if counter $ifcounter = 0; @@ -10061,12 +15245,14 @@ class Interpretation extends Fields $controls = $targetControls[$f_matchKeys[0]]; // get target behavior and default $targetBehavior = $behaviors[$f_matchKeys[0]]; - $targetDefault = $defaults[$f_matchKeys[0]]; + $targetDefault = $defaults[$f_matchKeys[0]]; // load the target behavior foreach ($controls as $target => $action) { $func .= $action['behavior']; - if (ComponentbuilderHelper::checkString($action[$targetBehavior])) + if (ComponentbuilderHelper::checkString( + $action[$targetBehavior] + )) { $func .= $action[$targetBehavior]; $head .= $action['requiredVar']; @@ -10075,56 +15261,84 @@ class Interpretation extends Fields // check if this is a toggle switch if ($toggleSwitch[$f_matchKeys[0]]) { - $func .= PHP_EOL . $this->_t(1) . "}" . PHP_EOL . $this->_t(1) . "else" . PHP_EOL . $this->_t(1) . "{"; + $func .= PHP_EOL . $this->_t(1) . "}" . PHP_EOL + . $this->_t(1) . "else" . PHP_EOL . $this->_t(1) + . "{"; // load the default behavior foreach ($controls as $target => $action) { $func .= $action['default']; - if (ComponentbuilderHelper::checkString($action[$targetDefault])) + if (ComponentbuilderHelper::checkString( + $action[$targetDefault] + )) { $func .= $action[$targetDefault]; } } } - $func .= PHP_EOL . $this->_t(1) . "}" . PHP_EOL . "}" . PHP_EOL . $map; + $func .= PHP_EOL . $this->_t(1) . "}" . PHP_EOL . "}" + . PHP_EOL . $map; } // add the needed validation to file - if (isset($this->validationFixBuilder[$viewName]) && ComponentbuilderHelper::checkArray($this->validationFixBuilder[$viewName])) + if (isset($this->validationFixBuilder[$viewName]) + && ComponentbuilderHelper::checkArray( + $this->validationFixBuilder[$viewName] + )) { $validation .= PHP_EOL . "// update fields required"; - $validation .= PHP_EOL . "function updateFieldRequired(name, status) {"; - $validation .= PHP_EOL . $this->_t(1) . "// check if not_required exist"; - $validation .= PHP_EOL . $this->_t(1) . "if (jQuery('#jform_not_required').length > 0) {"; - $validation .= PHP_EOL . $this->_t(2) . "var not_required = jQuery('#jform_not_required').val().split(\",\");"; - $validation .= PHP_EOL . PHP_EOL . $this->_t(2) . "if(status == 1)"; + $validation .= PHP_EOL + . "function updateFieldRequired(name, status) {"; + $validation .= PHP_EOL . $this->_t(1) + . "// check if not_required exist"; + $validation .= PHP_EOL . $this->_t(1) + . "if (jQuery('#jform_not_required').length > 0) {"; + $validation .= PHP_EOL . $this->_t(2) + . "var not_required = jQuery('#jform_not_required').val().split(\",\");"; + $validation .= PHP_EOL . PHP_EOL . $this->_t(2) + . "if(status == 1)"; $validation .= PHP_EOL . $this->_t(2) . "{"; - $validation .= PHP_EOL . $this->_t(3) . "not_required.push(name);"; + $validation .= PHP_EOL . $this->_t(3) + . "not_required.push(name);"; $validation .= PHP_EOL . $this->_t(2) . "}"; $validation .= PHP_EOL . $this->_t(2) . "else"; $validation .= PHP_EOL . $this->_t(2) . "{"; - $validation .= PHP_EOL . $this->_t(3) . "not_required = removeFieldFromNotRequired(not_required, name);"; + $validation .= PHP_EOL . $this->_t(3) + . "not_required = removeFieldFromNotRequired(not_required, name);"; $validation .= PHP_EOL . $this->_t(2) . "}"; - $validation .= PHP_EOL . PHP_EOL . $this->_t(2) . "jQuery('#jform_not_required').val(fixNotRequiredArray(not_required).toString());"; + $validation .= PHP_EOL . PHP_EOL . $this->_t(2) + . "jQuery('#jform_not_required').val(fixNotRequiredArray(not_required).toString());"; $validation .= PHP_EOL . $this->_t(1) . "}"; $validation .= PHP_EOL . "}" . PHP_EOL; - $validation .= PHP_EOL . "// remove field from not_required"; - $validation .= PHP_EOL . "function removeFieldFromNotRequired(array, what) {"; - $validation .= PHP_EOL . $this->_t(1) . "return array.filter(function(element){"; - $validation .= PHP_EOL . $this->_t(2) . "return element !== what;"; + $validation .= PHP_EOL + . "// remove field from not_required"; + $validation .= PHP_EOL + . "function removeFieldFromNotRequired(array, what) {"; + $validation .= PHP_EOL . $this->_t(1) + . "return array.filter(function(element){"; + $validation .= PHP_EOL . $this->_t(2) + . "return element !== what;"; $validation .= PHP_EOL . $this->_t(1) . "});"; $validation .= PHP_EOL . "}" . PHP_EOL; $validation .= PHP_EOL . "// fix not required array"; - $validation .= PHP_EOL . "function fixNotRequiredArray(array) {"; + $validation .= PHP_EOL + . "function fixNotRequiredArray(array) {"; $validation .= PHP_EOL . $this->_t(1) . "var seen = {};"; - $validation .= PHP_EOL . $this->_t(1) . "return removeEmptyFromNotRequiredArray(array).filter(function(item) {"; - $validation .= PHP_EOL . $this->_t(2) . "return seen.hasOwnProperty(item) ? false : (seen[item] = true);"; + $validation .= PHP_EOL . $this->_t(1) + . "return removeEmptyFromNotRequiredArray(array).filter(function(item) {"; + $validation .= PHP_EOL . $this->_t(2) + . "return seen.hasOwnProperty(item) ? false : (seen[item] = true);"; $validation .= PHP_EOL . $this->_t(1) . "});"; $validation .= PHP_EOL . "}" . PHP_EOL; - $validation .= PHP_EOL . "// remove empty from not_required array"; - $validation .= PHP_EOL . "function removeEmptyFromNotRequiredArray(array) {"; - $validation .= PHP_EOL . $this->_t(1) . "return array.filter(function (el) {"; - $validation .= PHP_EOL . $this->_t(2) . "// remove ( 一_一) as well - lol"; - $validation .= PHP_EOL . $this->_t(2) . "return (el.length > 0 && '一_一' !== el);"; + $validation .= PHP_EOL + . "// remove empty from not_required array"; + $validation .= PHP_EOL + . "function removeEmptyFromNotRequiredArray(array) {"; + $validation .= PHP_EOL . $this->_t(1) + . "return array.filter(function (el) {"; + $validation .= PHP_EOL . $this->_t(2) + . "// remove ( 一_一) as well - lol"; + $validation .= PHP_EOL . $this->_t(2) + . "return (el.length > 0 && '一_一' !== el);"; $validation .= PHP_EOL . $this->_t(1) . "});"; $validation .= PHP_EOL . "}" . PHP_EOL; } @@ -10132,14 +15346,15 @@ class Interpretation extends Fields $isSet = PHP_EOL . "// the isSet function"; $isSet .= PHP_EOL . "function isSet(val)"; $isSet .= PHP_EOL . "{"; - $isSet .= PHP_EOL . $this->_t(1) . "if ((val != undefined) && (val != null) && 0 !== val.length){"; + $isSet .= PHP_EOL . $this->_t(1) + . "if ((val != undefined) && (val != null) && 0 !== val.length){"; $isSet .= PHP_EOL . $this->_t(2) . "return true;"; $isSet .= PHP_EOL . $this->_t(1) . "}"; $isSet .= PHP_EOL . $this->_t(1) . "return false;"; $isSet .= PHP_EOL . "}"; } // load to this buket - $fileScript = $initial . $func . $validation . $isSet; + $fileScript = $initial . $func . $validation . $isSet; $footerScript = $listener; } // add custom script to edit form JS file @@ -10147,11 +15362,19 @@ class Interpretation extends Fields { $fileScript = ''; } - $fileScript .= $this->getCustomScriptBuilder('view_file', $viewName, PHP_EOL . PHP_EOL, null, true, ''); + $fileScript .= $this->getCustomScriptBuilder( + 'view_file', $viewName, PHP_EOL . PHP_EOL, null, true, '' + ); // add custom script to footer - if (isset($this->customScriptBuilder['view_footer'][$viewName]) && ComponentbuilderHelper::checkString($this->customScriptBuilder['view_footer'][$viewName])) + if (isset($this->customScriptBuilder['view_footer'][$viewName]) + && ComponentbuilderHelper::checkString( + $this->customScriptBuilder['view_footer'][$viewName] + )) { - $customFooterScript = PHP_EOL . PHP_EOL . $this->setPlaceholders($this->customScriptBuilder['view_footer'][$viewName], $this->placeholders); + $customFooterScript = PHP_EOL . PHP_EOL . $this->setPlaceholders( + $this->customScriptBuilder['view_footer'][$viewName], + $this->placeholders + ); if (strpos($customFooterScript, 'name_list); + $viewName_list = ComponentbuilderHelper::safeString( + $viewArray['settings']->name_list + ); // add custom script to list view JS file - if (($list_fileScript = $this->getCustomScriptBuilder('views_file', $viewName, PHP_EOL . PHP_EOL, null, true, false)) !== false && - ComponentbuilderHelper::checkString($list_fileScript)) + if (($list_fileScript = $this->getCustomScriptBuilder( + 'views_file', $viewName, PHP_EOL . PHP_EOL, null, true, false + )) !== false + && ComponentbuilderHelper::checkString($list_fileScript)) { // get dates - $_created = $this->getCreatedDate($viewArray); + $_created = $this->getCreatedDate($viewArray); $_modified = $this->getLastModifiedDate($viewArray); // add file to view $_target = array($this->target => $viewName_list); - $_config = array($this->hhh . 'CREATIONDATE' . $this->hhh => $_created, $this->hhh . 'BUILDDATE' . $this->hhh => $_modified, $this->hhh . 'VERSION' . $this->hhh => $viewArray['settings']->version); + $_config = array($this->hhh . 'CREATIONDATE' + . $this->hhh => $_created, + $this->hhh . 'BUILDDATE' + . $this->hhh => $_modified, + $this->hhh . 'VERSION' + . $this->hhh => $viewArray['settings']->version); $this->buildDynamique($_target, 'javascript_file', false, $_config); // set path - $_path = '/administrator/components/com_' . $this->componentCodeName . '/assets/js/' . $viewName_list . '.js'; + $_path = '/administrator/components/com_' . $this->componentCodeName + . '/assets/js/' . $viewName_list . '.js'; // load the file to the list view - $this->fileContentDynamic[$viewName_list][$this->hhh . 'ADMIN_ADD_JAVASCRIPT_FILE' . $this->hhh] = PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add List View JavaScript File" . PHP_EOL . $this->_t(2) . $this->setIncludeLibScript($_path); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'ADMIN_ADD_JAVASCRIPT_FILE' . $this->hhh] + = PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Add List View JavaScript File" . PHP_EOL . $this->_t(2) + . $this->setIncludeLibScript($_path); } else { $list_fileScript = ''; - $this->fileContentDynamic[$viewName_list][$this->hhh . 'ADMIN_ADD_JAVASCRIPT_FILE' . $this->hhh] = ''; + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'ADMIN_ADD_JAVASCRIPT_FILE' . $this->hhh] + = ''; } // minfy the script - if ($this->minify && isset($list_fileScript) && ComponentbuilderHelper::checkString($list_fileScript)) + if ($this->minify && isset($list_fileScript) + && ComponentbuilderHelper::checkString($list_fileScript)) { // minify the fielScript javscript $minifier = new JS; @@ -10195,7 +15436,8 @@ class Interpretation extends Fields $list_fileScript = $minifier->minify(); } // minfy the script - if ($this->minify && isset($fileScript) && ComponentbuilderHelper::checkString($fileScript)) + if ($this->minify && isset($fileScript) + && ComponentbuilderHelper::checkString($fileScript)) { // minify the fielScript javscript $minifier = new JS; @@ -10203,7 +15445,8 @@ class Interpretation extends Fields $fileScript = $minifier->minify(); } // minfy the script - if ($this->minify && isset($footerScript) && ComponentbuilderHelper::checkString($footerScript)) + if ($this->minify && isset($footerScript) + && ComponentbuilderHelper::checkString($footerScript)) { // minify the footerScript javscript $minifier = new JS; @@ -10211,24 +15454,35 @@ class Interpretation extends Fields $footerScript = $minifier->minify(); } // make sure there is script to add - if (isset($list_fileScript) && ComponentbuilderHelper::checkString($list_fileScript)) + if (isset($list_fileScript) + && ComponentbuilderHelper::checkString( + $list_fileScript + )) { // load the script - $this->viewScriptBuilder[$viewName_list]['list_fileScript'] = $list_fileScript; + $this->viewScriptBuilder[$viewName_list]['list_fileScript'] + = $list_fileScript; } // make sure there is script to add - if (isset($fileScript) && ComponentbuilderHelper::checkString($fileScript)) + if (isset($fileScript) + && ComponentbuilderHelper::checkString( + $fileScript + )) { // add the head script if set if (isset($head) && ComponentbuilderHelper::checkString($head)) { - $fileScript = "// Some Global Values" . PHP_EOL . $head . PHP_EOL . $fileScript; + $fileScript = "// Some Global Values" . PHP_EOL . $head + . PHP_EOL . $fileScript; } // load the script $this->viewScriptBuilder[$viewName]['fileScript'] = $fileScript; } // make sure to add custom footer script if php was found in it, since we canot minfy it with php - if (isset($customFooterScript) && ComponentbuilderHelper::checkString($customFooterScript)) + if (isset($customFooterScript) + && ComponentbuilderHelper::checkString( + $customFooterScript + )) { if (!isset($footerScript)) { @@ -10237,31 +15491,36 @@ class Interpretation extends Fields $footerScript .= $customFooterScript; } // make sure there is script to add - if (isset($footerScript) && ComponentbuilderHelper::checkString($footerScript)) + if (isset($footerScript) + && ComponentbuilderHelper::checkString( + $footerScript + )) { // add the needed script tags - $footerScript = PHP_EOL . PHP_EOL . '"; + $footerScript = PHP_EOL + . PHP_EOL . '"; $this->viewScriptBuilder[$viewName]['footerScript'] = $footerScript; } } public function buildFunctionCall($function, $matchKeys, $getValue) { - $initial = ''; + $initial = ''; $funcsets = array(); - $array = false; + $array = false; foreach ($matchKeys as $matchKey) { $value = $getValue[$matchKey]; if ($value['isArray']) { - $initial .= PHP_EOL . $this->_t(1) . $value['get']; + $initial .= PHP_EOL . $this->_t(1) . $value['get']; $funcsets[] = $matchKey; - $array = true; + $array = true; } else { - $initial .= PHP_EOL . $this->_t(1) . $value['get']; + $initial .= PHP_EOL . $this->_t(1) . $value['get']; $funcsets[] = $matchKey; } } @@ -10273,6 +15532,7 @@ class Interpretation extends Fields $initial .= implode(',', $funcsets); $initial .= ");" . PHP_EOL; } + return array('code' => $initial, 'array' => $array); } @@ -10283,7 +15543,8 @@ class Interpretation extends Fields // convert to name array foreach ($condition['target_field'] as $targetField) { - if (ComponentbuilderHelper::checkArray($targetField) && isset($targetField['name'])) + if (ComponentbuilderHelper::checkArray($targetField) + && isset($targetField['name'])) { $currentTargets[] = $targetField['name']; } @@ -10294,17 +15555,26 @@ class Interpretation extends Fields // reset found $found = false; // chain only none matching fields - if ($relation['match_field'] !== $condition['match_field'] && $relation['target_relation']) // Made this change to see if it improves the expected result (TODO) + if ($relation['match_field'] !== $condition['match_field'] + && $relation['target_relation']) // Made this change to see if it improves the expected result (TODO) { - if (ComponentbuilderHelper::checkArray($relation['target_field'])) + if (ComponentbuilderHelper::checkArray( + $relation['target_field'] + )) { foreach ($relation['target_field'] as $target) { - if (ComponentbuilderHelper::checkArray($target) && $this->checkRelationControl($target['name'], $relation['match_name'], $condition['match_name'], $view)) + if (ComponentbuilderHelper::checkArray($target) + && $this->checkRelationControl( + $target['name'], $relation['match_name'], + $condition['match_name'], $view + )) { if (in_array($target['name'], $currentTargets)) { - $this->targetRelationControl[$view][$target['name']] = array($relation['match_name'], $condition['match_name']); + $this->targetRelationControl[$view][$target['name']] + = array($relation['match_name'], + $condition['match_name']); $found = true; break; } @@ -10317,16 +15587,31 @@ class Interpretation extends Fields } } } + return $buket; } - public function checkRelationControl($targetName, $relationMatchName, $conditionMatchName, $view) - { - if (isset($this->targetRelationControl[$view]) && ComponentbuilderHelper::checkArray($this->targetRelationControl[$view])) + public function checkRelationControl($targetName, $relationMatchName, + $conditionMatchName, $view + ) { + if (isset($this->targetRelationControl[$view]) + && ComponentbuilderHelper::checkArray( + $this->targetRelationControl[$view] + )) { - if (isset($this->targetRelationControl[$view][$targetName]) && ComponentbuilderHelper::checkArray($this->targetRelationControl[$view][$targetName])) + if (isset($this->targetRelationControl[$view][$targetName]) + && ComponentbuilderHelper::checkArray( + $this->targetRelationControl[$view][$targetName] + )) { - if (!in_array($relationMatchName, $this->targetRelationControl[$view][$targetName]) || !in_array($conditionMatchName, $this->targetRelationControl[$view][$targetName])) + if (!in_array( + $relationMatchName, + $this->targetRelationControl[$view][$targetName] + ) + || !in_array( + $conditionMatchName, + $this->targetRelationControl[$view][$targetName] + )) { return true; } @@ -10336,17 +15621,25 @@ class Interpretation extends Fields return true; } } - elseif (!isset($this->targetRelationControl[$view]) || !ComponentbuilderHelper::checkArray($this->targetRelationControl[$view])) + elseif (!isset($this->targetRelationControl[$view]) + || !ComponentbuilderHelper::checkArray( + $this->targetRelationControl[$view] + )) { return true; } + return false; } - public function setTargetControlsScript($toggleSwitch, $targets, $targetBehavior, $targetDefault, $uniqueVar, $viewName) - { + public function setTargetControlsScript($toggleSwitch, $targets, + $targetBehavior, $targetDefault, $uniqueVar, $viewName + ) { $bucket = array(); - if (ComponentbuilderHelper::checkArray($targets) && !in_array($uniqueVar, $this->targetControlsScriptChecker)) + if (ComponentbuilderHelper::checkArray($targets) + && !in_array( + $uniqueVar, $this->targetControlsScriptChecker + )) { foreach ($targets as $target) { @@ -10355,8 +15648,10 @@ class Interpretation extends Fields // set the required var if ($target['required'] === 'yes') { - $unique = $uniqueVar . $this->uniquekey(3); - $bucket[$target['name']]['requiredVar'] = "jform_" . $unique . "_required = false;" . PHP_EOL; + $unique = $uniqueVar + . $this->uniquekey(3); + $bucket[$target['name']]['requiredVar'] = "jform_" + . $unique . "_required = false;" . PHP_EOL; } else { @@ -10364,12 +15659,15 @@ class Interpretation extends Fields } // set target type $targetTypeSufix = ""; - if (ComponentbuilderHelper::fieldCheck($target['type'], 'spacer')) + if (ComponentbuilderHelper::fieldCheck( + $target['type'], 'spacer' + )) { // target a class if this is a note or spacer $targetType = "."; } - elseif ($target['type'] === 'editor' || $target['type'] === 'subform') + elseif ($target['type'] === 'editor' + || $target['type'] === 'subform') { // target the label if editor field $targetType = "#jform_"; @@ -10382,56 +15680,134 @@ class Interpretation extends Fields $targetType = "#jform_"; } // set the target behavior - $bucket[$target['name']]['behavior'] = PHP_EOL . $this->_t(2) . "jQuery('" . $targetType . $target['name'] . $targetTypeSufix . "').closest('.control-group')." . $targetBehavior . "();"; + $bucket[$target['name']]['behavior'] = PHP_EOL . $this->_t( + 2 + ) . "jQuery('" . $targetType . $target['name'] + . $targetTypeSufix . "').closest('.control-group')." + . $targetBehavior . "();"; // set the target default - $bucket[$target['name']]['default'] = PHP_EOL . $this->_t(2) . "jQuery('" . $targetType . $target['name'] . $targetTypeSufix . "').closest('.control-group')." . $targetDefault . "();"; + $bucket[$target['name']]['default'] = PHP_EOL . $this->_t(2) + . "jQuery('" . $targetType . $target['name'] + . $targetTypeSufix . "').closest('.control-group')." + . $targetDefault . "();"; // the hide required function if ($target['required'] === 'yes') { if ($toggleSwitch) { - $hide = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " remove required attribute from " . $target['name'] . " field"; - $hide .= PHP_EOL . $this->_t(2) . "if (!jform_" . $unique . "_required)"; - $hide .= PHP_EOL . $this->_t(2) . "{"; - $hide .= PHP_EOL . $this->_t(3) . "updateFieldRequired('" . $target['name'] . "',1);"; - $hide .= PHP_EOL . $this->_t(3) . "jQuery('#jform_" . $target['name'] . "').removeAttr('required');"; - $hide .= PHP_EOL . $this->_t(3) . "jQuery('#jform_" . $target['name'] . "').removeAttr('aria-required');"; - $hide .= PHP_EOL . $this->_t(3) . "jQuery('#jform_" . $target['name'] . "').removeClass('required');"; - $hide .= PHP_EOL . $this->_t(3) . "jform_" . $unique . "_required = true;"; - $hide .= PHP_EOL . $this->_t(2) . "}"; + $hide = PHP_EOL + . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " remove required attribute from " + . $target['name'] . " field"; + $hide .= PHP_EOL + . $this->_t(2) . "if (!jform_" . $unique + . "_required)"; + $hide .= PHP_EOL + . $this->_t(2) . "{"; + $hide .= PHP_EOL + . $this->_t(3) . "updateFieldRequired('" + . $target['name'] . "',1);"; + $hide .= PHP_EOL + . $this->_t(3) . "jQuery('#jform_" + . $target['name'] + . "').removeAttr('required');"; + $hide .= PHP_EOL + . $this->_t(3) . "jQuery('#jform_" + . $target['name'] + . "').removeAttr('aria-required');"; + $hide .= PHP_EOL + . $this->_t(3) . "jQuery('#jform_" + . $target['name'] + . "').removeClass('required');"; + $hide .= PHP_EOL + . $this->_t(3) . "jform_" . $unique + . "_required = true;"; + $hide .= PHP_EOL + . $this->_t(2) . "}"; $bucket[$target['name']]['hide'] = $hide; // the show required function - $show = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " add required attribute to " . $target['name'] . " field"; - $show .= PHP_EOL . $this->_t(2) . "if (jform_" . $unique . "_required)"; - $show .= PHP_EOL . $this->_t(2) . "{"; - $show .= PHP_EOL . $this->_t(3) . "updateFieldRequired('" . $target['name'] . "',0);"; - $show .= PHP_EOL . $this->_t(3) . "jQuery('#jform_" . $target['name'] . "').prop('required','required');"; - $show .= PHP_EOL . $this->_t(3) . "jQuery('#jform_" . $target['name'] . "').attr('aria-required',true);"; - $show .= PHP_EOL . $this->_t(3) . "jQuery('#jform_" . $target['name'] . "').addClass('required');"; - $show .= PHP_EOL . $this->_t(3) . "jform_" . $unique . "_required = false;"; - $show .= PHP_EOL . $this->_t(2) . "}"; + $show = PHP_EOL + . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " add required attribute to " + . $target['name'] . " field"; + $show .= PHP_EOL + . $this->_t(2) . "if (jform_" . $unique + . "_required)"; + $show .= PHP_EOL + . $this->_t(2) . "{"; + $show .= PHP_EOL + . $this->_t(3) . "updateFieldRequired('" + . $target['name'] . "',0);"; + $show .= PHP_EOL + . $this->_t(3) . "jQuery('#jform_" + . $target['name'] + . "').prop('required','required');"; + $show .= PHP_EOL + . $this->_t(3) . "jQuery('#jform_" + . $target['name'] + . "').attr('aria-required',true);"; + $show .= PHP_EOL + . $this->_t(3) . "jQuery('#jform_" + . $target['name'] . "').addClass('required');"; + $show .= PHP_EOL + . $this->_t(3) . "jform_" . $unique + . "_required = false;"; + $show .= PHP_EOL + . $this->_t(2) . "}"; $bucket[$target['name']]['show'] = $show; } else { - $hide = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " remove required attribute from " . $target['name'] . " field"; - $hide .= PHP_EOL . $this->_t(2) . "updateFieldRequired('" . $target['name'] . "',1);"; - $hide .= PHP_EOL . $this->_t(2) . "jQuery('#jform_" . $target['name'] . "').removeAttr('required');"; - $hide .= PHP_EOL . $this->_t(2) . "jQuery('#jform_" . $target['name'] . "').removeAttr('aria-required');"; - $hide .= PHP_EOL . $this->_t(2) . "jQuery('#jform_" . $target['name'] . "').removeClass('required');"; - $hide .= PHP_EOL . $this->_t(2) . "jform_" . $unique . "_required = true;" . PHP_EOL; + $hide = PHP_EOL + . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " remove required attribute from " + . $target['name'] . " field"; + $hide .= PHP_EOL + . $this->_t(2) . "updateFieldRequired('" + . $target['name'] . "',1);"; + $hide .= PHP_EOL + . $this->_t(2) . "jQuery('#jform_" + . $target['name'] + . "').removeAttr('required');"; + $hide .= PHP_EOL + . $this->_t(2) . "jQuery('#jform_" + . $target['name'] + . "').removeAttr('aria-required');"; + $hide .= PHP_EOL + . $this->_t(2) . "jQuery('#jform_" + . $target['name'] + . "').removeClass('required');"; + $hide .= PHP_EOL + . $this->_t(2) . "jform_" . $unique + . "_required = true;" . PHP_EOL; $bucket[$target['name']]['hide'] = $hide; // the show required function - $show = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " add required attribute to " . $target['name'] . " field"; - $show .= PHP_EOL . $this->_t(2) . "updateFieldRequired('" . $target['name'] . "',0);"; - $show .= PHP_EOL . $this->_t(2) . "jQuery('#jform_" . $target['name'] . "').prop('required','required');"; - $show .= PHP_EOL . $this->_t(2) . "jQuery('#jform_" . $target['name'] . "').attr('aria-required',true);"; - $show .= PHP_EOL . $this->_t(2) . "jQuery('#jform_" . $target['name'] . "').addClass('required');"; - $show .= PHP_EOL . $this->_t(2) . "jform_" . $unique . "_required = false;" . PHP_EOL; + $show = PHP_EOL + . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " add required attribute to " + . $target['name'] . " field"; + $show .= PHP_EOL + . $this->_t(2) . "updateFieldRequired('" + . $target['name'] . "',0);"; + $show .= PHP_EOL + . $this->_t(2) . "jQuery('#jform_" + . $target['name'] + . "').prop('required','required');"; + $show .= PHP_EOL + . $this->_t(2) . "jQuery('#jform_" + . $target['name'] + . "').attr('aria-required',true);"; + $show .= PHP_EOL + . $this->_t(2) . "jQuery('#jform_" + . $target['name'] . "').addClass('required');"; + $show .= PHP_EOL + . $this->_t(2) . "jform_" . $unique + . "_required = false;" . PHP_EOL; $bucket[$target['name']]['show'] = $show; } // make sure that the axaj and other needed things for this view is loaded - $this->validationFixBuilder[$viewName][] = $target['name']; + $this->validationFixBuilder[$viewName][] + = $target['name']; } else { @@ -10442,6 +15818,7 @@ class Interpretation extends Fields } $this->targetControlsScriptChecker[] = $uniqueVar; } + return $bucket; } @@ -10453,7 +15830,9 @@ class Interpretation extends Fields { case 1: // Is // only 4 list/radio/checkboxes - if (ComponentbuilderHelper::fieldCheck($type, 'list') || ComponentbuilderHelper::fieldCheck($type, 'dynamic') || !ComponentbuilderHelper::fieldCheck($type)) + if (ComponentbuilderHelper::fieldCheck($type, 'list') + || ComponentbuilderHelper::fieldCheck($type, 'dynamic') + || !ComponentbuilderHelper::fieldCheck($type)) { if (ComponentbuilderHelper::checkArray($options)) { @@ -10484,7 +15863,9 @@ class Interpretation extends Fields break; case 2: // Is Not // only 4 list/radio/checkboxes - if (ComponentbuilderHelper::fieldCheck($type, 'list') || ComponentbuilderHelper::fieldCheck($type, 'dynamic') || !ComponentbuilderHelper::fieldCheck($type)) + if (ComponentbuilderHelper::fieldCheck($type, 'list') + || ComponentbuilderHelper::fieldCheck($type, 'dynamic') + || !ComponentbuilderHelper::fieldCheck($type)) { if (ComponentbuilderHelper::checkArray($options)) { @@ -10515,7 +15896,9 @@ class Interpretation extends Fields break; case 3: // Any Selection // only 4 list/radio/checkboxes/dynamic_list - if (ComponentbuilderHelper::fieldCheck($type, 'list') || ComponentbuilderHelper::fieldCheck($type, 'dynamic') || !ComponentbuilderHelper::fieldCheck($type)) + if (ComponentbuilderHelper::fieldCheck($type, 'list') + || ComponentbuilderHelper::fieldCheck($type, 'dynamic') + || !ComponentbuilderHelper::fieldCheck($type)) { if (ComponentbuilderHelper::checkArray($options)) { @@ -10541,7 +15924,11 @@ class Interpretation extends Fields else { $userFix = ''; - if (isset($this->setScriptUserSwitch) && ComponentbuilderHelper::checkArray($this->setScriptUserSwitch) && in_array($type, $this->setScriptUserSwitch)) + if (isset($this->setScriptUserSwitch) + && ComponentbuilderHelper::checkArray( + $this->setScriptUserSwitch + ) + && in_array($type, $this->setScriptUserSwitch)) { // TODO this needs a closer look, a bit buggy $userFix = " && " . $value . " != 0"; @@ -10568,17 +15955,21 @@ class Interpretation extends Fields // only 4 text_field if (ComponentbuilderHelper::fieldCheck($type, 'text')) { - if (ComponentbuilderHelper::checkArray($options['keywords'])) + if (ComponentbuilderHelper::checkArray( + $options['keywords'] + )) { foreach ($options['keywords'] as $keyword) { if (ComponentbuilderHelper::checkString($string)) { - $string .= ' && ' . $value . '.indexOf("' . $keyword . '") >= 0'; + $string .= ' && ' . $value . '.indexOf("' + . $keyword . '") >= 0'; } else { - $string .= $value . '.indexOf("' . $keyword . '") >= 0'; + $string .= $value . '.indexOf("' . $keyword + . '") >= 0'; } } } @@ -10592,17 +15983,21 @@ class Interpretation extends Fields // only 4 text_field if (ComponentbuilderHelper::fieldCheck($type, 'text')) { - if (ComponentbuilderHelper::checkArray($options['keywords'])) + if (ComponentbuilderHelper::checkArray( + $options['keywords'] + )) { foreach ($options['keywords'] as $keyword) { if (ComponentbuilderHelper::checkString($string)) { - $string .= ' || ' . $value . '.indexOf("' . $keyword . '") >= 0'; + $string .= ' || ' . $value . '.indexOf("' + . $keyword . '") >= 0'; } else { - $string .= $value . '.indexOf("' . $keyword . '") >= 0'; + $string .= $value . '.indexOf("' . $keyword + . '") >= 0'; } } } @@ -10616,18 +16011,25 @@ class Interpretation extends Fields // only 4 text_field if (ComponentbuilderHelper::fieldCheck($type, 'text')) { - if (ComponentbuilderHelper::checkArray($options['keywords'])) + if (ComponentbuilderHelper::checkArray( + $options['keywords'] + )) { foreach ($options['keywords'] as $keyword) { - $keyword = ComponentbuilderHelper::safeString($keyword, 'w'); + $keyword = ComponentbuilderHelper::safeString( + $keyword, 'w' + ); if (ComponentbuilderHelper::checkString($string)) { - $string .= ' && ' . $value . '.toLowerCase().indexOf("' . $keyword . '") >= 0'; + $string .= ' && ' . $value + . '.toLowerCase().indexOf("' . $keyword + . '") >= 0'; } else { - $string .= $value . '.toLowerCase().indexOf("' . $keyword . '") >= 0'; + $string .= $value . '.toLowerCase().indexOf("' + . $keyword . '") >= 0'; } } } @@ -10641,18 +16043,25 @@ class Interpretation extends Fields // only 4 text_field if (ComponentbuilderHelper::fieldCheck($type, 'text')) { - if (ComponentbuilderHelper::checkArray($options['keywords'])) + if (ComponentbuilderHelper::checkArray( + $options['keywords'] + )) { foreach ($options['keywords'] as $keyword) { - $keyword = ComponentbuilderHelper::safeString($keyword, 'w'); + $keyword = ComponentbuilderHelper::safeString( + $keyword, 'w' + ); if (ComponentbuilderHelper::checkString($string)) { - $string .= ' || ' . $value . '.toLowerCase().indexOf("' . $keyword . '") >= 0'; + $string .= ' || ' . $value + . '.toLowerCase().indexOf("' . $keyword + . '") >= 0'; } else { - $string .= $value . '.toLowerCase().indexOf("' . $keyword . '") >= 0'; + $string .= $value . '.toLowerCase().indexOf("' + . $keyword . '") >= 0'; } } } @@ -10670,7 +16079,8 @@ class Interpretation extends Fields { if ($options['length']) { - $string .= $value . '.length >= ' . (int) $options['length']; + $string .= $value . '.length >= ' + . (int) $options['length']; } } if (!ComponentbuilderHelper::checkString($string)) @@ -10687,7 +16097,8 @@ class Interpretation extends Fields { if ($options['length']) { - $string .= $value . '.length <= ' . (int) $options['length']; + $string .= $value . '.length <= ' + . (int) $options['length']; } } if (!ComponentbuilderHelper::checkString($string)) @@ -10704,7 +16115,8 @@ class Interpretation extends Fields { if ($options['length']) { - $string .= $value . '.length == ' . (int) $options['length']; + $string .= $value . '.length == ' + . (int) $options['length']; } } if (!ComponentbuilderHelper::checkString($string)) @@ -10718,6 +16130,7 @@ class Interpretation extends Fields { $string = 0; } + return $string; } @@ -10726,9 +16139,13 @@ class Interpretation extends Fields $buket = array(); if (ComponentbuilderHelper::checkString($options)) { - if (ComponentbuilderHelper::fieldCheck($type, 'list') || ComponentbuilderHelper::fieldCheck($type, 'dynamic') || !ComponentbuilderHelper::fieldCheck($type)) + if (ComponentbuilderHelper::fieldCheck($type, 'list') + || ComponentbuilderHelper::fieldCheck($type, 'dynamic') + || !ComponentbuilderHelper::fieldCheck($type)) { - $optionsArray = array_map('trim', (array) explode(PHP_EOL, $options)); + $optionsArray = array_map( + 'trim', (array) explode(PHP_EOL, $options) + ); if (!ComponentbuilderHelper::checkArray($optionsArray)) { $optionsArray[] = $optionsArray; @@ -10737,7 +16154,9 @@ class Interpretation extends Fields { if (strpos($option, '|') !== false) { - list($option) = array_map('trim', (array) explode('|', $option)); + list($option) = array_map( + 'trim', (array) explode('|', $option) + ); } if ($option != 'dynamic_list') { @@ -10749,12 +16168,16 @@ class Interpretation extends Fields elseif (ComponentbuilderHelper::fieldCheck($type, 'text')) { // check to get the key words if set - $keywords = ComponentbuilderHelper::getBetween($options, 'keywords="', '"'); + $keywords = ComponentbuilderHelper::getBetween( + $options, 'keywords="', '"' + ); if (ComponentbuilderHelper::checkString($keywords)) { if (strpos($keywords, ',') !== false) { - $keywords = array_map('trim', (array) explode(',', $keywords)); + $keywords = array_map( + 'trim', (array) explode(',', $keywords) + ); foreach ($keywords as $keyword) { $buket['keywords'][] = trim($keyword); @@ -10766,7 +16189,9 @@ class Interpretation extends Fields } } // check to ket string length if set - $length = ComponentbuilderHelper::getBetween($options, 'length="', '"'); + $length = ComponentbuilderHelper::getBetween( + $options, 'length="', '"' + ); if (ComponentbuilderHelper::checkString($length)) { $buket['length'] = $length; @@ -10783,42 +16208,61 @@ class Interpretation extends Fields public function getValueScript($type, $name, $extends, $unique) { - $select = ''; + $select = ''; $isArray = false; $keyName = $name . '_' . $unique; if ($type === 'checkboxes' || $extends === 'checkboxes') { - $select = "var " . $keyName . " = [];" . PHP_EOL . $this->_t(1) . "jQuery('#jform_" . $name . " input[type=checkbox]').each(function()" . PHP_EOL . $this->_t(1) . "{" . PHP_EOL . $this->_t(2) . "if (jQuery(this).is(':checked'))" . PHP_EOL . $this->_t(2) . "{" . PHP_EOL . $this->_t(3) . $keyName . ".push(jQuery(this).prop('value'));" . PHP_EOL . $this->_t(2) . "}" . PHP_EOL . $this->_t(1) . "});"; + $select = "var " . $keyName . " = [];" . PHP_EOL . $this->_t(1) + . "jQuery('#jform_" . $name + . " input[type=checkbox]').each(function()" . PHP_EOL + . $this->_t(1) . "{" . PHP_EOL . $this->_t(2) + . "if (jQuery(this).is(':checked'))" . PHP_EOL . $this->_t(2) + . "{" . PHP_EOL . $this->_t(3) . $keyName + . ".push(jQuery(this).prop('value'));" . PHP_EOL . $this->_t(2) + . "}" . PHP_EOL . $this->_t(1) . "});"; $isArray = true; } elseif ($type === 'checkbox') { - $select = 'var ' . $keyName . ' = jQuery("#jform_' . $name . '").prop(\'checked\');'; + $select = 'var ' . $keyName . ' = jQuery("#jform_' . $name + . '").prop(\'checked\');'; } elseif ($type === 'radio') { - $select = 'var ' . $keyName . ' = jQuery("#jform_' . $name . ' input[type=\'radio\']:checked").val();'; + $select = 'var ' . $keyName . ' = jQuery("#jform_' . $name + . ' input[type=\'radio\']:checked").val();'; } - elseif (isset($this->setScriptUserSwitch) && ComponentbuilderHelper::checkArray($this->setScriptUserSwitch) && in_array($type, $this->setScriptUserSwitch)) + elseif (isset($this->setScriptUserSwitch) + && ComponentbuilderHelper::checkArray($this->setScriptUserSwitch) + && in_array($type, $this->setScriptUserSwitch)) { // this is only since 3.3.4 - $select = 'var ' . $keyName . ' = jQuery("#jform_' . $name . '_id").val();'; + $select = 'var ' . $keyName . ' = jQuery("#jform_' . $name + . '_id").val();'; } - elseif ($type === 'list' || ComponentbuilderHelper::fieldCheck($type, 'dynamic') || !ComponentbuilderHelper::fieldCheck($type)) + elseif ($type === 'list' + || ComponentbuilderHelper::fieldCheck( + $type, 'dynamic' + ) + || !ComponentbuilderHelper::fieldCheck($type)) { - $select = 'var ' . $keyName . ' = jQuery("#jform_' . $name . '").val();'; + $select = 'var ' . $keyName . ' = jQuery("#jform_' . $name + . '").val();'; $isArray = true; } elseif (ComponentbuilderHelper::fieldCheck($type, 'text')) { - $select = 'var ' . $keyName . ' = jQuery("#jform_' . $name . '").val();'; + $select = 'var ' . $keyName . ' = jQuery("#jform_' . $name + . '").val();'; } + return array('get' => $select, 'isArray' => $isArray); } public function clearValueScript($type, $name, $unique) { - $clear = ''; + $clear = ''; $isArray = false; $keyName = $name . '_' . $unique; if ($type === 'text' || $type === 'password' || $type === 'textarea') @@ -10829,84 +16273,119 @@ class Interpretation extends Fields { $clear = "jQuery('#jform_" . $name . "').checked = false;"; } - elseif ($type === 'checkboxes' || $type === 'checkbox' || $type === 'checkbox') + elseif ($type === 'checkboxes' || $type === 'checkbox' + || $type === 'checkbox') { $clear = "jQuery('#jform_" . $name . "').selectedIndex = -1;"; } + return $clear; } public function setViewScript(&$view, $type) { - if (isset($this->viewScriptBuilder[$view]) && isset($this->viewScriptBuilder[$view][$type])) + if (isset($this->viewScriptBuilder[$view]) + && isset($this->viewScriptBuilder[$view][$type])) { return $this->viewScriptBuilder[$view][$type]; } + return ''; } public function setValidationFix($view, $Component) { $fix = ''; - if (isset($this->validationFixBuilder[$view]) && ComponentbuilderHelper::checkArray($this->validationFixBuilder[$view])) + if (isset($this->validationFixBuilder[$view]) + && ComponentbuilderHelper::checkArray( + $this->validationFixBuilder[$view] + )) { $fix .= PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $fix .= PHP_EOL . $this->_t(1) . " * Method to validate the form data."; + $fix .= PHP_EOL . $this->_t(1) + . " * Method to validate the form data."; $fix .= PHP_EOL . $this->_t(1) . " *"; - $fix .= PHP_EOL . $this->_t(1) . " * @param JForm \$form The form to validate against."; - $fix .= PHP_EOL . $this->_t(1) . " * @param array \$data The data to validate."; - $fix .= PHP_EOL . $this->_t(1) . " * @param string \$group The name of the field group to validate."; + $fix .= PHP_EOL . $this->_t(1) + . " * @param JForm \$form The form to validate against."; + $fix .= PHP_EOL . $this->_t(1) + . " * @param array \$data The data to validate."; + $fix .= PHP_EOL . $this->_t(1) + . " * @param string \$group The name of the field group to validate."; $fix .= PHP_EOL . $this->_t(1) . " *"; - $fix .= PHP_EOL . $this->_t(1) . " * @return mixed Array of filtered data if valid, false otherwise."; + $fix .= PHP_EOL . $this->_t(1) + . " * @return mixed Array of filtered data if valid, false otherwise."; $fix .= PHP_EOL . $this->_t(1) . " *"; $fix .= PHP_EOL . $this->_t(1) . " * @see JFormRule"; $fix .= PHP_EOL . $this->_t(1) . " * @see JFilterInput"; $fix .= PHP_EOL . $this->_t(1) . " * @since 12.2"; $fix .= PHP_EOL . $this->_t(1) . " */"; - $fix .= PHP_EOL . $this->_t(1) . "public function validate(\$form, \$data, \$group = null)"; + $fix .= PHP_EOL . $this->_t(1) + . "public function validate(\$form, \$data, \$group = null)"; $fix .= PHP_EOL . $this->_t(1) . "{"; - $fix .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if the not_required field is set"; - $fix .= PHP_EOL . $this->_t(2) . "if (" . $Component . "Helper::checkString(\$data['not_required']))"; + $fix .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " check if the not_required field is set"; + $fix .= PHP_EOL . $this->_t(2) . "if (" . $Component + . "Helper::checkString(\$data['not_required']))"; $fix .= PHP_EOL . $this->_t(2) . "{"; - $fix .= PHP_EOL . $this->_t(3) . "\$requiredFields = (array) explode(',',(string) \$data['not_required']);"; - $fix .= PHP_EOL . $this->_t(3) . "\$requiredFields = array_unique(\$requiredFields);"; - $fix .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " now change the required field attributes value"; - $fix .= PHP_EOL . $this->_t(3) . "foreach (\$requiredFields as \$requiredField)"; + $fix .= PHP_EOL . $this->_t(3) + . "\$requiredFields = (array) explode(',',(string) \$data['not_required']);"; + $fix .= PHP_EOL . $this->_t(3) + . "\$requiredFields = array_unique(\$requiredFields);"; + $fix .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + . " now change the required field attributes value"; + $fix .= PHP_EOL . $this->_t(3) + . "foreach (\$requiredFields as \$requiredField)"; $fix .= PHP_EOL . $this->_t(3) . "{"; - $fix .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " make sure there is a string value"; - $fix .= PHP_EOL . $this->_t(4) . "if (" . $Component . "Helper::checkString(\$requiredField))"; + $fix .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) + . " make sure there is a string value"; + $fix .= PHP_EOL . $this->_t(4) . "if (" . $Component + . "Helper::checkString(\$requiredField))"; $fix .= PHP_EOL . $this->_t(4) . "{"; - $fix .= PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) . " change to false"; - $fix .= PHP_EOL . $this->_t(5) . "\$form->setFieldAttribute(\$requiredField, 'required', 'false');"; - $fix .= PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) . " also clear the data set"; + $fix .= PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) + . " change to false"; + $fix .= PHP_EOL . $this->_t(5) + . "\$form->setFieldAttribute(\$requiredField, 'required', 'false');"; + $fix .= PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) + . " also clear the data set"; $fix .= PHP_EOL . $this->_t(5) . "\$data[\$requiredField] = '';"; $fix .= PHP_EOL . $this->_t(4) . "}"; $fix .= PHP_EOL . $this->_t(3) . "}"; $fix .= PHP_EOL . $this->_t(2) . "}"; - $fix .= PHP_EOL . $this->_t(2) . "return parent::validate(\$form, \$data, \$group);"; + $fix .= PHP_EOL . $this->_t(2) + . "return parent::validate(\$form, \$data, \$group);"; $fix .= PHP_EOL . $this->_t(1) . "}"; } + return $fix; } public function setAjaxToke(&$view) { $fix = ''; - if (isset($this->customScriptBuilder['token'][$view]) && $this->customScriptBuilder['token'][$view]) + if (isset($this->customScriptBuilder['token'][$view]) + && $this->customScriptBuilder['token'][$view]) { - $fix .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Add Ajax Token"; - $fix .= PHP_EOL . $this->_t(2) . "\$this->document->addScriptDeclaration(\"var token = '\".JSession::getFormToken().\"';\");"; + $fix .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Add Ajax Token"; + $fix .= PHP_EOL . $this->_t(2) + . "\$this->document->addScriptDeclaration(\"var token = '\".JSession::getFormToken().\"';\");"; } + return $fix; } public function setRegisterAjaxTask($target) { $tasks = ''; - if (isset($this->customScriptBuilder[$target]['ajax_controller']) && ComponentbuilderHelper::checkArray($this->customScriptBuilder[$target]['ajax_controller'])) + if (isset($this->customScriptBuilder[$target]['ajax_controller']) + && ComponentbuilderHelper::checkArray( + $this->customScriptBuilder[$target]['ajax_controller'] + )) { $taskArray = array(); - foreach ($this->customScriptBuilder[$target]['ajax_controller'] as $view) + foreach ( + $this->customScriptBuilder[$target]['ajax_controller'] as $view + ) { foreach ($view as $task) { @@ -10917,37 +16396,54 @@ class Interpretation extends Fields { foreach ($taskArray as $name) { - $tasks .= PHP_EOL . $this->_t(2) . "\$this->registerTask('" . $name . "', 'ajax');"; + $tasks .= PHP_EOL . $this->_t(2) . "\$this->registerTask('" + . $name . "', 'ajax');"; } } } + return $tasks; } public function setAjaxInputReturn($target) { $cases = ''; - if (isset($this->customScriptBuilder[$target]['ajax_controller']) && ComponentbuilderHelper::checkArray($this->customScriptBuilder[$target]['ajax_controller'])) + if (isset($this->customScriptBuilder[$target]['ajax_controller']) + && ComponentbuilderHelper::checkArray( + $this->customScriptBuilder[$target]['ajax_controller'] + )) { - $input = array(); + $input = array(); $valueArray = array(); - $ifArray = array(); - $getModel = array(); - $userCheck = array(); - foreach ($this->customScriptBuilder[$target]['ajax_controller'] as $view) + $ifArray = array(); + $getModel = array(); + $userCheck = array(); + foreach ( + $this->customScriptBuilder[$target]['ajax_controller'] as $view + ) { foreach ($view as $task) { - $input[$task['task_name']][] = "\$" . $task['value_name'] . "Value = \$jinput->get('" . $task['value_name'] . "', " . $task['input_default'] . ", '" . $task['input_filter'] . "');"; - $valueArray[$task['task_name']][] = "\$" . $task['value_name'] . "Value"; - $getModel[$task['task_name']] = "\$result = \$this->getModel('ajax')->" . $task['method_name'] . "(" . $this->bbb . "valueArray" . $this->ddd . ");"; + $input[$task['task_name']][] = "\$" + . $task['value_name'] . "Value = \$jinput->get('" + . $task['value_name'] . "', " . $task['input_default'] + . ", '" . $task['input_filter'] . "');"; + $valueArray[$task['task_name']][] = "\$" + . $task['value_name'] . "Value"; + $getModel[$task['task_name']] + = "\$result = \$this->getModel('ajax')->" + . $task['method_name'] . "(" . $this->bbb . "valueArray" + . $this->ddd . ");"; // check if null or zero is allowed if (!isset($task['allow_zero']) || 1 != $task['allow_zero']) { - $ifArray[$task['task_name']][] = "\$" . $task['value_name'] . "Value"; + $ifArray[$task['task_name']][] = "\$" + . $task['value_name'] . "Value"; } // see user check is needed - if (!isset($userCheck[$task['task_name']]) && isset($task['user_check']) && 1 == $task['user_check']) + if (!isset($userCheck[$task['task_name']]) + && isset($task['user_check']) + && 1 == $task['user_check']) { // add it since this means it was not set, and in the old method we assumed it was inplace // or it is set and 1 means we still want it inplace @@ -10964,7 +16460,8 @@ class Interpretation extends Fields $cases .= PHP_EOL . $this->_t(4) . "case '" . $task . "':"; $cases .= PHP_EOL . $this->_t(5) . "try"; $cases .= PHP_EOL . $this->_t(5) . "{"; - $cases .= PHP_EOL . $this->_t(6) . "\$returnRaw = \$jinput->get('raw', false, 'BOOLEAN');"; + $cases .= PHP_EOL . $this->_t(6) + . "\$returnRaw = \$jinput->get('raw', false, 'BOOLEAN');"; foreach ($input[$task] as $string) { $cases .= PHP_EOL . $this->_t(6) . $string; @@ -10972,14 +16469,19 @@ class Interpretation extends Fields // set the values $values = implode(', ', $valueArray[$task]); // set the values to method - $getMethod = str_replace($this->bbb . 'valueArray' . $this->ddd, $values, $getMethod); + $getMethod = str_replace( + $this->bbb . 'valueArray' . $this->ddd, $values, + $getMethod + ); // check if we have some values to check - if (isset($ifArray[$task]) && ComponentbuilderHelper::checkArray($ifArray[$task])) + if (isset($ifArray[$task]) + && ComponentbuilderHelper::checkArray($ifArray[$task])) { // set if string $ifvalues = implode(' && ', $ifArray[$task]); // add to case - $cases .= PHP_EOL . $this->_t(6) . "if(" . $ifvalues . ")"; + $cases .= PHP_EOL . $this->_t(6) . "if(" . $ifvalues + . ")"; $cases .= PHP_EOL . $this->_t(6) . "{"; $cases .= PHP_EOL . $this->_t(7) . $getMethod; $cases .= PHP_EOL . $this->_t(6) . "}"; @@ -10993,89 +16495,140 @@ class Interpretation extends Fields $cases .= PHP_EOL . $this->_t(6) . $getMethod; } // continue the build - $cases .= PHP_EOL . $this->_t(6) . "if(\$callback = \$jinput->get('callback', null, 'CMD'))"; + $cases .= PHP_EOL . $this->_t(6) + . "if(\$callback = \$jinput->get('callback', null, 'CMD'))"; $cases .= PHP_EOL . $this->_t(6) . "{"; - $cases .= PHP_EOL . $this->_t(7) . "echo \$callback . \"(\".json_encode(\$result).\");\";"; + $cases .= PHP_EOL . $this->_t(7) + . "echo \$callback . \"(\".json_encode(\$result).\");\";"; $cases .= PHP_EOL . $this->_t(6) . "}"; $cases .= PHP_EOL . $this->_t(6) . "elseif(\$returnRaw)"; $cases .= PHP_EOL . $this->_t(6) . "{"; - $cases .= PHP_EOL . $this->_t(7) . "echo json_encode(\$result);"; + $cases .= PHP_EOL . $this->_t(7) + . "echo json_encode(\$result);"; $cases .= PHP_EOL . $this->_t(6) . "}"; $cases .= PHP_EOL . $this->_t(6) . "else"; $cases .= PHP_EOL . $this->_t(6) . "{"; - $cases .= PHP_EOL . $this->_t(7) . "echo \"(\".json_encode(\$result).\");\";"; + $cases .= PHP_EOL . $this->_t(7) + . "echo \"(\".json_encode(\$result).\");\";"; $cases .= PHP_EOL . $this->_t(6) . "}"; $cases .= PHP_EOL . $this->_t(5) . "}"; $cases .= PHP_EOL . $this->_t(5) . "catch(Exception \$e)"; $cases .= PHP_EOL . $this->_t(5) . "{"; - $cases .= PHP_EOL . $this->_t(6) . "if(\$callback = \$jinput->get('callback', null, 'CMD'))"; + $cases .= PHP_EOL . $this->_t(6) + . "if(\$callback = \$jinput->get('callback', null, 'CMD'))"; $cases .= PHP_EOL . $this->_t(6) . "{"; - $cases .= PHP_EOL . $this->_t(7) . "echo \$callback.\"(\".json_encode(\$e).\");\";"; + $cases .= PHP_EOL . $this->_t(7) + . "echo \$callback.\"(\".json_encode(\$e).\");\";"; $cases .= PHP_EOL . $this->_t(6) . "}"; $cases .= PHP_EOL . $this->_t(6) . "else"; $cases .= PHP_EOL . $this->_t(6) . "{"; - $cases .= PHP_EOL . $this->_t(7) . "echo \"(\".json_encode(\$e).\");\";"; + $cases .= PHP_EOL . $this->_t(7) + . "echo \"(\".json_encode(\$e).\");\";"; $cases .= PHP_EOL . $this->_t(6) . "}"; $cases .= PHP_EOL . $this->_t(5) . "}"; $cases .= PHP_EOL . $this->_t(4) . "break;"; } } } + return $cases; } public function setAjaxModelMethods($target) { $methods = ''; - if (isset($this->customScriptBuilder[$target]['ajax_model']) && ComponentbuilderHelper::checkArray($this->customScriptBuilder[$target]['ajax_model'])) + if (isset($this->customScriptBuilder[$target]['ajax_model']) + && ComponentbuilderHelper::checkArray( + $this->customScriptBuilder[$target]['ajax_model'] + )) { - foreach ($this->customScriptBuilder[$target]['ajax_model'] as $view => $method) + foreach ( + $this->customScriptBuilder[$target]['ajax_model'] as $view => + $method + ) { - $methods .= PHP_EOL . PHP_EOL . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Used in " . $view . PHP_EOL; - $methods .= $this->setPlaceholders($method, $this->placeholders); + $methods .= PHP_EOL . PHP_EOL . $this->_t(1) . "//" + . $this->setLine(__LINE__) . " Used in " . $view . PHP_EOL; + $methods .= $this->setPlaceholders( + $method, $this->placeholders + ); } } + return $methods; } public function setFilterFunctions($viewName_single, $viewName_list) { - if (isset($this->filterBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->filterBuilder[$viewName_list])) + if (isset($this->filterBuilder[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->filterBuilder[$viewName_list] + )) { $function = array(); // set component name $component = $this->componentCodeName; foreach ($this->filterBuilder[$viewName_list] as $filter) { - if ($filter['type'] != 'category' && ComponentbuilderHelper::checkArray($filter['custom']) && $filter['custom']['extends'] === 'user') + if ($filter['type'] != 'category' + && ComponentbuilderHelper::checkArray($filter['custom']) + && $filter['custom']['extends'] === 'user') { - $function[] = PHP_EOL . $this->_t(1) . "protected function getThe" . $filter['function'] . ComponentbuilderHelper::safeString($filter['custom']['text'], 'F') . "Selections()"; + $function[] = PHP_EOL . $this->_t(1) + . "protected function getThe" . $filter['function'] + . ComponentbuilderHelper::safeString( + $filter['custom']['text'], 'F' + ) . "Selections()"; $function[] = $this->_t(1) . "{"; - $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get a db connection."; + $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Get a db connection."; $function[] = $this->_t(2) . "\$db = JFactory::getDbo();"; - $function[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Create a new query object."; - $function[] = $this->_t(2) . "\$query = \$db->getQuery(true);"; - $function[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Select the text."; - $function[] = $this->_t(2) . "\$query->select(\$db->quoteName(array('a." . $filter['custom']['id'] . "','a." . $filter['custom']['text'] . "')));"; - $function[] = $this->_t(2) . "\$query->from(\$db->quoteName('" . $filter['custom']['table'] . "', 'a'));"; - $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " get the targeted groups"; - $function[] = $this->_t(2) . "\$groups= JComponentHelper::getParams('com_" . $component . "')->get('" . $filter['type'] . "');"; - $function[] = $this->_t(2) . "if (!empty(\$groups) && count((array) \$groups) > 0)"; + $function[] = PHP_EOL . $this->_t(2) . "//" + . $this->setLine(__LINE__) + . " Create a new query object."; + $function[] = $this->_t(2) + . "\$query = \$db->getQuery(true);"; + $function[] = PHP_EOL . $this->_t(2) . "//" + . $this->setLine(__LINE__) . " Select the text."; + $function[] = $this->_t(2) + . "\$query->select(\$db->quoteName(array('a." + . $filter['custom']['id'] . "','a." + . $filter['custom']['text'] . "')));"; + $function[] = $this->_t(2) + . "\$query->from(\$db->quoteName('" + . $filter['custom']['table'] . "', 'a'));"; + $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " get the targeted groups"; + $function[] = $this->_t(2) + . "\$groups= JComponentHelper::getParams('com_" + . $component . "')->get('" . $filter['type'] . "');"; + $function[] = $this->_t(2) + . "if (!empty(\$groups) && count((array) \$groups) > 0)"; $function[] = $this->_t(2) . "{"; - $function[] = $this->_t(3) . "\$query->join('LEFT', \$db->quoteName('#__user_usergroup_map', 'group') . ' ON (' . \$db->quoteName('group.user_id') . ' = ' . \$db->quoteName('a.id') . ')');"; - $function[] = $this->_t(3) . "\$query->where('group.group_id IN (' . implode(',', \$groups) . ')');"; + $function[] = $this->_t(3) + . "\$query->join('LEFT', \$db->quoteName('#__user_usergroup_map', 'group') . ' ON (' . \$db->quoteName('group.user_id') . ' = ' . \$db->quoteName('a.id') . ')');"; + $function[] = $this->_t(3) + . "\$query->where('group.group_id IN (' . implode(',', \$groups) . ')');"; $function[] = $this->_t(2) . "}"; - $function[] = $this->_t(2) . "\$query->order('a." . $filter['custom']['text'] . " ASC');"; - $function[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Reset the query using our newly populated query object."; + $function[] = $this->_t(2) . "\$query->order('a." + . $filter['custom']['text'] . " ASC');"; + $function[] = PHP_EOL . $this->_t(2) . "//" + . $this->setLine(__LINE__) + . " Reset the query using our newly populated query object."; $function[] = $this->_t(2) . "\$db->setQuery(\$query);"; - $function[] = PHP_EOL . $this->_t(2) . "\$results = \$db->loadObjectList();"; + $function[] = PHP_EOL . $this->_t(2) + . "\$results = \$db->loadObjectList();"; $function[] = $this->_t(2) . "if (\$results)"; $function[] = $this->_t(2) . "{"; $function[] = $this->_t(3) . "\$filter = array();"; $function[] = $this->_t(3) . "\$batch = array();"; - $function[] = $this->_t(3) . "foreach (\$results as \$result)"; + $function[] = $this->_t(3) + . "foreach (\$results as \$result)"; $function[] = $this->_t(3) . "{"; - $function[] = $this->_t(4) . "\$filter[] = JHtml::_('select.option', \$result->" . $filter['custom']['id'] . ", \$result->" . $filter['custom']['text'] . ");"; + $function[] = $this->_t(4) + . "\$filter[] = JHtml::_('select.option', \$result->" + . $filter['custom']['id'] . ", \$result->" + . $filter['custom']['text'] . ");"; $function[] = $this->_t(3) . "}"; $function[] = $this->_t(3) . "return \$filter;"; $function[] = $this->_t(2) . "}"; @@ -11121,43 +16674,81 @@ class Interpretation extends Fields $function[] = $this->_t(1) . "}"; } */ } - elseif ($filter['type'] != 'category' && !ComponentbuilderHelper::checkArray($filter['custom'])) + elseif ($filter['type'] != 'category' + && !ComponentbuilderHelper::checkArray($filter['custom'])) { $translation = false; - if (isset($this->selectionTranslationFixBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$viewName_list]) && array_key_exists($filter['code'], $this->selectionTranslationFixBuilder[$viewName_list])) + if (isset($this->selectionTranslationFixBuilder[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->selectionTranslationFixBuilder[$viewName_list] + ) + && array_key_exists( + $filter['code'], + $this->selectionTranslationFixBuilder[$viewName_list] + )) { $translation = true; } - $function[] = PHP_EOL . $this->_t(1) . "protected function getThe" . $filter['function'] . "Selections()"; + $function[] = PHP_EOL . $this->_t(1) + . "protected function getThe" . $filter['function'] + . "Selections()"; $function[] = $this->_t(1) . "{"; - $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get a db connection."; + $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Get a db connection."; $function[] = $this->_t(2) . "\$db = JFactory::getDbo();"; - $function[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Create a new query object."; - $function[] = $this->_t(2) . "\$query = \$db->getQuery(true);"; + $function[] = PHP_EOL . $this->_t(2) . "//" + . $this->setLine(__LINE__) + . " Create a new query object."; + $function[] = $this->_t(2) + . "\$query = \$db->getQuery(true);"; // check if usergroup as we change to an object query if ($filter['type'] === 'usergroup') { - $function[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Select the text."; - $function[] = $this->_t(2) . "\$query->select(\$db->quoteName('g." . $filter['code'] . "', 'id'));"; - $function[] = $this->_t(2) . "\$query->select(\$db->quoteName('ug.title', 'title'));"; - $function[] = $this->_t(2) . "\$query->from(\$db->quoteName('#__" . $component . "_" . $filter['database'] . "', 'g'));"; - $function[] = $this->_t(2) . "\$query->join('LEFT', \$db->quoteName('#__usergroups', 'ug') . ' ON (' . (\$db->quoteName('g." . $filter['code'] . "') . ' = ' . \$db->quoteName('ug.id') . ')'));"; - $function[] = $this->_t(2) . "\$query->order(\$db->quoteName('title') . ' ASC');"; - $function[] = $this->_t(2) . "\$query->group(\$db->quoteName('ug.id'));"; - $function[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Reset the query using our newly populated query object."; + $function[] = PHP_EOL . $this->_t(2) . "//" + . $this->setLine(__LINE__) . " Select the text."; + $function[] = $this->_t(2) + . "\$query->select(\$db->quoteName('g." + . $filter['code'] . "', 'id'));"; + $function[] = $this->_t(2) + . "\$query->select(\$db->quoteName('ug.title', 'title'));"; + $function[] = $this->_t(2) + . "\$query->from(\$db->quoteName('#__" . $component + . "_" . $filter['database'] . "', 'g'));"; + $function[] = $this->_t(2) + . "\$query->join('LEFT', \$db->quoteName('#__usergroups', 'ug') . ' ON (' . (\$db->quoteName('g." + . $filter['code'] + . "') . ' = ' . \$db->quoteName('ug.id') . ')'));"; + $function[] = $this->_t(2) + . "\$query->order(\$db->quoteName('title') . ' ASC');"; + $function[] = $this->_t(2) + . "\$query->group(\$db->quoteName('ug.id'));"; + $function[] = PHP_EOL . $this->_t(2) . "//" + . $this->setLine(__LINE__) + . " Reset the query using our newly populated query object."; $function[] = $this->_t(2) . "\$db->setQuery(\$query);"; - $function[] = PHP_EOL . $this->_t(2) . "\$results = \$db->loadObjectList();"; + $function[] = PHP_EOL . $this->_t(2) + . "\$results = \$db->loadObjectList();"; } else { - $function[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Select the text."; - $function[] = $this->_t(2) . "\$query->select(\$db->quoteName('" . $filter['code'] . "'));"; - $function[] = $this->_t(2) . "\$query->from(\$db->quoteName('#__" . $component . "_" . $filter['database'] . "'));"; - $function[] = $this->_t(2) . "\$query->order(\$db->quoteName('" . $filter['code'] . "') . ' ASC');"; - $function[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Reset the query using our newly populated query object."; + $function[] = PHP_EOL . $this->_t(2) . "//" + . $this->setLine(__LINE__) . " Select the text."; + $function[] = $this->_t(2) + . "\$query->select(\$db->quoteName('" + . $filter['code'] . "'));"; + $function[] = $this->_t(2) + . "\$query->from(\$db->quoteName('#__" . $component + . "_" . $filter['database'] . "'));"; + $function[] = $this->_t(2) + . "\$query->order(\$db->quoteName('" + . $filter['code'] . "') . ' ASC');"; + $function[] = PHP_EOL . $this->_t(2) . "//" + . $this->setLine(__LINE__) + . " Reset the query using our newly populated query object."; $function[] = $this->_t(2) . "\$db->setQuery(\$query);"; - $function[] = PHP_EOL . $this->_t(2) . "\$results = \$db->loadColumn();"; + $function[] = PHP_EOL . $this->_t(2) + . "\$results = \$db->loadColumn();"; } $function[] = PHP_EOL . $this->_t(2) . "if (\$results)"; @@ -11166,41 +16757,77 @@ class Interpretation extends Fields // check if translated value is used if ($translation) { - $function[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " get model"; - $function[] = $this->_t(3) . "\$model = \$this->getModel();"; + $function[] = $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " get model"; + $function[] = $this->_t(3) + . "\$model = \$this->getModel();"; } // check if usergroup as we change to an object query if ($filter['type'] !== 'usergroup') { - $function[] = $this->_t(3) . "\$results = array_unique(\$results);"; + $function[] = $this->_t(3) + . "\$results = array_unique(\$results);"; } $function[] = $this->_t(3) . "\$_filter = array();"; - $function[] = $this->_t(3) . "foreach (\$results as \$" . $filter['code'] . ")"; + $function[] = $this->_t(3) . "foreach (\$results as \$" + . $filter['code'] . ")"; $function[] = $this->_t(3) . "{"; // check if translated value is used if ($translation) { - $function[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Translate the " . $filter['code'] . " selection"; - $function[] = $this->_t(4) . "\$text = \$model->selectionTranslation(\$" . $filter['code'] . ",'" . $filter['code'] . "');"; - $function[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Now add the " . $filter['code'] . " and its text to the options array"; - $function[] = $this->_t(4) . "\$_filter[] = JHtml::_('select.option', \$" . $filter['code'] . ", JText:" . ":_(\$text));"; + $function[] = $this->_t(4) . "//" . $this->setLine( + __LINE__ + ) . " Translate the " . $filter['code'] + . " selection"; + $function[] = $this->_t(4) + . "\$text = \$model->selectionTranslation(\$" + . $filter['code'] . ",'" . $filter['code'] . "');"; + $function[] = $this->_t(4) . "//" . $this->setLine( + __LINE__ + ) . " Now add the " . $filter['code'] + . " and its text to the options array"; + $function[] = $this->_t(4) + . "\$_filter[] = JHtml::_('select.option', \$" + . $filter['code'] . ", JText:" . ":_(\$text));"; } elseif ($filter['type'] === 'user') { - $function[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Now add the " . $filter['code'] . " and its text to the options array"; - $function[] = $this->_t(4) . "\$_filter[] = JHtml::_('select.option', \$" . $filter['code'] . ", JFactory::getUser(\$" . $filter['code'] . ")->name);"; - } - else if ($filter['type'] === 'usergroup') - { - $function[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Now add the " . $filter['code'] . " and its text to the options array"; - $function[] = $this->_t(4) . "\$_filter[] = JHtml::_('select.option', \$" . $filter['code'] . "->id, \$" . $filter['code'] . "->title);"; + $function[] = $this->_t(4) . "//" . $this->setLine( + __LINE__ + ) . " Now add the " . $filter['code'] + . " and its text to the options array"; + $function[] = $this->_t(4) + . "\$_filter[] = JHtml::_('select.option', \$" + . $filter['code'] . ", JFactory::getUser(\$" + . $filter['code'] . ")->name);"; } else { - $function[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Now add the " . $filter['code'] . " and its text to the options array"; - $function[] = $this->_t(4) . "\$_filter[] = JHtml::_('select.option', \$" . $filter['code'] . ", \$" . $filter['code'] . ");"; + if ($filter['type'] === 'usergroup') + { + $function[] = $this->_t(4) . "//" . $this->setLine( + __LINE__ + ) . " Now add the " . $filter['code'] + . " and its text to the options array"; + $function[] = $this->_t(4) + . "\$_filter[] = JHtml::_('select.option', \$" + . $filter['code'] . "->id, \$" . $filter['code'] + . "->title);"; + } + else + { + $function[] = $this->_t(4) . "//" . $this->setLine( + __LINE__ + ) . " Now add the " . $filter['code'] + . " and its text to the options array"; + $function[] = $this->_t(4) + . "\$_filter[] = JHtml::_('select.option', \$" + . $filter['code'] . ", \$" . $filter['code'] + . ");"; + } } $function[] = $this->_t(3) . "}"; $function[] = $this->_t(3) . "return \$_filter;"; @@ -11215,74 +16842,125 @@ class Interpretation extends Fields return PHP_EOL . implode(PHP_EOL, $function); } } + return ''; } public function setUniqueFields(&$view) { - $fields = array(); + $fields = array(); $fields[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $fields[] = $this->_t(1) . " * Method to get the unique fields of this table."; + $fields[] = $this->_t(1) + . " * Method to get the unique fields of this table."; $fields[] = $this->_t(1) . " *"; - $fields[] = $this->_t(1) . " * @return mixed An array of field names, boolean false if none is set."; + $fields[] = $this->_t(1) + . " * @return mixed An array of field names, boolean false if none is set."; $fields[] = $this->_t(1) . " *"; $fields[] = $this->_t(1) . " * @since 3.0"; $fields[] = $this->_t(1) . " */"; $fields[] = $this->_t(1) . "protected function getUniqeFields()"; $fields[] = $this->_t(1) . "{"; - if (isset($this->dbUniqueKeys[$view]) && ComponentbuilderHelper::checkArray($this->dbUniqueKeys[$view])) + if (isset($this->dbUniqueKeys[$view]) + && ComponentbuilderHelper::checkArray($this->dbUniqueKeys[$view])) { - $fields[] = $this->_t(2) . "return array('" . implode("','", $this->dbUniqueKeys[$view]) . "');"; + $fields[] = $this->_t(2) . "return array('" . implode( + "','", $this->dbUniqueKeys[$view] + ) . "');"; } else { $fields[] = $this->_t(2) . "return false;"; } $fields[] = $this->_t(1) . "}"; + // return the unique fields return implode(PHP_EOL, $fields); } public function setOtherFilter(&$view) { - if (isset($this->filterBuilder[$view]) && ComponentbuilderHelper::checkArray($this->filterBuilder[$view])) + if (isset($this->filterBuilder[$view]) + && ComponentbuilderHelper::checkArray($this->filterBuilder[$view])) { // get component name - $Component = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]; + $Component = $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh]; $otherFilter = array(); foreach ($this->filterBuilder[$view] as $filter) { - if ($filter['type'] != 'category' && ComponentbuilderHelper::checkArray($filter['custom']) && $filter['custom']['extends'] !== 'user') + if ($filter['type'] != 'category' + && ComponentbuilderHelper::checkArray($filter['custom']) + && $filter['custom']['extends'] !== 'user') { - $CodeName = ComponentbuilderHelper::safeString($filter['code'] . ' ' . $filter['custom']['text'], 'W'); - $codeName = $filter['code'] . ComponentbuilderHelper::safeString($filter['custom']['text'], 'F'); - $type = ComponentbuilderHelper::safeString($filter['custom']['type'], 'F'); - $otherFilter[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Set " . $CodeName . " Selection"; - $otherFilter[] = $this->_t(2) . "\$this->" . $codeName . "Options = JFormHelper::loadFieldType('" . $type . "')->options;"; - $otherFilter[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " We do some sanitation for " . $CodeName . " filter"; - $otherFilter[] = $this->_t(2) . "if (" . $Component . "Helper::checkArray(\$this->" . $codeName . "Options) &&"; - $otherFilter[] = $this->_t(3) . "isset(\$this->" . $codeName . "Options[0]->value) &&"; - $otherFilter[] = $this->_t(3) . "!" . $Component . "Helper::checkString(\$this->" . $codeName . "Options[0]->value))"; + $CodeName = ComponentbuilderHelper::safeString( + $filter['code'] . ' ' . $filter['custom']['text'], 'W' + ); + $codeName = $filter['code'] + . ComponentbuilderHelper::safeString( + $filter['custom']['text'], 'F' + ); + $type = ComponentbuilderHelper::safeString( + $filter['custom']['type'], 'F' + ); + $otherFilter[] = PHP_EOL . $this->_t(2) . "//" + . $this->setLine(__LINE__) . " Set " . $CodeName + . " Selection"; + $otherFilter[] = $this->_t(2) . "\$this->" . $codeName + . "Options = JFormHelper::loadFieldType('" . $type + . "')->options;"; + $otherFilter[] = $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " We do some sanitation for " . $CodeName + . " filter"; + $otherFilter[] = $this->_t(2) . "if (" . $Component + . "Helper::checkArray(\$this->" . $codeName + . "Options) &&"; + $otherFilter[] = $this->_t(3) . "isset(\$this->" . $codeName + . "Options[0]->value) &&"; + $otherFilter[] = $this->_t(3) . "!" . $Component + . "Helper::checkString(\$this->" . $codeName + . "Options[0]->value))"; $otherFilter[] = $this->_t(2) . "{"; - $otherFilter[] = $this->_t(3) . "unset(\$this->" . $codeName . "Options[0]);"; + $otherFilter[] = $this->_t(3) . "unset(\$this->" . $codeName + . "Options[0]);"; $otherFilter[] = $this->_t(2) . "}"; - $otherFilter[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Only load " . $CodeName . " filter if it has values"; - $otherFilter[] = $this->_t(2) . "if (" . $Component . "Helper::checkArray(\$this->" . $codeName . "Options))"; + $otherFilter[] = $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Only load " . $CodeName + . " filter if it has values"; + $otherFilter[] = $this->_t(2) . "if (" . $Component + . "Helper::checkArray(\$this->" . $codeName + . "Options))"; $otherFilter[] = $this->_t(2) . "{"; - $otherFilter[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " " . $CodeName . " Filter"; + $otherFilter[] = $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " " . $CodeName . " Filter"; $otherFilter[] = $this->_t(3) . "JHtmlSidebar::addFilter("; - $otherFilter[] = $this->_t(4) . "'- Select '.JText:" . ":_('" . $filter['lang'] . "').' -',"; - $otherFilter[] = $this->_t(4) . "'filter_" . $filter['code'] . "',"; - $otherFilter[] = $this->_t(4) . "JHtml::_('select.options', \$this->" . $codeName . "Options, 'value', 'text', \$this->state->get('filter." . $filter['code'] . "'))"; + $otherFilter[] = $this->_t(4) . "'- Select '.JText:" + . ":_('" . $filter['lang'] . "').' -',"; + $otherFilter[] = $this->_t(4) . "'filter_" . $filter['code'] + . "',"; + $otherFilter[] = $this->_t(4) + . "JHtml::_('select.options', \$this->" . $codeName + . "Options, 'value', 'text', \$this->state->get('filter." + . $filter['code'] . "'))"; $otherFilter[] = $this->_t(3) . ");"; - $otherFilter[] = PHP_EOL . $this->_t(3) . "if (\$this->canBatch && \$this->canCreate && \$this->canEdit)"; + $otherFilter[] = PHP_EOL . $this->_t(3) + . "if (\$this->canBatch && \$this->canCreate && \$this->canEdit)"; $otherFilter[] = $this->_t(3) . "{"; - $otherFilter[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " " . $CodeName . " Batch Selection"; - $otherFilter[] = $this->_t(4) . "JHtmlBatch_::addListSelection("; - $otherFilter[] = $this->_t(5) . "'- Keep Original '.JText:" . ":_('" . $filter['lang'] . "').' -',"; - $otherFilter[] = $this->_t(5) . "'batch[" . $filter['code'] . "]',"; - $otherFilter[] = $this->_t(5) . "JHtml::_('select.options', \$this->" . $codeName . "Options, 'value', 'text')"; + $otherFilter[] = $this->_t(4) . "//" . $this->setLine( + __LINE__ + ) . " " . $CodeName . " Batch Selection"; + $otherFilter[] = $this->_t(4) + . "JHtmlBatch_::addListSelection("; + $otherFilter[] = $this->_t(5) . "'- Keep Original '.JText:" + . ":_('" . $filter['lang'] . "').' -',"; + $otherFilter[] = $this->_t(5) . "'batch[" . $filter['code'] + . "]',"; + $otherFilter[] = $this->_t(5) + . "JHtml::_('select.options', \$this->" . $codeName + . "Options, 'value', 'text')"; $otherFilter[] = $this->_t(4) . ");"; $otherFilter[] = $this->_t(3) . "}"; @@ -11290,41 +16968,82 @@ class Interpretation extends Fields } elseif ($filter['type'] != 'category') { - $Codename = ComponentbuilderHelper::safeString($filter['code'], 'W'); - if (isset($filter['custom']) && ComponentbuilderHelper::checkArray($filter['custom']) && $filter['custom']['extends'] === 'user') + $Codename = ComponentbuilderHelper::safeString( + $filter['code'], 'W' + ); + if (isset($filter['custom']) + && ComponentbuilderHelper::checkArray($filter['custom']) + && $filter['custom']['extends'] === 'user') { - $functionName = "\$this->getThe" . $filter['function'] . ComponentbuilderHelper::safeString($filter['custom']['text'], 'F') . "Selections();"; + $functionName = "\$this->getThe" . $filter['function'] + . ComponentbuilderHelper::safeString( + $filter['custom']['text'], 'F' + ) . "Selections();"; } else { - $functionName = "\$this->getThe" . $filter['function'] . "Selections();"; + $functionName = "\$this->getThe" . $filter['function'] + . "Selections();"; } - $otherFilter[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Set " . $Codename . " Selection"; - $otherFilter[] = $this->_t(2) . "\$this->" . $filter['code'] . "Options = " . $functionName; - $otherFilter[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " We do some sanitation for " . $Codename . " filter"; - $otherFilter[] = $this->_t(2) . "if (" . $Component . "Helper::checkArray(\$this->" . $filter['code'] . "Options) &&"; - $otherFilter[] = $this->_t(3) . "isset(\$this->" . $filter['code'] . "Options[0]->value) &&"; - $otherFilter[] = $this->_t(3) . "!" . $Component . "Helper::checkString(\$this->" . $filter['code'] . "Options[0]->value))"; + $otherFilter[] = PHP_EOL . $this->_t(2) . "//" + . $this->setLine(__LINE__) . " Set " . $Codename + . " Selection"; + $otherFilter[] = $this->_t(2) . "\$this->" . $filter['code'] + . "Options = " . $functionName; + $otherFilter[] = $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " We do some sanitation for " . $Codename + . " filter"; + $otherFilter[] = $this->_t(2) . "if (" . $Component + . "Helper::checkArray(\$this->" . $filter['code'] + . "Options) &&"; + $otherFilter[] = $this->_t(3) . "isset(\$this->" + . $filter['code'] . "Options[0]->value) &&"; + $otherFilter[] = $this->_t(3) . "!" . $Component + . "Helper::checkString(\$this->" . $filter['code'] + . "Options[0]->value))"; $otherFilter[] = $this->_t(2) . "{"; - $otherFilter[] = $this->_t(3) . "unset(\$this->" . $filter['code'] . "Options[0]);"; + $otherFilter[] = $this->_t(3) . "unset(\$this->" + . $filter['code'] . "Options[0]);"; $otherFilter[] = $this->_t(2) . "}"; - $otherFilter[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Only load " . $Codename . " filter if it has values"; - $otherFilter[] = $this->_t(2) . "if (" . $Component . "Helper::checkArray(\$this->" . $filter['code'] . "Options))"; + $otherFilter[] = $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Only load " . $Codename + . " filter if it has values"; + $otherFilter[] = $this->_t(2) . "if (" . $Component + . "Helper::checkArray(\$this->" . $filter['code'] + . "Options))"; $otherFilter[] = $this->_t(2) . "{"; - $otherFilter[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " " . $Codename . " Filter"; + $otherFilter[] = $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " " . $Codename . " Filter"; $otherFilter[] = $this->_t(3) . "JHtmlSidebar::addFilter("; - $otherFilter[] = $this->_t(4) . "'- Select '.JText:" . ":_('" . $filter['lang'] . "').' -',"; - $otherFilter[] = $this->_t(4) . "'filter_" . $filter['code'] . "',"; - $otherFilter[] = $this->_t(4) . "JHtml::_('select.options', \$this->" . $filter['code'] . "Options, 'value', 'text', \$this->state->get('filter." . $filter['code'] . "'))"; + $otherFilter[] = $this->_t(4) . "'- Select '.JText:" + . ":_('" . $filter['lang'] . "').' -',"; + $otherFilter[] = $this->_t(4) . "'filter_" . $filter['code'] + . "',"; + $otherFilter[] = $this->_t(4) + . "JHtml::_('select.options', \$this->" + . $filter['code'] + . "Options, 'value', 'text', \$this->state->get('filter." + . $filter['code'] . "'))"; $otherFilter[] = $this->_t(3) . ");"; - $otherFilter[] = PHP_EOL . $this->_t(3) . "if (\$this->canBatch && \$this->canCreate && \$this->canEdit)"; + $otherFilter[] = PHP_EOL . $this->_t(3) + . "if (\$this->canBatch && \$this->canCreate && \$this->canEdit)"; $otherFilter[] = $this->_t(3) . "{"; - $otherFilter[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " " . $Codename . " Batch Selection"; - $otherFilter[] = $this->_t(4) . "JHtmlBatch_::addListSelection("; - $otherFilter[] = $this->_t(5) . "'- Keep Original '.JText:" . ":_('" . $filter['lang'] . "').' -',"; - $otherFilter[] = $this->_t(5) . "'batch[" . $filter['code'] . "]',"; - $otherFilter[] = $this->_t(5) . "JHtml::_('select.options', \$this->" . $filter['code'] . "Options, 'value', 'text')"; + $otherFilter[] = $this->_t(4) . "//" . $this->setLine( + __LINE__ + ) . " " . $Codename . " Batch Selection"; + $otherFilter[] = $this->_t(4) + . "JHtmlBatch_::addListSelection("; + $otherFilter[] = $this->_t(5) . "'- Keep Original '.JText:" + . ":_('" . $filter['lang'] . "').' -',"; + $otherFilter[] = $this->_t(5) . "'batch[" . $filter['code'] + . "]',"; + $otherFilter[] = $this->_t(5) + . "JHtml::_('select.options', \$this->" + . $filter['code'] . "Options, 'value', 'text')"; $otherFilter[] = $this->_t(4) . ");"; $otherFilter[] = $this->_t(3) . "}"; @@ -11337,46 +17056,66 @@ class Interpretation extends Fields return PHP_EOL . implode(PHP_EOL, $otherFilter); } } + return ''; } public function setCategoryFilter($viewName_list) { if (isset($this->categoryBuilder[$viewName_list]) - && ComponentbuilderHelper::checkArray($this->categoryBuilder[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->categoryBuilder[$viewName_list] + ) && isset($this->categoryBuilder[$viewName_list]['extension'])) { // set component name - $COPMONENT = ComponentbuilderHelper::safeString($this->componentData->name_code, 'U'); + $COPMONENT = ComponentbuilderHelper::safeString( + $this->componentData->name_code, 'U' + ); // set filter - $filter = array(); - $filter[] = PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Category Filter."; + $filter = array(); + $filter[] = PHP_EOL . PHP_EOL . $this->_t(2) . "//" + . $this->setLine(__LINE__) . " Category Filter."; $filter[] = $this->_t(2) . "JHtmlSidebar::addFilter("; - $filter[] = $this->_t(3) . "JText:" . ":_('JOPTION_SELECT_CATEGORY'),"; + $filter[] = $this->_t(3) . "JText:" + . ":_('JOPTION_SELECT_CATEGORY'),"; $filter[] = $this->_t(3) . "'filter_category_id',"; - $filter[] = $this->_t(3) . "JHtml::_('select.options', JHtml::_('category.options', '" . $this->categoryBuilder[$viewName_list]['extension'] . "'), 'value', 'text', \$this->state->get('filter.category_id'))"; + $filter[] = $this->_t(3) + . "JHtml::_('select.options', JHtml::_('category.options', '" + . $this->categoryBuilder[$viewName_list]['extension'] + . "'), 'value', 'text', \$this->state->get('filter.category_id'))"; $filter[] = $this->_t(2) . ");"; - $filter[] = PHP_EOL . $this->_t(2) . "if (\$this->canBatch && \$this->canCreate && \$this->canEdit)"; + $filter[] = PHP_EOL . $this->_t(2) + . "if (\$this->canBatch && \$this->canCreate && \$this->canEdit)"; $filter[] = $this->_t(2) . "{"; - $filter[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Category Batch selection."; + $filter[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Category Batch selection."; $filter[] = $this->_t(3) . "JHtmlBatch_::addListSelection("; - $filter[] = $this->_t(4) . "JText:" . ":_('COM_" . $COPMONENT . "_KEEP_ORIGINAL_CATEGORY'),"; + $filter[] = $this->_t(4) . "JText:" . ":_('COM_" . $COPMONENT + . "_KEEP_ORIGINAL_CATEGORY'),"; $filter[] = $this->_t(4) . "'batch[category]',"; - $filter[] = $this->_t(4) . "JHtml::_('select.options', JHtml::_('category.options', '" . $this->categoryBuilder[$viewName_list]['extension'] . "'), 'value', 'text')"; + $filter[] = $this->_t(4) + . "JHtml::_('select.options', JHtml::_('category.options', '" + . $this->categoryBuilder[$viewName_list]['extension'] + . "'), 'value', 'text')"; $filter[] = $this->_t(3) . ");"; $filter[] = $this->_t(2) . "}"; // return the filter return implode(PHP_EOL, $filter); } + return ''; } public function setRouterCategoryViews($viewName_single, $viewName_list) { - if (isset($this->categoryBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$viewName_list])) + if (isset($this->categoryBuilder[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->categoryBuilder[$viewName_list] + )) { // get the actual extention $_extension = $this->categoryBuilder[$viewName_list]['extension']; @@ -11391,51 +17130,83 @@ class Interpretation extends Fields $component = $this->componentCodeName; } // check if category has another name - if (isset($this->catOtherName[$viewName_list]) && ComponentbuilderHelper::checkArray($this->catOtherName[$viewName_list])) + if (isset($this->catOtherName[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->catOtherName[$viewName_list] + )) { $otherViews = $this->catOtherName[$viewName_list]['views']; - $otherView = $this->catOtherName[$viewName_list]['view']; + $otherView = $this->catOtherName[$viewName_list]['view']; } else { $otherViews = $viewName_list; - $otherView = $viewName_single; + $otherView = $viewName_single; } // load the category helper details in not already loaded - if (!isset($this->fileContentDynamic['category' . $otherViews][$this->hhh . 'view' . $this->hhh])) + if (!isset( + $this->fileContentDynamic['category' . $otherViews][$this->hhh + . 'view' . $this->hhh] + )) { // lets also set the category helper for this view $target = array('site' => 'category' . $viewName_list); $this->buildDynamique($target, 'category'); // insure the file gets updated - $this->fileContentDynamic['category' . $otherViews][$this->hhh . 'view' . $this->hhh] = $otherView; - $this->fileContentDynamic['category' . $otherViews][$this->hhh . 'View' . $this->hhh] = ucfirst($otherView); - $this->fileContentDynamic['category' . $otherViews][$this->hhh . 'views' . $this->hhh] = $otherViews; - $this->fileContentDynamic['category' . $otherViews][$this->hhh . 'Views' . $this->hhh] = ucfirst($otherViews); + $this->fileContentDynamic['category' . $otherViews][$this->hhh + . 'view' . $this->hhh] + = $otherView; + $this->fileContentDynamic['category' . $otherViews][$this->hhh + . 'View' . $this->hhh] + = ucfirst($otherView); + $this->fileContentDynamic['category' . $otherViews][$this->hhh + . 'views' . $this->hhh] + = $otherViews; + $this->fileContentDynamic['category' . $otherViews][$this->hhh + . 'Views' . $this->hhh] + = ucfirst($otherViews); // set script to global helper file - $includeHelper = array(); - $includeHelper[] = "\n//" . $this->setLine(__LINE__) . "Insure this view category file is loaded."; - $includeHelper[] = "\$classname = '" . ucfirst( $component ) . ucfirst($viewName_list) . "Categories';"; + $includeHelper = array(); + $includeHelper[] = "\n//" . $this->setLine(__LINE__) + . "Insure this view category file is loaded."; + $includeHelper[] = "\$classname = '" . ucfirst($component) + . ucfirst($viewName_list) . "Categories';"; $includeHelper[] = "if (!class_exists(\$classname))"; $includeHelper[] = "{"; - $includeHelper[] = $this->_t(1) . "\$path = JPATH_SITE . '/components/com_" . $component . "/helpers/category" . $viewName_list . ".php';"; + $includeHelper[] = $this->_t(1) + . "\$path = JPATH_SITE . '/components/com_" . $component + . "/helpers/category" . $viewName_list . ".php';"; $includeHelper[] = $this->_t(1) . "if (is_file(\$path))"; $includeHelper[] = $this->_t(1) . "{"; $includeHelper[] = $this->_t(2) . "include_once \$path;"; $includeHelper[] = $this->_t(1) . "}"; $includeHelper[] = "}"; - $this->fileContentStatic[$this->hhh . 'CATEGORY_CLASS_TREES' . $this->hhh] .= implode("\n", $includeHelper); + $this->fileContentStatic[$this->hhh . 'CATEGORY_CLASS_TREES' + . $this->hhh] + .= implode("\n", $includeHelper); } // return category view string - if (isset($this->fileContentStatic[$this->hhh . 'ROUTER_CATEGORY_VIEWS' . $this->hhh]) && ComponentbuilderHelper::checkString($this->fileContentStatic[$this->hhh . 'ROUTER_CATEGORY_VIEWS' . $this->hhh])) + if (isset( + $this->fileContentStatic[$this->hhh + . 'ROUTER_CATEGORY_VIEWS' . $this->hhh] + ) + && ComponentbuilderHelper::checkString( + $this->fileContentStatic[$this->hhh + . 'ROUTER_CATEGORY_VIEWS' . $this->hhh] + )) { - return "," . PHP_EOL . $this->_t(3) . '"' . $this->categoryBuilder[$viewName_list]['extension'] . '" => "' . $otherView . '"'; + return "," . PHP_EOL . $this->_t(3) . '"' + . $this->categoryBuilder[$viewName_list]['extension'] + . '" => "' . $otherView . '"'; } else { - return PHP_EOL . $this->_t(3) . '"' . $this->categoryBuilder[$viewName_list]['extension'] . '" => "' . $otherView . '"'; + return PHP_EOL . $this->_t(3) . '"' + . $this->categoryBuilder[$viewName_list]['extension'] + . '" => "' . $otherView . '"'; } } + return ''; } @@ -11445,61 +17216,93 @@ class Interpretation extends Fields // set component name $component = $this->componentCodeName; // prepare custom permission script - $customAllow = $this->getCustomScriptBuilder('php_allowadd', $viewName_single, '', null, true); + $customAllow = $this->getCustomScriptBuilder( + 'php_allowadd', $viewName_single, '', null, true + ); // setup correct core target $coreLoad = false; if (isset($this->permissionCore[$viewName_single])) { - $core = $this->permissionCore[$viewName_single]; + $core = $this->permissionCore[$viewName_single]; $coreLoad = true; } // check if item has category if (0) //isset($this->categoryBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$viewName_list])) <-- remove category from check { // check if category has another name - if ($coreLoad && isset($this->catOtherName[$viewName_list]) && ComponentbuilderHelper::checkArray($this->catOtherName[$viewName_list])) + if ($coreLoad && isset($this->catOtherName[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->catOtherName[$viewName_list] + )) { $otherViews = $this->catOtherName[$viewName_list]['views']; - $otherView = $this->catOtherName[$viewName_list]['view']; + $otherView = $this->catOtherName[$viewName_list]['view']; } else { $otherViews = $viewName_list; - $otherView = $viewName_single; + $otherView = $viewName_single; } // setup the category script - $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " get the user object"; + $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " get the user object"; $allow[] = $this->_t(2) . "\$user = JFactory::getUser();"; // check if the item has permissions. - if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($otherView, $this->permissionBuilder['global'][$core['core.access']])) + if ($coreLoad && isset($core['core.access']) + && isset($this->permissionBuilder['global'][$core['core.access']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.access']] + ) + && in_array( + $otherView, + $this->permissionBuilder['global'][$core['core.access']] + )) { - $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Access check."; - $allow[] = $this->_t(2) . "\$access = \$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "');"; + $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Access check."; + $allow[] = $this->_t(2) . "\$access = \$user->authorise('" + . $core['core.access'] . "', 'com_" . $component . "');"; $allow[] = $this->_t(2) . "if (!\$access)"; $allow[] = $this->_t(2) . "{"; $allow[] = $this->_t(3) . "return false;"; $allow[] = $this->_t(2) . "}"; } - $allow[] = $this->_t(2) . "\$categoryId = JArrayHelper::getValue(\$data, 'catid', \$this->input->getInt('filter_category_id'), 'int');"; + $allow[] = $this->_t(2) + . "\$categoryId = JArrayHelper::getValue(\$data, 'catid', \$this->input->getInt('filter_category_id'), 'int');"; $allow[] = $this->_t(2) . "\$allow = null;"; $allow[] = PHP_EOL . $this->_t(2) . "if (\$categoryId)"; $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " If the category has been passed in the URL check it."; - $allow[] = $this->_t(3) . "\$allow = \$user->authorise('core.create', \$this->option . '." . $otherViews . ".category.' . \$categoryId);"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " If the category has been passed in the URL check it."; + $allow[] = $this->_t(3) + . "\$allow = \$user->authorise('core.create', \$this->option . '." + . $otherViews . ".category.' . \$categoryId);"; $allow[] = $this->_t(2) . "}"; $allow[] = PHP_EOL . $this->_t(2) . "if (\$allow === null)"; $allow[] = $this->_t(2) . "{"; // check if the item has permissions. - if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.create']])) + if ($coreLoad && isset($core['core.create']) + && isset($this->permissionBuilder['global'][$core['core.create']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.create']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder['global'][$core['core.create']] + )) { // setup the default script - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; - $allow[] = $this->_t(3) . "return \$user->authorise('" . $core['core.create'] . "', \$this->option);"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " In the absense of better information, revert to the component permissions."; + $allow[] = $this->_t(3) . "return \$user->authorise('" + . $core['core.create'] . "', \$this->option);"; } else { // setup the default script - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " In the absense of better information, revert to the component permissions."; $allow[] = $this->_t(3) . "return parent::allowAdd(\$data);"; } $allow[] = $this->_t(2) . "}"; @@ -11510,13 +17313,24 @@ class Interpretation extends Fields } else { - $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get user object."; + $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Get user object."; $allow[] = $this->_t(2) . "\$user = JFactory::getUser();"; // check if the item has permissions. - if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.access']])) + if ($coreLoad && isset($core['core.access']) + && isset($this->permissionBuilder['global'][$core['core.access']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.access']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder['global'][$core['core.access']] + )) { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Access check."; - $allow[] = $this->_t(2) . "\$access = \$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "');"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Access check."; + $allow[] = $this->_t(2) . "\$access = \$user->authorise('" + . $core['core.access'] . "', 'com_" . $component . "');"; $allow[] = $this->_t(2) . "if (!\$access)"; $allow[] = $this->_t(2) . "{"; $allow[] = $this->_t(3) . "return false;"; @@ -11525,19 +17339,31 @@ class Interpretation extends Fields // load custom permission script $allow[] = $customAllow; // check if the item has permissions. - if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.create']])) + if ($coreLoad && isset($core['core.create']) + && isset($this->permissionBuilder['global'][$core['core.create']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.create']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder['global'][$core['core.create']] + )) { // setup the default script - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; - $allow[] = $this->_t(2) . "return \$user->authorise('" . $core['core.create'] . "', \$this->option);"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " In the absense of better information, revert to the component permissions."; + $allow[] = $this->_t(2) . "return \$user->authorise('" + . $core['core.create'] . "', \$this->option);"; } else { // setup the default script - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " In the absense of better information, revert to the component permissions."; $allow[] = $this->_t(2) . "return parent::allowAdd(\$data);"; } } + return implode(PHP_EOL, $allow); } @@ -11547,39 +17373,64 @@ class Interpretation extends Fields // set component name $component = $this->componentCodeName; // prepare custom permission script - $customAllow = $this->getCustomScriptBuilder('php_allowedit', $viewName_single, '', null, true); + $customAllow = $this->getCustomScriptBuilder( + 'php_allowedit', $viewName_single, '', null, true + ); // setup correct core target $coreLoad = false; if (isset($this->permissionCore[$viewName_single])) { - $core = $this->permissionCore[$viewName_single]; + $core = $this->permissionCore[$viewName_single]; $coreLoad = true; } - if (isset($this->categoryBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$viewName_list])) + if (isset($this->categoryBuilder[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->categoryBuilder[$viewName_list] + )) { // check if category has another name - if ($coreLoad && isset($this->catOtherName[$viewName_list]) && ComponentbuilderHelper::checkArray($this->catOtherName[$viewName_list])) + if ($coreLoad && isset($this->catOtherName[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->catOtherName[$viewName_list] + )) { $otherViews = $this->catOtherName[$viewName_list]['views']; - $otherView = $this->catOtherName[$viewName_list]['view']; + $otherView = $this->catOtherName[$viewName_list]['view']; } else { $otherViews = $viewName_list; - $otherView = $viewName_single; + $otherView = $viewName_single; } // setup the category script - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " get user object."; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " get user object."; $allow[] = $this->_t(2) . "\$user = JFactory::getUser();"; - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " get record id."; - $allow[] = $this->_t(2) . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " get record id."; + $allow[] = $this->_t(2) + . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;"; // load custom permission script $allow[] = $customAllow; // check if the item has permissions. - if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($otherView, $this->permissionBuilder['global'][$core['core.access']])) + if ($coreLoad && isset($core['core.access']) + && isset($this->permissionBuilder['global'][$core['core.access']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.access']] + ) + && in_array( + $otherView, + $this->permissionBuilder['global'][$core['core.access']] + )) { - $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Access check."; - $allow[] = $this->_t(2) . "\$access = (\$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "." . $otherView . ".' . (int) \$recordId) && \$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "'));"; + $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Access check."; + $allow[] = $this->_t(2) . "\$access = (\$user->authorise('" + . $core['core.access'] . "', 'com_" . $component . "." + . $otherView + . ".' . (int) \$recordId) && \$user->authorise('" + . $core['core.access'] . "', 'com_" . $component . "'));"; $allow[] = $this->_t(2) . "if (!\$access)"; $allow[] = $this->_t(2) . "{"; $allow[] = $this->_t(3) . "return false;"; @@ -11587,51 +17438,90 @@ class Interpretation extends Fields } $allow[] = PHP_EOL . $this->_t(2) . "if (\$recordId)"; $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " The record has been set. Check the record permissions."; // check if the item has permissions. - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit']]) && in_array($otherView, $this->permissionBuilder[$core['core.edit']])) + if ($coreLoad && isset($core['core.edit']) + && isset($this->permissionBuilder[$core['core.edit']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder[$core['core.edit']] + ) + && in_array( + $otherView, $this->permissionBuilder[$core['core.edit']] + )) { - $allow[] = $this->_t(3) . "\$permission = \$user->authorise('" . $core['core.edit'] . "', 'com_" . $component . "." . $otherView . ".' . (int) \$recordId);"; + $allow[] = $this->_t(3) . "\$permission = \$user->authorise('" + . $core['core.edit'] . "', 'com_" . $component . "." + . $otherView . ".' . (int) \$recordId);"; } else { - $allow[] = $this->_t(3) . "\$permission = \$user->authorise('core.edit', 'com_" . $component . "." . $otherView . ".' . (int) \$recordId);"; + $allow[] = $this->_t(3) + . "\$permission = \$user->authorise('core.edit', 'com_" + . $component . "." . $otherView . ".' . (int) \$recordId);"; } $allow[] = $this->_t(3) . "if (!\$permission)"; $allow[] = $this->_t(3) . "{"; // check if the item has permissions. - if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder[$core['core.edit.own']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.own']]) && in_array($otherView, $this->permissionBuilder[$core['core.edit.own']])) + if ($coreLoad && isset($core['core.edit.own']) + && isset($this->permissionBuilder[$core['core.edit.own']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder[$core['core.edit.own']] + ) + && in_array( + $otherView, $this->permissionBuilder[$core['core.edit.own']] + )) { - $allow[] = $this->_t(4) . "if (\$user->authorise('" . $core['core.edit.own'] . "', 'com_" . $component . "." . $otherView . ".' . \$recordId))"; + $allow[] = $this->_t(4) . "if (\$user->authorise('" + . $core['core.edit.own'] . "', 'com_" . $component . "." + . $otherView . ".' . \$recordId))"; } else { - $allow[] = $this->_t(4) . "if (\$user->authorise('core.edit.own', 'com_" . $component . "." . $otherView . ".' . \$recordId))"; + $allow[] = $this->_t(4) + . "if (\$user->authorise('core.edit.own', 'com_" + . $component . "." . $otherView . ".' . \$recordId))"; } $allow[] = $this->_t(4) . "{"; - $allow[] = $this->_t(5) . "//" . $this->setLine(__LINE__) . " Fallback on edit.own. Now test the owner is the user."; - $allow[] = $this->_t(5) . "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;"; + $allow[] = $this->_t(5) . "//" . $this->setLine(__LINE__) + . " Fallback on edit.own. Now test the owner is the user."; + $allow[] = $this->_t(5) + . "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;"; $allow[] = $this->_t(5) . "if (empty(\$ownerId))"; $allow[] = $this->_t(5) . "{"; - $allow[] = $this->_t(6) . "//" . $this->setLine(__LINE__) . " Need to do a lookup from the model."; - $allow[] = $this->_t(6) . "\$record = \$this->getModel()->getItem(\$recordId);"; + $allow[] = $this->_t(6) . "//" . $this->setLine(__LINE__) + . " Need to do a lookup from the model."; + $allow[] = $this->_t(6) + . "\$record = \$this->getModel()->getItem(\$recordId);"; $allow[] = PHP_EOL . $this->_t(6) . "if (empty(\$record))"; $allow[] = $this->_t(6) . "{"; $allow[] = $this->_t(7) . "return false;"; $allow[] = $this->_t(6) . "}"; $allow[] = $this->_t(6) . "\$ownerId = \$record->created_by;"; $allow[] = $this->_t(5) . "}"; - $allow[] = PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) . " If the owner matches 'me' then do the test."; + $allow[] = PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) + . " If the owner matches 'me' then do the test."; $allow[] = $this->_t(5) . "if (\$ownerId == \$user->id)"; $allow[] = $this->_t(5) . "{"; // check if the item has permissions. - if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder['global'][$core['core.edit.own']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.own']]) && in_array($otherView, $this->permissionBuilder['global'][$core['core.edit.own']])) + if ($coreLoad && isset($core['core.edit.own']) + && isset($this->permissionBuilder['global'][$core['core.edit.own']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.edit.own']] + ) + && in_array( + $otherView, + $this->permissionBuilder['global'][$core['core.edit.own']] + )) { - $allow[] = $this->_t(6) . "if (\$user->authorise('" . $core['core.edit.own'] . "', 'com_" . $component . "'))"; + $allow[] = $this->_t(6) . "if (\$user->authorise('" + . $core['core.edit.own'] . "', 'com_" . $component . "'))"; } else { - $allow[] = $this->_t(6) . "if (\$user->authorise('core.edit.own', 'com_" . $component . "'))"; + $allow[] = $this->_t(6) + . "if (\$user->authorise('core.edit.own', 'com_" + . $component . "'))"; } $allow[] = $this->_t(6) . "{"; $allow[] = $this->_t(7) . "return true;"; @@ -11651,31 +17541,60 @@ class Interpretation extends Fields // $allow[] = $this->_t(4) . "}"; // $allow[] = $this->_t(3) . "}"; $allow[] = $this->_t(2) . "}"; - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($otherView, $this->permissionBuilder['global'][$core['core.edit']])) + if ($coreLoad && isset($core['core.edit']) + && isset($this->permissionBuilder['global'][$core['core.edit']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.edit']] + ) + && in_array( + $otherView, + $this->permissionBuilder['global'][$core['core.edit']] + )) { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Since there is no permission, revert to the component permissions."; - $allow[] = $this->_t(2) . "return \$user->authorise('" . $core['core.edit'] . "', \$this->option);"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = $this->_t(2) . "return \$user->authorise('" + . $core['core.edit'] . "', \$this->option);"; } else { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Since there is no permission, revert to the component permissions."; - $allow[] = $this->_t(2) . "return parent::allowEdit(\$data, \$key);"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = $this->_t(2) + . "return parent::allowEdit(\$data, \$key);"; } } else { // setup the category script - $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " get user object."; + $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " get user object."; $allow[] = $this->_t(2) . "\$user = JFactory::getUser();"; - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " get record id."; - $allow[] = $this->_t(2) . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " get record id."; + $allow[] = $this->_t(2) + . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;"; // load custom permission script $allow[] = $customAllow; // check if the item has permissions. - if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder[$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.access']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.access']])) + if ($coreLoad && isset($core['core.access']) + && isset($this->permissionBuilder[$core['core.access']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder[$core['core.access']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder[$core['core.access']] + )) { - $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Access check."; - $allow[] = $this->_t(2) . "\$access = (\$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId) && \$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "'));"; + $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Access check."; + $allow[] = $this->_t(2) . "\$access = (\$user->authorise('" + . $core['core.access'] . "', 'com_" . $component . "." + . $viewName_single + . ".' . (int) \$recordId) && \$user->authorise('" + . $core['core.access'] . "', 'com_" . $component . "'));"; $allow[] = $this->_t(2) . "if (!\$access)"; $allow[] = $this->_t(2) . "{"; $allow[] = $this->_t(3) . "return false;"; @@ -11683,51 +17602,93 @@ class Interpretation extends Fields } $allow[] = PHP_EOL . $this->_t(2) . "if (\$recordId)"; $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " The record has been set. Check the record permissions."; // check if the item has permissions. - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit']])) + if ($coreLoad && isset($core['core.edit']) + && isset($this->permissionBuilder[$core['core.edit']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder[$core['core.edit']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder[$core['core.edit']] + )) { - $allow[] = $this->_t(3) . "\$permission = \$user->authorise('" . $core['core.edit'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);"; + $allow[] = $this->_t(3) . "\$permission = \$user->authorise('" + . $core['core.edit'] . "', 'com_" . $component . "." + . $viewName_single . ".' . (int) \$recordId);"; } else { - $allow[] = $this->_t(3) . "\$permission = \$user->authorise('core.edit', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);"; + $allow[] = $this->_t(3) + . "\$permission = \$user->authorise('core.edit', 'com_" + . $component . "." . $viewName_single + . ".' . (int) \$recordId);"; } $allow[] = $this->_t(3) . "if (!\$permission)"; $allow[] = $this->_t(3) . "{"; // check if the item has permissions. - if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder[$core['core.edit.own']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.own']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.own']])) + if ($coreLoad && isset($core['core.edit.own']) + && isset($this->permissionBuilder[$core['core.edit.own']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder[$core['core.edit.own']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder[$core['core.edit.own']] + )) { - $allow[] = $this->_t(4) . "if (\$user->authorise('" . $core['core.edit.own'] . "', 'com_" . $component . "." . $viewName_single . ".' . \$recordId))"; + $allow[] = $this->_t(4) . "if (\$user->authorise('" + . $core['core.edit.own'] . "', 'com_" . $component . "." + . $viewName_single . ".' . \$recordId))"; } else { - $allow[] = $this->_t(4) . "if (\$user->authorise('core.edit.own', 'com_" . $component . "." . $viewName_single . ".' . \$recordId))"; + $allow[] = $this->_t(4) + . "if (\$user->authorise('core.edit.own', 'com_" + . $component . "." . $viewName_single . ".' . \$recordId))"; } $allow[] = $this->_t(4) . "{"; - $allow[] = $this->_t(5) . "//" . $this->setLine(__LINE__) . " Now test the owner is the user."; - $allow[] = $this->_t(5) . "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;"; + $allow[] = $this->_t(5) . "//" . $this->setLine(__LINE__) + . " Now test the owner is the user."; + $allow[] = $this->_t(5) + . "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;"; $allow[] = $this->_t(5) . "if (empty(\$ownerId))"; $allow[] = $this->_t(5) . "{"; - $allow[] = $this->_t(6) . "//" . $this->setLine(__LINE__) . " Need to do a lookup from the model."; - $allow[] = $this->_t(6) . "\$record = \$this->getModel()->getItem(\$recordId);"; + $allow[] = $this->_t(6) . "//" . $this->setLine(__LINE__) + . " Need to do a lookup from the model."; + $allow[] = $this->_t(6) + . "\$record = \$this->getModel()->getItem(\$recordId);"; $allow[] = PHP_EOL . $this->_t(6) . "if (empty(\$record))"; $allow[] = $this->_t(6) . "{"; $allow[] = $this->_t(7) . "return false;"; $allow[] = $this->_t(6) . "}"; $allow[] = $this->_t(6) . "\$ownerId = \$record->created_by;"; $allow[] = $this->_t(5) . "}"; - $allow[] = PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) . " If the owner matches 'me' then allow."; + $allow[] = PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) + . " If the owner matches 'me' then allow."; $allow[] = $this->_t(5) . "if (\$ownerId == \$user->id)"; $allow[] = $this->_t(5) . "{"; // check if the item has permissions. - if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder['global'][$core['core.edit.own']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.own']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit.own']])) + if ($coreLoad && isset($core['core.edit.own']) + && isset($this->permissionBuilder['global'][$core['core.edit.own']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.edit.own']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder['global'][$core['core.edit.own']] + )) { - $allow[] = $this->_t(6) . "if (\$user->authorise('" . $core['core.edit.own'] . "', 'com_" . $component . "'))"; + $allow[] = $this->_t(6) . "if (\$user->authorise('" + . $core['core.edit.own'] . "', 'com_" . $component . "'))"; } else { - $allow[] = $this->_t(6) . "if (\$user->authorise('core.edit.own', 'com_" . $component . "'))"; + $allow[] = $this->_t(6) + . "if (\$user->authorise('core.edit.own', 'com_" + . $component . "'))"; } $allow[] = $this->_t(6) . "{"; $allow[] = $this->_t(7) . "return true;"; @@ -11737,15 +17698,27 @@ class Interpretation extends Fields $allow[] = $this->_t(4) . "return false;"; $allow[] = $this->_t(3) . "}"; $allow[] = $this->_t(2) . "}"; - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit']])) + if ($coreLoad && isset($core['core.edit']) + && isset($this->permissionBuilder['global'][$core['core.edit']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.edit']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder['global'][$core['core.edit']] + )) { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Since there is no permission, revert to the component permissions."; - $allow[] = $this->_t(2) . "return \$user->authorise('" . $core['core.edit'] . "', \$this->option);"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = $this->_t(2) . "return \$user->authorise('" + . $core['core.edit'] . "', \$this->option);"; } else { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Since there is no permission, revert to the component permissions."; - $allow[] = $this->_t(2) . "return parent::allowEdit(\$data, \$key);"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Since there is no permission, revert to the component permissions."; + $allow[] = $this->_t(2) + . "return parent::allowEdit(\$data, \$key);"; } } @@ -11757,329 +17730,587 @@ class Interpretation extends Fields // set component name $component = $this->componentCodeName; // allways load these - $getForm = array(); - $getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if xpath was set in options"; + $getForm = array(); + $getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " check if xpath was set in options"; $getForm[] = $this->_t(2) . "\$xpath = false;"; $getForm[] = $this->_t(2) . "if (isset(\$options['xpath']))"; $getForm[] = $this->_t(2) . "{"; $getForm[] = $this->_t(3) . "\$xpath = \$options['xpath'];"; $getForm[] = $this->_t(3) . "unset(\$options['xpath']);"; $getForm[] = $this->_t(2) . "}"; - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " check if clear form was set in options"; + $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " check if clear form was set in options"; $getForm[] = $this->_t(2) . "\$clear = false;"; $getForm[] = $this->_t(2) . "if (isset(\$options['clear']))"; $getForm[] = $this->_t(2) . "{"; $getForm[] = $this->_t(3) . "\$clear = \$options['clear'];"; $getForm[] = $this->_t(3) . "unset(\$options['clear']);"; $getForm[] = $this->_t(2) . "}"; - $getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the form."; - $getForm[] = $this->_t(2) . "\$form = \$this->loadForm('com_" . $component . "." . $viewName_single . "', '" . $viewName_single . "', \$options, \$clear, \$xpath);"; + $getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Get the form."; + $getForm[] = $this->_t(2) . "\$form = \$this->loadForm('com_" + . $component . "." . $viewName_single . "', '" . $viewName_single + . "', \$options, \$clear, \$xpath);"; $getForm[] = PHP_EOL . $this->_t(2) . "if (empty(\$form))"; $getForm[] = $this->_t(2) . "{"; $getForm[] = $this->_t(3) . "return false;"; $getForm[] = $this->_t(2) . "}"; // load license locker - if ($this->componentData->add_license && $this->componentData->license_type == 3 && isset($this->fileContentDynamic[$viewName_single][$this->hhh . 'BOOLMETHOD' . $this->hhh])) + if ($this->componentData->add_license + && $this->componentData->license_type == 3 + && isset( + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'BOOLMETHOD' . $this->hhh] + )) { - $getForm[] = $this->checkStatmentLicenseLocked($this->fileContentDynamic[$viewName_single][$this->hhh . 'BOOLMETHOD' . $this->hhh]); + $getForm[] = $this->checkStatmentLicenseLocked( + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'BOOLMETHOD' . $this->hhh] + ); } // setup correct core target $coreLoad = false; if (isset($this->permissionCore[$viewName_single])) { - $core = $this->permissionCore[$viewName_single]; + $core = $this->permissionCore[$viewName_single]; $coreLoad = true; } if (0) //isset($this->categoryBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$viewName_list])) <-- remove category from check { // check if category has another name - if ($coreLoad && isset($this->catOtherName[$viewName_list]) && ComponentbuilderHelper::checkArray($this->catOtherName[$viewName_list])) + if ($coreLoad && isset($this->catOtherName[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->catOtherName[$viewName_list] + )) { $otherViews = $this->catOtherName[$viewName_list]['views']; - $otherView = $this->catOtherName[$viewName_list]['view']; + $otherView = $this->catOtherName[$viewName_list]['view']; } else { $otherViews = $viewName_list; - $otherView = $viewName_single; + $otherView = $viewName_single; } // setup the category script - $getForm[] = PHP_EOL . $this->_t(2) . "\$jinput = JFactory::getApplication()->input;"; - $getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " The front end calls this model and uses a_id to avoid id clashes so we need to check for that first."; + $getForm[] = PHP_EOL . $this->_t(2) + . "\$jinput = JFactory::getApplication()->input;"; + $getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) + . " The front end calls this model and uses a_id to avoid id clashes so we need to check for that first."; $getForm[] = $this->_t(2) . "if (\$jinput->get('a_id'))"; $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "\$id = \$jinput->get('a_id', 0, 'INT');"; + $getForm[] = $this->_t(3) + . "\$id = \$jinput->get('a_id', 0, 'INT');"; $getForm[] = $this->_t(2) . "}"; - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " The back end uses id so we use that the rest of the time and set it to 0 by default."; + $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " The back end uses id so we use that the rest of the time and set it to 0 by default."; $getForm[] = $this->_t(2) . "else"; $getForm[] = $this->_t(2) . "{"; $getForm[] = $this->_t(3) . "\$id = \$jinput->get('id', 0, 'INT');"; $getForm[] = $this->_t(2) . "}"; - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Determine correct permissions to check."; - $getForm[] = $this->_t(2) . "if (\$this->getState('" . $viewName_single . ".id'))"; + $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Determine correct permissions to check."; + $getForm[] = $this->_t(2) . "if (\$this->getState('" + . $viewName_single . ".id'))"; $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "\$id = \$this->getState('" . $viewName_single . ".id');"; + $getForm[] = $this->_t(3) . "\$id = \$this->getState('" + . $viewName_single . ".id');"; $getForm[] = PHP_EOL . $this->_t(3) . "\$catid = 0;"; - $getForm[] = $this->_t(3) . "if (isset(\$this->getItem(\$id)->catid))"; + $getForm[] = $this->_t(3) + . "if (isset(\$this->getItem(\$id)->catid))"; $getForm[] = $this->_t(3) . "{"; - $getForm[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " set category id"; - $getForm[] = $this->_t(4) . "\$catid = \$this->getItem(\$id)->catid;"; - $getForm[] = PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Existing record. Can only edit in selected categories."; - $getForm[] = $this->_t(4) . "\$form->setFieldAttribute('catid', 'action', 'core.edit');"; - $getForm[] = PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Existing record. Can only edit own items in selected categories."; - $getForm[] = $this->_t(4) . "\$form->setFieldAttribute('catid', 'action', 'core.edit.own');"; + $getForm[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + . " set category id"; + $getForm[] = $this->_t(4) + . "\$catid = \$this->getItem(\$id)->catid;"; + $getForm[] = PHP_EOL . $this->_t(4) . "//" . $this->setLine( + __LINE__ + ) . " Existing record. Can only edit in selected categories."; + $getForm[] = $this->_t(4) + . "\$form->setFieldAttribute('catid', 'action', 'core.edit');"; + $getForm[] = PHP_EOL . $this->_t(4) . "//" . $this->setLine( + __LINE__ + ) + . " Existing record. Can only edit own items in selected categories."; + $getForm[] = $this->_t(4) + . "\$form->setFieldAttribute('catid', 'action', 'core.edit.own');"; $getForm[] = $this->_t(3) . "}"; $getForm[] = $this->_t(2) . "}"; $getForm[] = $this->_t(2) . "else"; $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " New record. Can only create in selected categories."; - $getForm[] = $this->_t(3) . "\$form->setFieldAttribute('catid', 'action', 'core.create');"; + $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " New record. Can only create in selected categories."; + $getForm[] = $this->_t(3) + . "\$form->setFieldAttribute('catid', 'action', 'core.create');"; $getForm[] = $this->_t(2) . "}"; - $getForm[] = PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();"; - $getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check for existing item."; - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit State access controls."; + $getForm[] = PHP_EOL . $this->_t(2) + . "\$user = JFactory::getUser();"; + $getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Check for existing item."; + $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Modify the form based on Edit State access controls."; // check if the item has permissions. - if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.state']])) + if ($coreLoad && isset($core['core.edit.state']) + && isset($this->permissionBuilder[$core['core.edit.state']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder[$core['core.edit.state']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder[$core['core.edit.state']] + )) { - $getForm[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; - $getForm[] = $this->_t(3) . "|| (isset(\$catid) && \$catid != 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_list . ".category.' . (int) \$catid))"; - $getForm[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "')))"; + $getForm[] = $this->_t(2) + . "if (\$id != 0 && (!\$user->authorise('" + . $core['core.edit.state'] . "', 'com_" . $component . "." + . $viewName_single . ".' . (int) \$id))"; + $getForm[] = $this->_t(3) + . "|| (isset(\$catid) && \$catid != 0 && !\$user->authorise('core.edit.state', 'com_" + . $component . "." . $viewName_list + . ".category.' . (int) \$catid))"; + $getForm[] = $this->_t(3) + . "|| (\$id == 0 && !\$user->authorise('" + . $core['core.edit.state'] . "', 'com_" . $component + . "')))"; } else { - $getForm[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; - $getForm[] = $this->_t(3) . "|| (isset(\$catid) && \$catid != 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_list . ".category.' . (int) \$catid))"; - $getForm[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "')))"; + $getForm[] = $this->_t(2) + . "if (\$id != 0 && (!\$user->authorise('core.edit.state', 'com_" + . $component . "." . $viewName_single . ".' . (int) \$id))"; + $getForm[] = $this->_t(3) + . "|| (isset(\$catid) && \$catid != 0 && !\$user->authorise('core.edit.state', 'com_" + . $component . "." . $viewName_list + . ".category.' . (int) \$catid))"; + $getForm[] = $this->_t(3) + . "|| (\$id == 0 && !\$user->authorise('core.edit.state', 'com_" + . $component . "')))"; } $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display."; - $getForm[] = $this->_t(3) . "\$form->setFieldAttribute('ordering', 'disabled', 'true');"; - $getForm[] = $this->_t(3) . "\$form->setFieldAttribute('published', 'disabled', 'true');"; - $getForm[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields while saving."; - $getForm[] = $this->_t(3) . "\$form->setFieldAttribute('ordering', 'filter', 'unset');"; - $getForm[] = $this->_t(3) . "\$form->setFieldAttribute('published', 'filter', 'unset');"; + $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Disable fields for display."; + $getForm[] = $this->_t(3) + . "\$form->setFieldAttribute('ordering', 'disabled', 'true');"; + $getForm[] = $this->_t(3) + . "\$form->setFieldAttribute('published', 'disabled', 'true');"; + $getForm[] = PHP_EOL . $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " Disable fields while saving."; + $getForm[] = $this->_t(3) + . "\$form->setFieldAttribute('ordering', 'filter', 'unset');"; + $getForm[] = $this->_t(3) + . "\$form->setFieldAttribute('published', 'filter', 'unset');"; $getForm[] = $this->_t(2) . "}"; } else { - $getForm[] = PHP_EOL . $this->_t(2) . "\$jinput = JFactory::getApplication()->input;"; - $getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " The front end calls this model and uses a_id to avoid id clashes so we need to check for that first."; + $getForm[] = PHP_EOL . $this->_t(2) + . "\$jinput = JFactory::getApplication()->input;"; + $getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) + . " The front end calls this model and uses a_id to avoid id clashes so we need to check for that first."; $getForm[] = $this->_t(2) . "if (\$jinput->get('a_id'))"; $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "\$id = \$jinput->get('a_id', 0, 'INT');"; + $getForm[] = $this->_t(3) + . "\$id = \$jinput->get('a_id', 0, 'INT');"; $getForm[] = $this->_t(2) . "}"; - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " The back end uses id so we use that the rest of the time and set it to 0 by default."; + $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " The back end uses id so we use that the rest of the time and set it to 0 by default."; $getForm[] = $this->_t(2) . "else"; $getForm[] = $this->_t(2) . "{"; $getForm[] = $this->_t(3) . "\$id = \$jinput->get('id', 0, 'INT');"; $getForm[] = $this->_t(2) . "}"; - $getForm[] = PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();"; - $getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check for existing item."; - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit State access controls."; + $getForm[] = PHP_EOL . $this->_t(2) + . "\$user = JFactory::getUser();"; + $getForm[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Check for existing item."; + $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Modify the form based on Edit State access controls."; // check if the item has permissions. - if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.state']])) + if ($coreLoad && isset($core['core.edit.state']) + && isset($this->permissionBuilder[$core['core.edit.state']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder[$core['core.edit.state']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder[$core['core.edit.state']] + )) { - $getForm[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; - $getForm[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "')))"; + $getForm[] = $this->_t(2) + . "if (\$id != 0 && (!\$user->authorise('" + . $core['core.edit.state'] . "', 'com_" . $component . "." + . $viewName_single . ".' . (int) \$id))"; + $getForm[] = $this->_t(3) + . "|| (\$id == 0 && !\$user->authorise('" + . $core['core.edit.state'] . "', 'com_" . $component + . "')))"; } else { - $getForm[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; - $getForm[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "')))"; + $getForm[] = $this->_t(2) + . "if (\$id != 0 && (!\$user->authorise('core.edit.state', 'com_" + . $component . "." . $viewName_single . ".' . (int) \$id))"; + $getForm[] = $this->_t(3) + . "|| (\$id == 0 && !\$user->authorise('core.edit.state', 'com_" + . $component . "')))"; } $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display."; - $getForm[] = $this->_t(3) . "\$form->setFieldAttribute('ordering', 'disabled', 'true');"; - $getForm[] = $this->_t(3) . "\$form->setFieldAttribute('published', 'disabled', 'true');"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields while saving."; - $getForm[] = $this->_t(3) . "\$form->setFieldAttribute('ordering', 'filter', 'unset');"; - $getForm[] = $this->_t(3) . "\$form->setFieldAttribute('published', 'filter', 'unset');"; + $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Disable fields for display."; + $getForm[] = $this->_t(3) + . "\$form->setFieldAttribute('ordering', 'disabled', 'true');"; + $getForm[] = $this->_t(3) + . "\$form->setFieldAttribute('published', 'disabled', 'true');"; + $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Disable fields while saving."; + $getForm[] = $this->_t(3) + . "\$form->setFieldAttribute('ordering', 'filter', 'unset');"; + $getForm[] = $this->_t(3) + . "\$form->setFieldAttribute('published', 'filter', 'unset');"; $getForm[] = $this->_t(2) . "}"; } - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " If this is a new item insure the greated by is set."; + $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " If this is a new item insure the greated by is set."; $getForm[] = $this->_t(2) . "if (0 == \$id)"; $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set the created_by to this user"; - $getForm[] = $this->_t(3) . "\$form->setValue('created_by', null, \$user->id);"; + $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Set the created_by to this user"; + $getForm[] = $this->_t(3) + . "\$form->setValue('created_by', null, \$user->id);"; $getForm[] = $this->_t(2) . "}"; - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit Creaded By access controls."; + $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Modify the form based on Edit Creaded By access controls."; // check if the item has permissions. - if ($coreLoad && isset($core['core.edit.created_by']) && isset($this->permissionBuilder[$core['core.edit.created_by']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.created_by']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.created_by']])) + if ($coreLoad && isset($core['core.edit.created_by']) + && isset($this->permissionBuilder[$core['core.edit.created_by']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder[$core['core.edit.created_by']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder[$core['core.edit.created_by']] + )) { - $getForm[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.created_by'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; - $getForm[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.created_by'] . "', 'com_" . $component . "')))"; + $getForm[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" + . $core['core.edit.created_by'] . "', 'com_" . $component . "." + . $viewName_single . ".' . (int) \$id))"; + $getForm[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" + . $core['core.edit.created_by'] . "', 'com_" . $component + . "')))"; } else { - $getForm[] = $this->_t(2) . "if (!\$user->authorise('core.edit.created_by', 'com_" . $component . "'))"; + $getForm[] = $this->_t(2) + . "if (!\$user->authorise('core.edit.created_by', 'com_" + . $component . "'))"; } $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display."; - $getForm[] = $this->_t(3) . "\$form->setFieldAttribute('created_by', 'disabled', 'true');"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display."; - $getForm[] = $this->_t(3) . "\$form->setFieldAttribute('created_by', 'readonly', 'true');"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields while saving."; - $getForm[] = $this->_t(3) . "\$form->setFieldAttribute('created_by', 'filter', 'unset');"; + $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Disable fields for display."; + $getForm[] = $this->_t(3) + . "\$form->setFieldAttribute('created_by', 'disabled', 'true');"; + $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Disable fields for display."; + $getForm[] = $this->_t(3) + . "\$form->setFieldAttribute('created_by', 'readonly', 'true');"; + $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Disable fields while saving."; + $getForm[] = $this->_t(3) + . "\$form->setFieldAttribute('created_by', 'filter', 'unset');"; $getForm[] = $this->_t(2) . "}"; - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit Creaded Date access controls."; + $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Modify the form based on Edit Creaded Date access controls."; // check if the item has permissions. - if ($coreLoad && isset($core['core.edit.created']) && isset($this->permissionBuilder[$core['core.edit.created']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.created']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.created']])) + if ($coreLoad && isset($core['core.edit.created']) + && isset($this->permissionBuilder[$core['core.edit.created']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder[$core['core.edit.created']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder[$core['core.edit.created']] + )) { - $getForm[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.created'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; - $getForm[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.created'] . "', 'com_" . $component . "')))"; + $getForm[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" + . $core['core.edit.created'] . "', 'com_" . $component . "." + . $viewName_single . ".' . (int) \$id))"; + $getForm[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" + . $core['core.edit.created'] . "', 'com_" . $component . "')))"; } else { - $getForm[] = $this->_t(2) . "if (!\$user->authorise('core.edit.created', 'com_" . $component . "'))"; + $getForm[] = $this->_t(2) + . "if (!\$user->authorise('core.edit.created', 'com_" + . $component . "'))"; } $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display."; - $getForm[] = $this->_t(3) . "\$form->setFieldAttribute('created', 'disabled', 'true');"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields while saving."; - $getForm[] = $this->_t(3) . "\$form->setFieldAttribute('created', 'filter', 'unset');"; + $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Disable fields for display."; + $getForm[] = $this->_t(3) + . "\$form->setFieldAttribute('created', 'disabled', 'true');"; + $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Disable fields while saving."; + $getForm[] = $this->_t(3) + . "\$form->setFieldAttribute('created', 'filter', 'unset');"; $getForm[] = $this->_t(2) . "}"; // check if the item has access permissions. - if ($coreLoad && isset($core['core.edit.access']) && isset($this->permissionBuilder[$core['core.edit.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.access']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.access']])) + if ($coreLoad && isset($core['core.edit.access']) + && isset($this->permissionBuilder[$core['core.edit.access']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder[$core['core.edit.access']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder[$core['core.edit.access']] + )) { - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit Access 'access' controls."; - $getForm[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $core['core.edit.access'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; - $getForm[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.access'] . "', 'com_" . $component . "')))"; + $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Modify the form based on Edit Access 'access' controls."; + $getForm[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" + . $core['core.edit.access'] . "', 'com_" . $component . "." + . $viewName_single . ".' . (int) \$id))"; + $getForm[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" + . $core['core.edit.access'] . "', 'com_" . $component . "')))"; $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display."; - $getForm[] = $this->_t(3) . "\$form->setFieldAttribute('access', 'disabled', 'true');"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields while saving."; - $getForm[] = $this->_t(3) . "\$form->setFieldAttribute('access', 'filter', 'unset');"; + $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Disable fields for display."; + $getForm[] = $this->_t(3) + . "\$form->setFieldAttribute('access', 'disabled', 'true');"; + $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Disable fields while saving."; + $getForm[] = $this->_t(3) + . "\$form->setFieldAttribute('access', 'filter', 'unset');"; $getForm[] = $this->_t(2) . "}"; } // handel the fields permissions - if (isset($this->permissionFields[$viewName_single]) && ComponentbuilderHelper::checkArray($this->permissionFields[$viewName_single])) + if (isset($this->permissionFields[$viewName_single]) + && ComponentbuilderHelper::checkArray( + $this->permissionFields[$viewName_single] + )) { - foreach ($this->permissionFields[$viewName_single] as $fieldName => $permission_options) + foreach ( + $this->permissionFields[$viewName_single] as $fieldName => + $permission_options + ) { - foreach($permission_options as $permission_option => $fieldType) + foreach ( + $permission_options as $permission_option => $fieldType + ) { switch ($permission_option) { case 'edit': - $this->setPermissionEditFields($getForm, $viewName_single, $fieldName, $fieldType, $component); - break; + $this->setPermissionEditFields( + $getForm, $viewName_single, $fieldName, + $fieldType, $component + ); + break; case 'access': - $this->setPermissionAccessFields($getForm, $viewName_single, $fieldName, $fieldType, $component); - break; + $this->setPermissionAccessFields( + $getForm, $viewName_single, $fieldName, + $fieldType, $component + ); + break; case 'view': - $this->setPermissionViewFields($getForm, $viewName_single, $fieldName, $fieldType, $component); - break; + $this->setPermissionViewFields( + $getForm, $viewName_single, $fieldName, + $fieldType, $component + ); + break; case 'edit.own': case 'access.own': // this must still be build (TODO) - break; + break; } } } } // add the redirect trick to set the field of origin - $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Only load these values if no id is found"; + $getForm[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Only load these values if no id is found"; $getForm[] = $this->_t(2) . "if (0 == \$id)"; $getForm[] = $this->_t(2) . "{"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set redirected view name"; - $getForm[] = $this->_t(3) . "\$redirectedView = \$jinput->get('ref', null, 'STRING');"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set field name (or fall back to view name)"; - $getForm[] = $this->_t(3) . "\$redirectedField = \$jinput->get('field', \$redirectedView, 'STRING');"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set redirected view id"; - $getForm[] = $this->_t(3) . "\$redirectedId = \$jinput->get('refid', 0, 'INT');"; - $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Set field id (or fall back to redirected view id)"; - $getForm[] = $this->_t(3) . "\$redirectedValue = \$jinput->get('field_id', \$redirectedId, 'INT');"; - $getForm[] = $this->_t(3) . "if (0 != \$redirectedValue && \$redirectedField)"; + $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Set redirected view name"; + $getForm[] = $this->_t(3) + . "\$redirectedView = \$jinput->get('ref', null, 'STRING');"; + $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Set field name (or fall back to view name)"; + $getForm[] = $this->_t(3) + . "\$redirectedField = \$jinput->get('field', \$redirectedView, 'STRING');"; + $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Set redirected view id"; + $getForm[] = $this->_t(3) + . "\$redirectedId = \$jinput->get('refid', 0, 'INT');"; + $getForm[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Set field id (or fall back to redirected view id)"; + $getForm[] = $this->_t(3) + . "\$redirectedValue = \$jinput->get('field_id', \$redirectedId, 'INT');"; + $getForm[] = $this->_t(3) + . "if (0 != \$redirectedValue && \$redirectedField)"; $getForm[] = $this->_t(3) . "{"; - $getForm[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Now set the local-redirected field default value"; - $getForm[] = $this->_t(4) . "\$form->setValue(\$redirectedField, null, \$redirectedValue);"; + $getForm[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + . " Now set the local-redirected field default value"; + $getForm[] = $this->_t(4) + . "\$form->setValue(\$redirectedField, null, \$redirectedValue);"; $getForm[] = $this->_t(3) . "}"; // load custom script if found - $getForm[] = $this->_t(2) . "}" . $this->getCustomScriptBuilder('php_getform', $viewName_single, PHP_EOL); + $getForm[] = $this->_t(2) . "}" . $this->getCustomScriptBuilder( + 'php_getform', $viewName_single, PHP_EOL + ); // setup the default script $getForm[] = $this->_t(2) . "return \$form;"; return implode(PHP_EOL, $getForm); } - - protected function setPermissionEditFields(&$allow, $viewName_single, $fieldName, $fieldType, $component) - { + + protected function setPermissionEditFields(&$allow, $viewName_single, + $fieldName, $fieldType, $component + ) { // only for fields that can be edited if (!ComponentbuilderHelper::fieldCheck($fieldType, 'spacer')) { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on Edit " . ComponentbuilderHelper::safeString($fieldName, 'W') . " access controls."; - $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $viewName_single . ".edit." . $fieldName . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; - $allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $viewName_single . ".edit." . $fieldName . "', 'com_" . $component . "')))"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Modify the form based on Edit " + . ComponentbuilderHelper::safeString($fieldName, 'W') + . " access controls."; + $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" + . $viewName_single . ".edit." . $fieldName . "', 'com_" + . $component . "." . $viewName_single . ".' . (int) \$id))"; + $allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" + . $viewName_single . ".edit." . $fieldName . "', 'com_" + . $component . "')))"; $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display."; - $allow[] = $this->_t(3) . "\$form->setFieldAttribute('" . $fieldName . "', 'disabled', 'true');"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable fields for display."; - $allow[] = $this->_t(3) . "\$form->setFieldAttribute('" . $fieldName . "', 'readonly', 'true');"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Disable fields for display."; + $allow[] = $this->_t(3) . "\$form->setFieldAttribute('" . $fieldName + . "', 'disabled', 'true');"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Disable fields for display."; + $allow[] = $this->_t(3) . "\$form->setFieldAttribute('" . $fieldName + . "', 'readonly', 'true');"; if ('radio' === $fieldType || 'repeatable' === $fieldType) { - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Disable radio button for display."; - $allow[] = $this->_t(3) . "\$class = \$form->getFieldAttribute('" . $fieldName . "', 'class', '');"; - $allow[] = $this->_t(3) . "\$form->setFieldAttribute('" . $fieldName . "', 'class', \$class.' disabled no-click');"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Disable radio button for display."; + $allow[] = $this->_t(3) + . "\$class = \$form->getFieldAttribute('" . $fieldName + . "', 'class', '');"; + $allow[] = $this->_t(3) . "\$form->setFieldAttribute('" + . $fieldName . "', 'class', \$class.' disabled no-click');"; } - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " If there is no value continue."; - $allow[] = $this->_t(3) . "if (!\$form->getValue('" . $fieldName . "'))"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " If there is no value continue."; + $allow[] = $this->_t(3) . "if (!\$form->getValue('" . $fieldName + . "'))"; $allow[] = $this->_t(3) . "{"; - $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Disable fields while saving."; - $allow[] = $this->_t(4) . "\$form->setFieldAttribute('" . $fieldName . "', 'filter', 'unset');"; - $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Disable fields while saving."; - $allow[] = $this->_t(4) . "\$form->setFieldAttribute('" . $fieldName . "', 'required', 'false');"; + $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + . " Disable fields while saving."; + $allow[] = $this->_t(4) . "\$form->setFieldAttribute('" . $fieldName + . "', 'filter', 'unset');"; + $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + . " Disable fields while saving."; + $allow[] = $this->_t(4) . "\$form->setFieldAttribute('" . $fieldName + . "', 'required', 'false');"; $allow[] = $this->_t(3) . "}"; $allow[] = $this->_t(2) . "}"; } } - - protected function setPermissionAccessFields(&$allow, $viewName_single, $fieldName, $fieldType, $component) - { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the from the form based on " . ComponentbuilderHelper::safeString($fieldName, 'W') . " access controls."; - $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $viewName_single . ".access." . $fieldName . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; - $allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $viewName_single . ".access." . $fieldName . "', 'com_" . $component . "')))"; + + protected function setPermissionAccessFields(&$allow, $viewName_single, + $fieldName, $fieldType, $component + ) { + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Modify the from the form based on " + . ComponentbuilderHelper::safeString($fieldName, 'W') + . " access controls."; + $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" + . $viewName_single . ".access." . $fieldName . "', 'com_" + . $component . "." . $viewName_single . ".' . (int) \$id))"; + $allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" + . $viewName_single . ".access." . $fieldName . "', 'com_" + . $component . "')))"; $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Remove the field"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Remove the field"; $allow[] = $this->_t(3) . "\$form->removeField('" . $fieldName . "');"; $allow[] = $this->_t(2) . "}"; } - - protected function setPermissionViewFields(&$allow, $viewName_single, $fieldName, $fieldType, $component) - { + + protected function setPermissionViewFields(&$allow, $viewName_single, + $fieldName, $fieldType, $component + ) { if (ComponentbuilderHelper::fieldCheck($fieldType, 'spacer')) { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on View " . ComponentbuilderHelper::safeString($fieldName, 'W') . " access controls."; - $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $viewName_single . ".view." . $fieldName . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; - $allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $viewName_single . ".view." . $fieldName . "', 'com_" . $component . "')))"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Modify the form based on View " + . ComponentbuilderHelper::safeString($fieldName, 'W') + . " access controls."; + $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" + . $viewName_single . ".view." . $fieldName . "', 'com_" + . $component . "." . $viewName_single . ".' . (int) \$id))"; + $allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" + . $viewName_single . ".view." . $fieldName . "', 'com_" + . $component . "')))"; $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Remove the field"; - $allow[] = $this->_t(3) . "\$form->removeField('" . $fieldName . "');"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Remove the field"; + $allow[] = $this->_t(3) . "\$form->removeField('" . $fieldName + . "');"; $allow[] = $this->_t(2) . "}"; } else { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Modify the form based on View " . ComponentbuilderHelper::safeString($fieldName, 'W') . " access controls."; - $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" . $viewName_single . ".view." . $fieldName . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))"; - $allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" . $viewName_single . ".view." . $fieldName . "', 'com_" . $component . "')))"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Modify the form based on View " + . ComponentbuilderHelper::safeString($fieldName, 'W') + . " access controls."; + $allow[] = $this->_t(2) . "if (\$id != 0 && (!\$user->authorise('" + . $viewName_single . ".view." . $fieldName . "', 'com_" + . $component . "." . $viewName_single . ".' . (int) \$id))"; + $allow[] = $this->_t(3) . "|| (\$id == 0 && !\$user->authorise('" + . $viewName_single . ".view." . $fieldName . "', 'com_" + . $component . "')))"; $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Make the field hidded."; - $allow[] = $this->_t(3) . "\$form->setFieldAttribute('" . $fieldName . "', 'type', 'hidden');"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " If there is no value continue."; - $allow[] = $this->_t(3) . "if (!(\$val = \$form->getValue('" . $fieldName . "')))"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Make the field hidded."; + $allow[] = $this->_t(3) . "\$form->setFieldAttribute('" . $fieldName + . "', 'type', 'hidden');"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " If there is no value continue."; + $allow[] = $this->_t(3) . "if (!(\$val = \$form->getValue('" + . $fieldName . "')))"; $allow[] = $this->_t(3) . "{"; - $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Disable fields while saving."; - $allow[] = $this->_t(4) . "\$form->setFieldAttribute('" . $fieldName . "', 'filter', 'unset');"; - $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Disable fields while saving."; - $allow[] = $this->_t(4) . "\$form->setFieldAttribute('" . $fieldName . "', 'required', 'false');"; - $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Make sure"; - $allow[] = $this->_t(4) . "\$form->setValue('" . $fieldName . "', null, '');"; + $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + . " Disable fields while saving."; + $allow[] = $this->_t(4) . "\$form->setFieldAttribute('" . $fieldName + . "', 'filter', 'unset');"; + $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + . " Disable fields while saving."; + $allow[] = $this->_t(4) . "\$form->setFieldAttribute('" . $fieldName + . "', 'required', 'false');"; + $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + . " Make sure"; + $allow[] = $this->_t(4) . "\$form->setValue('" . $fieldName + . "', null, '');"; $allow[] = $this->_t(3) . "}"; - $allow[] = $this->_t(3) . "elseif (" . ucfirst($component) . "Helper::checkArray(\$val))"; + $allow[] = $this->_t(3) . "elseif (" . ucfirst($component) + . "Helper::checkArray(\$val))"; $allow[] = $this->_t(3) . "{"; - $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " We have to unset then (TODO)"; - $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Hiddend field can not handel array value"; - $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " Even if we convert to json we get an error"; - $allow[] = $this->_t(4) . "\$form->removeField('" . $fieldName . "');"; + $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + . " We have to unset then (TODO)"; + $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + . " Hiddend field can not handel array value"; + $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + . " Even if we convert to json we get an error"; + $allow[] = $this->_t(4) . "\$form->removeField('" . $fieldName + . "');"; $allow[] = $this->_t(3) . "}"; $allow[] = $this->_t(2) . "}"; } @@ -12091,33 +18322,53 @@ class Interpretation extends Fields // set component name $component = $this->componentCodeName; // prepare custom permission script - $customAllow = $this->getCustomScriptBuilder('php_allowedit', $viewName_single, $this->_t(2) . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;" . PHP_EOL); + $customAllow = $this->getCustomScriptBuilder( + 'php_allowedit', $viewName_single, $this->_t(2) + . "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;" + . PHP_EOL + ); // setup correct core target $coreLoad = false; if (isset($this->permissionCore[$viewName_single])) { - $core = $this->permissionCore[$viewName_single]; + $core = $this->permissionCore[$viewName_single]; $coreLoad = true; } // check if the item has permissions. - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit']])) + if ($coreLoad && isset($core['core.edit']) + && isset($this->permissionBuilder[$core['core.edit']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder[$core['core.edit']] + ) + && in_array( + $viewName_single, $this->permissionBuilder[$core['core.edit']] + )) { - $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check specific edit permission then general edit permission."; + $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Check specific edit permission then general edit permission."; $allow[] = $this->_t(2) . "\$user = JFactory::getUser();"; // load custom permission script $allow[] = $customAllow; - $allow[] = $this->_t(2) . "return \$user->authorise('" . $core['core.edit'] . "', 'com_" . $component . "." . $viewName_single . ".'. ((int) isset(\$data[\$key]) ? \$data[\$key] : 0)) or \$user->authorise('" . $core['core.edit'] . "', 'com_" . $component . "');"; + $allow[] = $this->_t(2) . "return \$user->authorise('" + . $core['core.edit'] . "', 'com_" . $component . "." + . $viewName_single + . ".'. ((int) isset(\$data[\$key]) ? \$data[\$key] : 0)) or \$user->authorise('" + . $core['core.edit'] . "', 'com_" . $component . "');"; } else { - $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check specific edit permission then general edit permission."; + $allow[] = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Check specific edit permission then general edit permission."; if (ComponentbuilderHelper::checkString($customAllow)) { $allow[] = $this->_t(2) . "\$user = JFactory::getUser();"; } // load custom permission script $allow[] = $customAllow; - $allow[] = $this->_t(2) . "return JFactory::getUser()->authorise('core.edit', 'com_" . $component . "." . $viewName_single . ".'. ((int) isset(\$data[\$key]) ? \$data[\$key] : 0)) or parent::allowEdit(\$data, \$key);"; + $allow[] = $this->_t(2) + . "return JFactory::getUser()->authorise('core.edit', 'com_" + . $component . "." . $viewName_single + . ".'. ((int) isset(\$data[\$key]) ? \$data[\$key] : 0)) or parent::allowEdit(\$data, \$key);"; } return implode(PHP_EOL, $allow); @@ -12132,21 +18383,24 @@ class Interpretation extends Fields $coreLoad = false; if (isset($this->permissionCore[$viewName_single])) { - $core = $this->permissionCore[$viewName_single]; + $core = $this->permissionCore[$viewName_single]; $coreLoad = true; } if (0) //isset($this->categoryBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$viewName_list])) <-- remove category from check { // check if category has another name - if ($coreLoad && isset($this->catOtherName[$viewName_list]) && ComponentbuilderHelper::checkArray($this->catOtherName[$viewName_list])) + if ($coreLoad && isset($this->catOtherName[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->catOtherName[$viewName_list] + )) { $otherViews = $this->catOtherName[$viewName_list]['views']; - $otherView = $this->catOtherName[$viewName_list]['view']; + $otherView = $this->catOtherName[$viewName_list]['view']; } else { $otherViews = $viewName_list; - $otherView = $viewName_single; + $otherView = $viewName_single; } // setup the category script $allow[] = PHP_EOL . $this->_t(2) . "if (!empty(\$record->id))"; @@ -12156,22 +18410,39 @@ class Interpretation extends Fields $allow[] = $this->_t(4) . "return;"; $allow[] = $this->_t(3) . "}"; $allow[] = PHP_EOL . $this->_t(3) . "\$user = JFactory::getUser();"; - $allow[] = $this->_t(3) . "\$allow = \$user->authorise('core.delete', 'com_" . $component . "." . $otherViews . ".category.' . (int) \$record->catid);"; + $allow[] = $this->_t(3) + . "\$allow = \$user->authorise('core.delete', 'com_" + . $component . "." . $otherViews + . ".category.' . (int) \$record->catid);"; // check if the item has permissions. - if ($coreLoad && isset($this->permissionBuilder[$core['core.delete']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.delete']]) && in_array($otherView, $this->permissionBuilder[$core['core.delete']])) + if ($coreLoad + && isset($this->permissionBuilder[$core['core.delete']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder[$core['core.delete']] + ) + && in_array( + $otherView, $this->permissionBuilder[$core['core.delete']] + )) { $allow[] = PHP_EOL . $this->_t(3) . "if (\$allow)"; $allow[] = $this->_t(3) . "{"; - $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; - $allow[] = $this->_t(4) . "return \$user->authorise('" . $core['core.delete'] . "', 'com_" . $component . "." . $otherView . ".' . (int) \$record->id);"; + $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + . " The record has been set. Check the record permissions."; + $allow[] = $this->_t(4) . "return \$user->authorise('" + . $core['core.delete'] . "', 'com_" . $component . "." + . $otherView . ".' . (int) \$record->id);"; $allow[] = $this->_t(3) . "}"; } else { $allow[] = PHP_EOL . $this->_t(3) . "if (\$allow)"; $allow[] = $this->_t(3) . "{"; - $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; - $allow[] = $this->_t(4) . "return \$user->authorise('core.delete', 'com_" . $component . "." . $otherView . ".' . (int) \$record->id);"; + $allow[] = $this->_t(4) . "//" . $this->setLine(__LINE__) + . " The record has been set. Check the record permissions."; + $allow[] = $this->_t(4) + . "return \$user->authorise('core.delete', 'com_" + . $component . "." . $otherView + . ".' . (int) \$record->id);"; $allow[] = $this->_t(3) . "}"; } $allow[] = $this->_t(3) . "return \$allow;"; @@ -12188,17 +18459,35 @@ class Interpretation extends Fields $allow[] = $this->_t(4) . "return;"; $allow[] = $this->_t(3) . "}"; // check if the item has permissions. - if ($coreLoad && (isset($core['core.delete']) && isset($this->permissionBuilder[$core['core.delete']])) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.delete']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.delete']])) + if ($coreLoad + && (isset($core['core.delete']) + && isset($this->permissionBuilder[$core['core.delete']])) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder[$core['core.delete']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder[$core['core.delete']] + )) { - $allow[] = PHP_EOL . $this->_t(3) . "\$user = JFactory::getUser();"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; - $allow[] = $this->_t(3) . "return \$user->authorise('" . $core['core.delete'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$record->id);"; + $allow[] = PHP_EOL . $this->_t(3) + . "\$user = JFactory::getUser();"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " The record has been set. Check the record permissions."; + $allow[] = $this->_t(3) . "return \$user->authorise('" + . $core['core.delete'] . "', 'com_" . $component . "." + . $viewName_single . ".' . (int) \$record->id);"; } else { - $allow[] = PHP_EOL . $this->_t(3) . "\$user = JFactory::getUser();"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; - $allow[] = $this->_t(3) . "return \$user->authorise('core.delete', 'com_" . $component . "." . $viewName_single . ".' . (int) \$record->id);"; + $allow[] = PHP_EOL . $this->_t(3) + . "\$user = JFactory::getUser();"; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " The record has been set. Check the record permissions."; + $allow[] = $this->_t(3) + . "return \$user->authorise('core.delete', 'com_" + . $component . "." . $viewName_single + . ".' . (int) \$record->id);"; } $allow[] = $this->_t(2) . "}"; $allow[] = $this->_t(2) . "return false;"; @@ -12216,95 +18505,162 @@ class Interpretation extends Fields $coreLoad = false; if (isset($this->permissionCore[$viewName_single])) { - $core = $this->permissionCore[$viewName_single]; + $core = $this->permissionCore[$viewName_single]; $coreLoad = true; } if (0) // isset($this->categoryBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$viewName_list])) <-- remove category from check { // check if category has another name - if (isset($this->catOtherName[$viewName_list]) && ComponentbuilderHelper::checkArray($this->catOtherName[$viewName_list])) + if (isset($this->catOtherName[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->catOtherName[$viewName_list] + )) { $otherViews = $this->catOtherName[$viewName_list]['views']; - $otherView = $this->catOtherName[$viewName_list]['view']; + $otherView = $this->catOtherName[$viewName_list]['view']; } else { $otherViews = $viewName_list; - $otherView = $viewName_single; + $otherView = $viewName_single; } $allow[] = PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();"; - $allow[] = $this->_t(2) . "\$recordId = (!empty(\$record->id)) ? \$record->id : 0;"; + $allow[] = $this->_t(2) + . "\$recordId = (!empty(\$record->id)) ? \$record->id : 0;"; $allow[] = PHP_EOL . $this->_t(2) . "if (\$recordId)"; $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " The record has been set. Check the record permissions."; // check if the item has permissions. - if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.state']])) + if ($coreLoad && isset($core['core.edit.state']) + && isset($this->permissionBuilder[$core['core.edit.state']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder[$core['core.edit.state']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder[$core['core.edit.state']] + )) { - $allow[] = $this->_t(3) . "\$permission = \$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);"; + $allow[] = $this->_t(3) . "\$permission = \$user->authorise('" + . $core['core.edit.state'] . "', 'com_" . $component . "." + . $viewName_single . ".' . (int) \$recordId);"; } else { - $allow[] = $this->_t(3) . "\$permission = \$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);"; + $allow[] = $this->_t(3) + . "\$permission = \$user->authorise('core.edit.state', 'com_" + . $component . "." . $viewName_single + . ".' . (int) \$recordId);"; } - $allow[] = $this->_t(3) . "if (!\$permission && !is_null(\$permission))"; + $allow[] = $this->_t(3) + . "if (!\$permission && !is_null(\$permission))"; $allow[] = $this->_t(3) . "{"; $allow[] = $this->_t(4) . "return false;"; $allow[] = $this->_t(3) . "}"; $allow[] = $this->_t(2) . "}"; // setup the category script - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Check against the category."; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Check against the category."; $allow[] = $this->_t(2) . "if (!empty(\$record->catid))"; $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "\$catpermission = \$user->authorise('core.edit.state', 'com_" . $component . "." . $otherViews . ".category.' . (int) \$record->catid);"; - $allow[] = $this->_t(3) . "if (!\$catpermission && !is_null(\$catpermission))"; + $allow[] = $this->_t(3) + . "\$catpermission = \$user->authorise('core.edit.state', 'com_" + . $component . "." . $otherViews + . ".category.' . (int) \$record->catid);"; + $allow[] = $this->_t(3) + . "if (!\$catpermission && !is_null(\$catpermission))"; $allow[] = $this->_t(3) . "{"; $allow[] = $this->_t(4) . "return false;"; $allow[] = $this->_t(3) . "}"; $allow[] = $this->_t(2) . "}"; - if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.state']])) + if ($coreLoad && isset($core['core.edit.state']) + && isset($this->permissionBuilder[$core['core.edit.state']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder[$core['core.edit.state']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder[$core['core.edit.state']] + )) { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; - $allow[] = $this->_t(2) . "return \$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "');"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " In the absense of better information, revert to the component permissions."; + $allow[] = $this->_t(2) . "return \$user->authorise('" + . $core['core.edit.state'] . "', 'com_" . $component + . "');"; } else { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; - $allow[] = $this->_t(2) . "return parent::canEditState(\$record);"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " In the absense of better information, revert to the component permissions."; + $allow[] = $this->_t(2) + . "return parent::canEditState(\$record);"; } } else { // setup the default script $allow[] = PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();"; - $allow[] = $this->_t(2) . "\$recordId = (!empty(\$record->id)) ? \$record->id : 0;"; + $allow[] = $this->_t(2) + . "\$recordId = (!empty(\$record->id)) ? \$record->id : 0;"; $allow[] = PHP_EOL . $this->_t(2) . "if (\$recordId)"; $allow[] = $this->_t(2) . "{"; - $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions."; + $allow[] = $this->_t(3) . "//" . $this->setLine(__LINE__) + . " The record has been set. Check the record permissions."; // check if the item has permissions. - if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.state']])) + if ($coreLoad && isset($core['core.edit.state']) + && isset($this->permissionBuilder[$core['core.edit.state']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder[$core['core.edit.state']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder[$core['core.edit.state']] + )) { - $allow[] = $this->_t(3) . "\$permission = \$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);"; + $allow[] = $this->_t(3) . "\$permission = \$user->authorise('" + . $core['core.edit.state'] . "', 'com_" . $component . "." + . $viewName_single . ".' . (int) \$recordId);"; } else { - $allow[] = $this->_t(3) . "\$permission = \$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);"; + $allow[] = $this->_t(3) + . "\$permission = \$user->authorise('core.edit.state', 'com_" + . $component . "." . $viewName_single + . ".' . (int) \$recordId);"; } - $allow[] = $this->_t(3) . "if (!\$permission && !is_null(\$permission))"; + $allow[] = $this->_t(3) + . "if (!\$permission && !is_null(\$permission))"; $allow[] = $this->_t(3) . "{"; $allow[] = $this->_t(4) . "return false;"; $allow[] = $this->_t(3) . "}"; $allow[] = $this->_t(2) . "}"; - if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit.state']])) + if ($coreLoad && isset($core['core.edit.state']) + && isset($this->permissionBuilder['global'][$core['core.edit.state']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.edit.state']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder['global'][$core['core.edit.state']] + )) { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; - $allow[] = $this->_t(2) . "return \$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "');"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " In the absense of better information, revert to the component permissions."; + $allow[] = $this->_t(2) . "return \$user->authorise('" + . $core['core.edit.state'] . "', 'com_" . $component + . "');"; } else { - $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions."; - $allow[] = $this->_t(2) . "return parent::canEditState(\$record);"; + $allow[] = $this->_t(2) . "//" . $this->setLine(__LINE__) + . " In the absense of better information, revert to the component permissions."; + $allow[] = $this->_t(2) + . "return parent::canEditState(\$record);"; } } + return implode(PHP_EOL, $allow); } @@ -12317,53 +18673,105 @@ class Interpretation extends Fields $coreLoad = false; if (isset($this->permissionCore[$viewName_single])) { - $core = $this->permissionCore[$viewName_single]; + $core = $this->permissionCore[$viewName_single]; $coreLoad = true; } // check if the item has permissions for edit. - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit']])) + if ($coreLoad && isset($core['core.edit']) + && isset($this->permissionBuilder['global'][$core['core.edit']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.edit']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder['global'][$core['core.edit']] + )) { - $allow[] = PHP_EOL . $this->_t(2) . "\$this->canEdit = \$this->canDo->get('" . $core['core.edit'] . "');"; + $allow[] = PHP_EOL . $this->_t(2) + . "\$this->canEdit = \$this->canDo->get('" . $core['core.edit'] + . "');"; } else { - $allow[] = PHP_EOL . $this->_t(2) . "\$this->canEdit = \$this->canDo->get('core.edit');"; + $allow[] = PHP_EOL . $this->_t(2) + . "\$this->canEdit = \$this->canDo->get('core.edit');"; } // check if the item has permissions for edit state. - if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit.state']])) + if ($coreLoad && isset($core['core.edit.state']) + && isset($this->permissionBuilder['global'][$core['core.edit.state']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.edit.state']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder['global'][$core['core.edit.state']] + )) { - $allow[] = $this->_t(2) . "\$this->canState = \$this->canDo->get('" . $core['core.edit.state'] . "');"; + $allow[] = $this->_t(2) . "\$this->canState = \$this->canDo->get('" + . $core['core.edit.state'] . "');"; } else { - $allow[] = $this->_t(2) . "\$this->canState = \$this->canDo->get('core.edit.state');"; + $allow[] = $this->_t(2) + . "\$this->canState = \$this->canDo->get('core.edit.state');"; } // check if the item has permissions for create. - if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.create']])) + if ($coreLoad && isset($core['core.create']) + && isset($this->permissionBuilder['global'][$core['core.create']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.create']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder['global'][$core['core.create']] + )) { - $allow[] = $this->_t(2) . "\$this->canCreate = \$this->canDo->get('" . $core['core.create'] . "');"; + $allow[] = $this->_t(2) . "\$this->canCreate = \$this->canDo->get('" + . $core['core.create'] . "');"; } else { - $allow[] = $this->_t(2) . "\$this->canCreate = \$this->canDo->get('core.create');"; + $allow[] = $this->_t(2) + . "\$this->canCreate = \$this->canDo->get('core.create');"; } // check if the item has permissions for delete. - if ($coreLoad && isset($core['core.delete']) && isset($this->permissionBuilder['global'][$core['core.delete']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.delete']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.delete']])) + if ($coreLoad && isset($core['core.delete']) + && isset($this->permissionBuilder['global'][$core['core.delete']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.delete']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder['global'][$core['core.delete']] + )) { - $allow[] = $this->_t(2) . "\$this->canDelete = \$this->canDo->get('" . $core['core.delete'] . "');"; + $allow[] = $this->_t(2) . "\$this->canDelete = \$this->canDo->get('" + . $core['core.delete'] . "');"; } else { - $allow[] = $this->_t(2) . "\$this->canDelete = \$this->canDo->get('core.delete');"; + $allow[] = $this->_t(2) + . "\$this->canDelete = \$this->canDo->get('core.delete');"; } // check if the item has permissions for batch. - if ($coreLoad && isset($core['core.batch']) && isset($this->permissionBuilder['global']['global'][$core['core.batch']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global']['global'][$core['core.batch']]) && in_array($viewName_single, $this->permissionBuilder['global']['global'][$core['core.delete']])) + if ($coreLoad && isset($core['core.batch']) + && isset($this->permissionBuilder['global']['global'][$core['core.batch']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global']['global'][$core['core.batch']] + ) + && in_array( + $viewName_single, + $this->permissionBuilder['global']['global'][$core['core.delete']] + )) { - $allow[] = $this->_t(2) . "\$this->canBatch = (\$this->canDo->get('" . $core['core.batch'] . "') && \$this->canDo->get('core.batch'));"; + $allow[] = $this->_t(2) . "\$this->canBatch = (\$this->canDo->get('" + . $core['core.batch'] + . "') && \$this->canDo->get('core.batch'));"; } else { - $allow[] = $this->_t(2) . "\$this->canBatch = \$this->canDo->get('core.batch');"; + $allow[] = $this->_t(2) + . "\$this->canBatch = \$this->canDo->get('core.batch');"; } return implode(PHP_EOL, $allow); @@ -12379,15 +18787,21 @@ class Interpretation extends Fields // set label $label = 'Permissions in relation to this ' . $view; // set the access fieldset - $access = ""; - $access .= PHP_EOL . $this->_t(1) . '
    '; - $access .= PHP_EOL . $this->_t(2) . ""; + $access = ""; + $access .= PHP_EOL . $this->_t(1) + . '
    '; + $access .= PHP_EOL . $this->_t(2) . ""; $access .= PHP_EOL . $this->_t(2) . '_t(3) . 'name="asset_id"'; $access .= PHP_EOL . $this->_t(3) . 'type="hidden"'; $access .= PHP_EOL . $this->_t(3) . 'filter="unset"'; $access .= PHP_EOL . $this->_t(2) . '/>'; - $access .= PHP_EOL . $this->_t(2) . ""; + $access .= PHP_EOL . $this->_t(2) . ""; $access .= PHP_EOL . $this->_t(2) . '_t(3) . 'name="rules"'; $access .= PHP_EOL . $this->_t(3) . 'type="rules"'; @@ -12396,11 +18810,13 @@ class Interpretation extends Fields $access .= PHP_EOL . $this->_t(3) . 'filter="rules"'; $access .= PHP_EOL . $this->_t(3) . 'validate="rules"'; $access .= PHP_EOL . $this->_t(3) . 'class="inputbox"'; - $access .= PHP_EOL . $this->_t(3) . 'component="com_' . $component . '"'; + $access .= PHP_EOL . $this->_t(3) . 'component="com_' . $component + . '"'; $access .= PHP_EOL . $this->_t(3) . 'section="' . $view . '"'; $access .= PHP_EOL . $this->_t(2) . '/>'; $access .= PHP_EOL . $this->_t(1) . '
    '; } + // return access field set return $access; } @@ -12408,20 +18824,24 @@ class Interpretation extends Fields public function setFilterFields(&$view) { // keep track of all fields already added - $donelist = array('id', 'search', 'published', 'access', 'created_by', 'modified_by'); + $donelist = array('id', 'search', 'published', 'access', 'created_by', + 'modified_by'); // default filter fields $fields = "'a.id','id'"; $fields .= "," . PHP_EOL . $this->_t(4) . "'a.published','published'"; - if (isset($this->accessBuilder[$view]) && ComponentbuilderHelper::checkString($this->accessBuilder[$view])) + if (isset($this->accessBuilder[$view]) + && ComponentbuilderHelper::checkString($this->accessBuilder[$view])) { $fields .= "," . PHP_EOL . $this->_t(4) . "'a.access','access'"; } $fields .= "," . PHP_EOL . $this->_t(4) . "'a.ordering','ordering'"; $fields .= "," . PHP_EOL . $this->_t(4) . "'a.created_by','created_by'"; - $fields .= "," . PHP_EOL . $this->_t(4) . "'a.modified_by','modified_by'"; + $fields .= "," . PHP_EOL . $this->_t(4) + . "'a.modified_by','modified_by'"; // add the rest of the set filters - if (isset($this->sortBuilder[$view]) && ComponentbuilderHelper::checkArray($this->sortBuilder[$view])) + if (isset($this->sortBuilder[$view]) + && ComponentbuilderHelper::checkArray($this->sortBuilder[$view])) { foreach ($this->sortBuilder[$view] as $filter) { @@ -12429,11 +18849,15 @@ class Interpretation extends Fields { if ($filter['type'] === 'category') { - $fields .= "," . PHP_EOL . $this->_t(4) . "'c.title','category_title'"; - $fields .= "," . PHP_EOL . $this->_t(4) . "'c.id', 'category_id'"; + $fields .= "," . PHP_EOL . $this->_t(4) + . "'c.title','category_title'"; + $fields .= "," . PHP_EOL . $this->_t(4) + . "'c.id', 'category_id'"; if ($filter['code'] != 'category') { - $fields .= "," . PHP_EOL . $this->_t(4) . "'a." . $filter['code'] . "', '" . $filter['code'] . "'"; + $fields .= "," . PHP_EOL . $this->_t(4) . "'a." + . $filter['code'] . "', '" . $filter['code'] + . "'"; } } else @@ -12443,14 +18867,16 @@ class Interpretation extends Fields { $fields .= ",".PHP_EOL.$this->_t(4) . "'".$filter['custom']['db'].".".$filter['custom']['text']."','".$filter['code']."_".$filter['custom']['text']."'"; } */ - $fields .= "," . PHP_EOL . $this->_t(4) . "'a." . $filter['code'] . "','" . $filter['code'] . "'"; + $fields .= "," . PHP_EOL . $this->_t(4) . "'a." + . $filter['code'] . "','" . $filter['code'] . "'"; } $donelist[] = $filter['code']; } } } // add the rest of the set filters - if (isset($this->filterBuilder[$view]) && ComponentbuilderHelper::checkArray($this->filterBuilder[$view])) + if (isset($this->filterBuilder[$view]) + && ComponentbuilderHelper::checkArray($this->filterBuilder[$view])) { foreach ($this->filterBuilder[$view] as $filter) { @@ -12458,11 +18884,15 @@ class Interpretation extends Fields { if ($filter['type'] === 'category') { - $fields .= "," . PHP_EOL . $this->_t(4) . "'c.title','category_title'"; - $fields .= "," . PHP_EOL . $this->_t(4) . "'c.id', 'category_id'"; + $fields .= "," . PHP_EOL . $this->_t(4) + . "'c.title','category_title'"; + $fields .= "," . PHP_EOL . $this->_t(4) + . "'c.id', 'category_id'"; if ($filter['code'] != 'category') { - $fields .= "," . PHP_EOL . $this->_t(4) . "'a." . $filter['code'] . "', '" . $filter['code'] . "'"; + $fields .= "," . PHP_EOL . $this->_t(4) . "'a." + . $filter['code'] . "', '" . $filter['code'] + . "'"; } } else @@ -12472,33 +18902,45 @@ class Interpretation extends Fields { $fields .= ",".PHP_EOL.$this->_t(4) . "'".$filter['custom']['db'].".".$filter['custom']['text']."','".$filter['code']."_".$filter['custom']['text']."'"; } */ - $fields .= "," . PHP_EOL . $this->_t(4) . "'a." . $filter['code'] . "','" . $filter['code'] . "'"; + $fields .= "," . PHP_EOL . $this->_t(4) . "'a." + . $filter['code'] . "','" . $filter['code'] . "'"; } $donelist[] = $filter['code']; } } } + return $fields; } public function setStoredId(&$view) { // keep track of all fields already added - $donelist = array('id', 'search', 'published', 'access', 'created_by', 'modified_by'); + $donelist = array('id', 'search', 'published', 'access', 'created_by', + 'modified_by'); // set the defaults first $stored = "//" . $this->setLine(__LINE__) . " Compile the store id."; - $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.id');"; - $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.search');"; - $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.published');"; - if (isset($this->accessBuilder[$view]) && ComponentbuilderHelper::checkString($this->accessBuilder[$view])) + $stored .= PHP_EOL . $this->_t(2) + . "\$id .= ':' . \$this->getState('filter.id');"; + $stored .= PHP_EOL . $this->_t(2) + . "\$id .= ':' . \$this->getState('filter.search');"; + $stored .= PHP_EOL . $this->_t(2) + . "\$id .= ':' . \$this->getState('filter.published');"; + if (isset($this->accessBuilder[$view]) + && ComponentbuilderHelper::checkString($this->accessBuilder[$view])) { - $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.access');"; + $stored .= PHP_EOL . $this->_t(2) + . "\$id .= ':' . \$this->getState('filter.access');"; } - $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.ordering');"; - $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.created_by');"; - $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.modified_by');"; + $stored .= PHP_EOL . $this->_t(2) + . "\$id .= ':' . \$this->getState('filter.ordering');"; + $stored .= PHP_EOL . $this->_t(2) + . "\$id .= ':' . \$this->getState('filter.created_by');"; + $stored .= PHP_EOL . $this->_t(2) + . "\$id .= ':' . \$this->getState('filter.modified_by');"; // add the rest of the set filters - if (isset($this->sortBuilder[$view]) && ComponentbuilderHelper::checkArray($this->sortBuilder[$view])) + if (isset($this->sortBuilder[$view]) + && ComponentbuilderHelper::checkArray($this->sortBuilder[$view])) { foreach ($this->sortBuilder[$view] as $filter) { @@ -12506,11 +18948,15 @@ class Interpretation extends Fields { if ($filter['type'] === 'category') { - $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.category');"; - $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.category_id');"; + $stored .= PHP_EOL . $this->_t(2) + . "\$id .= ':' . \$this->getState('filter.category');"; + $stored .= PHP_EOL . $this->_t(2) + . "\$id .= ':' . \$this->getState('filter.category_id');"; if ($filter['code'] != 'category') { - $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter." . $filter['code'] . "');"; + $stored .= PHP_EOL . $this->_t(2) + . "\$id .= ':' . \$this->getState('filter." + . $filter['code'] . "');"; } } else @@ -12520,14 +18966,17 @@ class Interpretation extends Fields { $stored .= PHP_EOL.$this->_t(2) . "\$id .= ':' . \$this->getState('filter.".$filter['code']."_".$filter['custom']['text']."');"; } */ - $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter." . $filter['code'] . "');"; + $stored .= PHP_EOL . $this->_t(2) + . "\$id .= ':' . \$this->getState('filter." + . $filter['code'] . "');"; } $donelist[] = $filter['code']; } } } // add the rest of the set filters - if (isset($this->filterBuilder[$view]) && ComponentbuilderHelper::checkArray($this->filterBuilder[$view])) + if (isset($this->filterBuilder[$view]) + && ComponentbuilderHelper::checkArray($this->filterBuilder[$view])) { foreach ($this->filterBuilder[$view] as $filter) { @@ -12535,11 +18984,15 @@ class Interpretation extends Fields { if ($filter['type'] === 'category') { - $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.category');"; - $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.category_id');"; + $stored .= PHP_EOL . $this->_t(2) + . "\$id .= ':' . \$this->getState('filter.category');"; + $stored .= PHP_EOL . $this->_t(2) + . "\$id .= ':' . \$this->getState('filter.category_id');"; if ($filter['code'] != 'category') { - $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter." . $filter['code'] . "');"; + $stored .= PHP_EOL . $this->_t(2) + . "\$id .= ':' . \$this->getState('filter." + . $filter['code'] . "');"; } } else @@ -12549,185 +19002,339 @@ class Interpretation extends Fields { $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter.".$filter['code']."_".$filter['custom']['text']."');"; } */ - $stored .= PHP_EOL . $this->_t(2) . "\$id .= ':' . \$this->getState('filter." . $filter['code'] . "');"; + $stored .= PHP_EOL . $this->_t(2) + . "\$id .= ':' . \$this->getState('filter." + . $filter['code'] . "');"; } $donelist[] = $filter['code']; } } } + return $stored; } public function setAddToolBar(&$view) { // set view name - $viewName = ComponentbuilderHelper::safeString($view['settings']->name_single); + $viewName = ComponentbuilderHelper::safeString( + $view['settings']->name_single + ); // setup correct core target $coreLoad = false; if (isset($this->permissionCore[$viewName])) { - $core = $this->permissionCore[$viewName]; + $core = $this->permissionCore[$viewName]; $coreLoad = true; } // check type if ($view['settings']->type == 2) { // set lang strings - $viewNameLang_readonly = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($view['settings']->name_single . ' readonly', 'U'); + $viewNameLang_readonly = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString( + $view['settings']->name_single . ' readonly', 'U' + ); // load to lang - $this->setLangContent($this->lang, $viewNameLang_readonly, $view['settings']->name_single . ' :: Readonly'); + $this->setLangContent( + $this->lang, $viewNameLang_readonly, + $view['settings']->name_single . ' :: Readonly' + ); // build toolbar - $toolBar = "JFactory::getApplication()->input->set('hidemainmenu', true);"; - $toolBar .= PHP_EOL . $this->_t(2) . "JToolBarHelper::title(JText:" . ":_('" . $viewNameLang_readonly . "'), '" . $viewName . "');"; - $toolBar .= PHP_EOL . $this->_t(2) . "JToolBarHelper::cancel('" . $viewName . ".cancel', 'JTOOLBAR_CLOSE');"; + $toolBar + = "JFactory::getApplication()->input->set('hidemainmenu', true);"; + $toolBar .= PHP_EOL . $this->_t(2) . "JToolBarHelper::title(JText:" + . ":_('" . $viewNameLang_readonly . "'), '" . $viewName . "');"; + $toolBar .= PHP_EOL . $this->_t(2) . "JToolBarHelper::cancel('" + . $viewName . ".cancel', 'JTOOLBAR_CLOSE');"; } else { // set lang strings - $viewNameLang_new = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($view['settings']->name_single . ' New', 'U'); - $viewNameLang_edit = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($view['settings']->name_single . ' Edit', 'U'); + $viewNameLang_new = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString( + $view['settings']->name_single . ' New', 'U' + ); + $viewNameLang_edit = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString( + $view['settings']->name_single . ' Edit', 'U' + ); // load to lang - $this->setLangContent($this->lang, $viewNameLang_new, 'A New ' . $view['settings']->name_single); - $this->setLangContent($this->lang, $viewNameLang_edit, 'Editing the ' . $view['settings']->name_single); + $this->setLangContent( + $this->lang, $viewNameLang_new, + 'A New ' . $view['settings']->name_single + ); + $this->setLangContent( + $this->lang, $viewNameLang_edit, + 'Editing the ' . $view['settings']->name_single + ); // build toolbar - $toolBar = "JFactory::getApplication()->input->set('hidemainmenu', true);"; - $toolBar .= PHP_EOL . $this->_t(2) . "\$user = JFactory::getUser();"; + $toolBar + = "JFactory::getApplication()->input->set('hidemainmenu', true);"; + $toolBar .= PHP_EOL . $this->_t(2) + . "\$user = JFactory::getUser();"; $toolBar .= PHP_EOL . $this->_t(2) . "\$userId = \$user->id;"; - $toolBar .= PHP_EOL . $this->_t(2) . "\$isNew = \$this->item->id == 0;"; - $toolBar .= PHP_EOL . PHP_EOL . $this->_t(2) . "JToolbarHelper::title( JText:" . ":_(\$isNew ? '" . $viewNameLang_new . "' : '" . $viewNameLang_edit . "'), 'pencil-2 article-add');"; - $toolBar .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Built the actions for new and existing records."; - $toolBar .= PHP_EOL . $this->_t(2) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]. "Helper::checkString(\$this->referral))"; + $toolBar .= PHP_EOL . $this->_t(2) + . "\$isNew = \$this->item->id == 0;"; + $toolBar .= PHP_EOL . PHP_EOL . $this->_t(2) + . "JToolbarHelper::title( JText:" . ":_(\$isNew ? '" + . $viewNameLang_new . "' : '" . $viewNameLang_edit + . "'), 'pencil-2 article-add');"; + $toolBar .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Built the actions for new and existing records."; + $toolBar .= PHP_EOL . $this->_t(2) . "if (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::checkString(\$this->referral))"; $toolBar .= PHP_EOL . $this->_t(2) . "{"; - if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName, $this->permissionBuilder['global'][$core['core.create']])) + if ($coreLoad && isset($core['core.create']) + && isset($this->permissionBuilder['global'][$core['core.create']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.create']] + ) + && in_array( + $viewName, + $this->permissionBuilder['global'][$core['core.create']] + )) { - $toolBar .= PHP_EOL . $this->_t(3) . "if (\$this->canDo->get('" . $core['core.create'] . "') && \$isNew)"; + $toolBar .= PHP_EOL . $this->_t(3) . "if (\$this->canDo->get('" + . $core['core.create'] . "') && \$isNew)"; } else { - $toolBar .= PHP_EOL . $this->_t(3) . "if (\$this->canDo->get('core.create') && \$isNew)"; + $toolBar .= PHP_EOL . $this->_t(3) + . "if (\$this->canDo->get('core.create') && \$isNew)"; } $toolBar .= PHP_EOL . $this->_t(3) . "{"; - $toolBar .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " We can create the record."; - $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::save('" . $viewName . ".save', 'JTOOLBAR_SAVE');"; + $toolBar .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) + . " We can create the record."; + $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::save('" + . $viewName . ".save', 'JTOOLBAR_SAVE');"; $toolBar .= PHP_EOL . $this->_t(3) . "}"; - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName, $this->permissionBuilder['global'][$core['core.edit']])) + if ($coreLoad && isset($core['core.edit']) + && isset($this->permissionBuilder['global'][$core['core.edit']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.edit']] + ) + && in_array( + $viewName, + $this->permissionBuilder['global'][$core['core.edit']] + )) { - $toolBar .= PHP_EOL . $this->_t(3) . "elseif (\$this->canDo->get('" . $core['core.edit'] . "'))"; + $toolBar .= PHP_EOL . $this->_t(3) + . "elseif (\$this->canDo->get('" . $core['core.edit'] + . "'))"; } else { - $toolBar .= PHP_EOL . $this->_t(3) . "elseif (\$this->canDo->get('core.edit'))"; + $toolBar .= PHP_EOL . $this->_t(3) + . "elseif (\$this->canDo->get('core.edit'))"; } $toolBar .= PHP_EOL . $this->_t(3) . "{"; - $toolBar .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " We can save the record."; - $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::save('" . $viewName . ".save', 'JTOOLBAR_SAVE');"; + $toolBar .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) + . " We can save the record."; + $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::save('" + . $viewName . ".save', 'JTOOLBAR_SAVE');"; $toolBar .= PHP_EOL . $this->_t(3) . "}"; $toolBar .= PHP_EOL . $this->_t(3) . "if (\$isNew)"; $toolBar .= PHP_EOL . $this->_t(3) . "{"; - $toolBar .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Do not creat but cancel."; - $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::cancel('" . $viewName . ".cancel', 'JTOOLBAR_CANCEL');"; + $toolBar .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) + . " Do not creat but cancel."; + $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::cancel('" + . $viewName . ".cancel', 'JTOOLBAR_CANCEL');"; $toolBar .= PHP_EOL . $this->_t(3) . "}"; $toolBar .= PHP_EOL . $this->_t(3) . "else"; $toolBar .= PHP_EOL . $this->_t(3) . "{"; - $toolBar .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " We can close it."; - $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::cancel('" . $viewName . ".cancel', 'JTOOLBAR_CLOSE');"; + $toolBar .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) + . " We can close it."; + $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::cancel('" + . $viewName . ".cancel', 'JTOOLBAR_CLOSE');"; $toolBar .= PHP_EOL . $this->_t(3) . "}"; $toolBar .= PHP_EOL . $this->_t(2) . "}"; $toolBar .= PHP_EOL . $this->_t(2) . "else"; $toolBar .= PHP_EOL . $this->_t(2) . "{"; $toolBar .= PHP_EOL . $this->_t(3) . "if (\$isNew)"; $toolBar .= PHP_EOL . $this->_t(3) . "{"; - $toolBar .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " For new records, check the create permission."; - if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName, $this->permissionBuilder['global'][$core['core.create']])) + $toolBar .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) + . " For new records, check the create permission."; + if ($coreLoad && isset($core['core.create']) + && isset($this->permissionBuilder['global'][$core['core.create']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.create']] + ) + && in_array( + $viewName, + $this->permissionBuilder['global'][$core['core.create']] + )) { - $toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->canDo->get('" . $core['core.create'] . "'))"; + $toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->canDo->get('" + . $core['core.create'] . "'))"; } else { - $toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->canDo->get('core.create'))"; + $toolBar .= PHP_EOL . $this->_t(4) + . "if (\$this->canDo->get('core.create'))"; } $toolBar .= PHP_EOL . $this->_t(4) . "{"; - $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::apply('" . $viewName . ".apply', 'JTOOLBAR_APPLY');"; - $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::save('" . $viewName . ".save', 'JTOOLBAR_SAVE');"; - $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::custom('" . $viewName . ".save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);"; + $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::apply('" + . $viewName . ".apply', 'JTOOLBAR_APPLY');"; + $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::save('" + . $viewName . ".save', 'JTOOLBAR_SAVE');"; + $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::custom('" + . $viewName + . ".save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);"; $toolBar .= PHP_EOL . $this->_t(4) . "};"; - $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::cancel('" . $viewName . ".cancel', 'JTOOLBAR_CANCEL');"; + $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::cancel('" + . $viewName . ".cancel', 'JTOOLBAR_CANCEL');"; $toolBar .= PHP_EOL . $this->_t(3) . "}"; $toolBar .= PHP_EOL . $this->_t(3) . "else"; $toolBar .= PHP_EOL . $this->_t(3) . "{"; - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName, $this->permissionBuilder['global'][$core['core.edit']])) + if ($coreLoad && isset($core['core.edit']) + && isset($this->permissionBuilder['global'][$core['core.edit']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.edit']] + ) + && in_array( + $viewName, + $this->permissionBuilder['global'][$core['core.edit']] + )) { - $toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->canDo->get('" . $core['core.edit'] . "'))"; + $toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->canDo->get('" + . $core['core.edit'] . "'))"; } else { - $toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->canDo->get('core.edit'))"; + $toolBar .= PHP_EOL . $this->_t(4) + . "if (\$this->canDo->get('core.edit'))"; } $toolBar .= PHP_EOL . $this->_t(4) . "{"; - $toolBar .= PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) . " We can save the new record"; - $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::apply('" . $viewName . ".apply', 'JTOOLBAR_APPLY');"; - $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::save('" . $viewName . ".save', 'JTOOLBAR_SAVE');"; - $toolBar .= PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) . " We can save this record, but check the create permission to see"; - $toolBar .= PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) . " if we can return to make a new one."; - if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName, $this->permissionBuilder['global'][$core['core.create']])) + $toolBar .= PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) + . " We can save the new record"; + $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::apply('" + . $viewName . ".apply', 'JTOOLBAR_APPLY');"; + $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::save('" + . $viewName . ".save', 'JTOOLBAR_SAVE');"; + $toolBar .= PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) + . " We can save this record, but check the create permission to see"; + $toolBar .= PHP_EOL . $this->_t(5) . "//" . $this->setLine(__LINE__) + . " if we can return to make a new one."; + if ($coreLoad && isset($core['core.create']) + && isset($this->permissionBuilder['global'][$core['core.create']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.create']] + ) + && in_array( + $viewName, + $this->permissionBuilder['global'][$core['core.create']] + )) { - $toolBar .= PHP_EOL . $this->_t(5) . "if (\$this->canDo->get('" . $core['core.create'] . "'))"; + $toolBar .= PHP_EOL . $this->_t(5) . "if (\$this->canDo->get('" + . $core['core.create'] . "'))"; } else { - $toolBar .= PHP_EOL . $this->_t(5) . "if (\$this->canDo->get('core.create'))"; + $toolBar .= PHP_EOL . $this->_t(5) + . "if (\$this->canDo->get('core.create'))"; } $toolBar .= PHP_EOL . $this->_t(5) . "{"; - $toolBar .= PHP_EOL . $this->_t(6) . "JToolBarHelper::custom('" . $viewName . ".save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);"; + $toolBar .= PHP_EOL . $this->_t(6) . "JToolBarHelper::custom('" + . $viewName + . ".save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);"; $toolBar .= PHP_EOL . $this->_t(5) . "}"; $toolBar .= PHP_EOL . $this->_t(4) . "}"; - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName, $this->permissionBuilder['global'][$core['core.edit']])) + if ($coreLoad && isset($core['core.edit']) + && isset($this->permissionBuilder['global'][$core['core.edit']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.edit']] + ) + && in_array( + $viewName, + $this->permissionBuilder['global'][$core['core.edit']] + )) { - if ($coreLoad && isset($this->historyBuilder[$viewName]) && ComponentbuilderHelper::checkString($this->historyBuilder[$viewName])) + if ($coreLoad && isset($this->historyBuilder[$viewName]) + && ComponentbuilderHelper::checkString( + $this->historyBuilder[$viewName] + )) { - $toolBar .= PHP_EOL . $this->_t(4) . "\$canVersion = (\$this->canDo->get('core.version') && \$this->canDo->get('" . $core['core.version'] . "'));"; - $toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->state->params->get('save_history', 1) && \$this->canDo->get('" . $core['core.edit'] . "') && \$canVersion)"; + $toolBar .= PHP_EOL . $this->_t(4) + . "\$canVersion = (\$this->canDo->get('core.version') && \$this->canDo->get('" + . $core['core.version'] . "'));"; + $toolBar .= PHP_EOL . $this->_t(4) + . "if (\$this->state->params->get('save_history', 1) && \$this->canDo->get('" + . $core['core.edit'] . "') && \$canVersion)"; $toolBar .= PHP_EOL . $this->_t(4) . "{"; - $toolBar .= PHP_EOL . $this->_t(5) . "JToolbarHelper::versions('com_" . $this->componentCodeName . "." . $viewName . "', \$this->item->id);"; + $toolBar .= PHP_EOL . $this->_t(5) + . "JToolbarHelper::versions('com_" + . $this->componentCodeName . "." . $viewName + . "', \$this->item->id);"; $toolBar .= PHP_EOL . $this->_t(4) . "}"; } } else { - if ($coreLoad && isset($this->historyBuilder[$viewName]) && ComponentbuilderHelper::checkString($this->historyBuilder[$viewName])) + if ($coreLoad && isset($this->historyBuilder[$viewName]) + && ComponentbuilderHelper::checkString( + $this->historyBuilder[$viewName] + )) { - $toolBar .= PHP_EOL . $this->_t(4) . "\$canVersion = (\$this->canDo->get('core.version') && \$this->canDo->get('" . $core['core.version'] . "'));"; - $toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->state->params->get('save_history', 1) && \$this->canDo->get('core.edit') && \$canVersion)"; + $toolBar .= PHP_EOL . $this->_t(4) + . "\$canVersion = (\$this->canDo->get('core.version') && \$this->canDo->get('" + . $core['core.version'] . "'));"; + $toolBar .= PHP_EOL . $this->_t(4) + . "if (\$this->state->params->get('save_history', 1) && \$this->canDo->get('core.edit') && \$canVersion)"; $toolBar .= PHP_EOL . $this->_t(4) . "{"; - $toolBar .= PHP_EOL . $this->_t(5) . "JToolbarHelper::versions('com_" . $this->componentCodeName . "." . $viewName . "', \$this->item->id);"; + $toolBar .= PHP_EOL . $this->_t(5) + . "JToolbarHelper::versions('com_" + . $this->componentCodeName . "." . $viewName + . "', \$this->item->id);"; $toolBar .= PHP_EOL . $this->_t(4) . "}"; } } - if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName, $this->permissionBuilder['global'][$core['core.create']])) + if ($coreLoad && isset($core['core.create']) + && isset($this->permissionBuilder['global'][$core['core.create']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.create']] + ) + && in_array( + $viewName, + $this->permissionBuilder['global'][$core['core.create']] + )) { - $toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->canDo->get('" . $core['core.create'] . "'))"; + $toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->canDo->get('" + . $core['core.create'] . "'))"; } else { - $toolBar .= PHP_EOL . $this->_t(4) . "if (\$this->canDo->get('core.create'))"; + $toolBar .= PHP_EOL . $this->_t(4) + . "if (\$this->canDo->get('core.create'))"; } $toolBar .= PHP_EOL . $this->_t(4) . "{"; - $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::custom('" . $viewName . ".save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);"; + $toolBar .= PHP_EOL . $this->_t(5) . "JToolBarHelper::custom('" + . $viewName + . ".save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);"; $toolBar .= PHP_EOL . $this->_t(4) . "}"; // add custom buttons $toolBar .= $this->setCustomButtons($view, 2, $this->_t(2)); - $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::cancel('" . $viewName . ".cancel', 'JTOOLBAR_CLOSE');"; + $toolBar .= PHP_EOL . $this->_t(4) . "JToolBarHelper::cancel('" + . $viewName . ".cancel', 'JTOOLBAR_CLOSE');"; $toolBar .= PHP_EOL . $this->_t(3) . "}"; $toolBar .= PHP_EOL . $this->_t(2) . "}"; $toolBar .= PHP_EOL . $this->_t(2) . "JToolbarHelper::divider();"; - $toolBar .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " set help url for this view if found"; - $toolBar .= PHP_EOL . $this->_t(2) . "\$help_url = " . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::getHelpUrl('" . $viewName . "');"; - $toolBar .= PHP_EOL . $this->_t(2) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkString(\$help_url))"; + $toolBar .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " set help url for this view if found"; + $toolBar .= PHP_EOL . $this->_t(2) . "\$help_url = " + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::getHelpUrl('" . $viewName . "');"; + $toolBar .= PHP_EOL . $this->_t(2) . "if (" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::checkString(\$help_url))"; $toolBar .= PHP_EOL . $this->_t(2) . "{"; - $toolBar .= PHP_EOL . $this->_t(3) . "JToolbarHelper::help('" . $this->langPrefix . "_HELP_MANAGER', false, \$help_url);"; + $toolBar .= PHP_EOL . $this->_t(3) . "JToolbarHelper::help('" + . $this->langPrefix . "_HELP_MANAGER', false, \$help_url);"; $toolBar .= PHP_EOL . $this->_t(2) . "}"; } + return $toolBar; } @@ -12739,7 +19346,8 @@ class Interpretation extends Fields $donelist = array(); // add the rest of the set filters - if (isset($this->sortBuilder[$view]) && ComponentbuilderHelper::checkArray($this->sortBuilder[$view])) + if (isset($this->sortBuilder[$view]) + && ComponentbuilderHelper::checkArray($this->sortBuilder[$view])) { foreach ($this->sortBuilder[$view] as $filter) { @@ -12755,14 +19363,24 @@ class Interpretation extends Fields { $spacer = PHP_EOL . PHP_EOL . $this->_t(2); } - $state .= $spacer . "\$category = \$app->getUserStateFromRequest(\$this->context . '.filter.category', 'filter_category');"; - $state .= PHP_EOL . $this->_t(2) . "\$this->setState('filter.category', \$category);"; - $state .= PHP_EOL . PHP_EOL . $this->_t(2) . "\$categoryId = \$this->getUserStateFromRequest(\$this->context . '.filter.category_id', 'filter_category_id');"; - $state .= PHP_EOL . $this->_t(2) . "\$this->setState('filter.category_id', \$categoryId);"; + $state .= $spacer + . "\$category = \$app->getUserStateFromRequest(\$this->context . '.filter.category', 'filter_category');"; + $state .= PHP_EOL . $this->_t(2) + . "\$this->setState('filter.category', \$category);"; + $state .= PHP_EOL . PHP_EOL . $this->_t(2) + . "\$categoryId = \$this->getUserStateFromRequest(\$this->context . '.filter.category_id', 'filter_category_id');"; + $state .= PHP_EOL . $this->_t(2) + . "\$this->setState('filter.category_id', \$categoryId);"; if ($filter['code'] != 'category') { - $state .= PHP_EOL . PHP_EOL . $this->_t(2) . "\$" . $filter['code'] . " = \$app->getUserStateFromRequest(\$this->context . '.filter." . $filter['code'] . "', 'filter_" . $filter['code'] . "');"; - $state .= PHP_EOL . $this->_t(2) . "\$this->setState('filter." . $filter['code'] . "', \$" . $filter['code'] . ");"; + $state .= PHP_EOL . PHP_EOL . $this->_t(2) . "\$" + . $filter['code'] + . " = \$app->getUserStateFromRequest(\$this->context . '.filter." + . $filter['code'] . "', 'filter_" + . $filter['code'] . "');"; + $state .= PHP_EOL . $this->_t(2) + . "\$this->setState('filter." . $filter['code'] + . "', \$" . $filter['code'] . ");"; } } else @@ -12782,15 +19400,21 @@ class Interpretation extends Fields $state .= PHP_EOL.$this->_t(2) . "\$this->setState('filter.".$filter['code']."_".$filter['custom']['text']."', \$".$filter['code']."_".$filter['custom']['text'].");"; $spacer = PHP_EOL.PHP_EOL.$this->_t(2); } */ - $state .= $spacer . "\$" . $filter['code'] . " = \$this->getUserStateFromRequest(\$this->context . '.filter." . $filter['code'] . "', 'filter_" . $filter['code'] . "');"; - $state .= PHP_EOL . $this->_t(2) . "\$this->setState('filter." . $filter['code'] . "', \$" . $filter['code'] . ");"; + $state .= $spacer . "\$" . $filter['code'] + . " = \$this->getUserStateFromRequest(\$this->context . '.filter." + . $filter['code'] . "', 'filter_" . $filter['code'] + . "');"; + $state .= PHP_EOL . $this->_t(2) + . "\$this->setState('filter." . $filter['code'] + . "', \$" . $filter['code'] . ");"; } $donelist[] = $filter['code']; } } } // add the rest of the set filters - if (isset($this->filterBuilder[$view]) && ComponentbuilderHelper::checkArray($this->filterBuilder[$view])) + if (isset($this->filterBuilder[$view]) + && ComponentbuilderHelper::checkArray($this->filterBuilder[$view])) { foreach ($this->filterBuilder[$view] as $filter) { @@ -12806,14 +19430,24 @@ class Interpretation extends Fields { $spacer = PHP_EOL . PHP_EOL . $this->_t(2); } - $state .= $spacer . "\$category = \$app->getUserStateFromRequest(\$this->context . '.filter.category', 'filter_category');"; - $state .= PHP_EOL . $this->_t(2) . "\$this->setState('filter.category', \$category);"; - $state .= PHP_EOL . PHP_EOL . $this->_t(2) . "\$categoryId = \$this->getUserStateFromRequest(\$this->context . '.filter.category_id', 'filter_category_id');"; - $state .= PHP_EOL . $this->_t(2) . "\$this->setState('filter.category_id', \$categoryId);"; + $state .= $spacer + . "\$category = \$app->getUserStateFromRequest(\$this->context . '.filter.category', 'filter_category');"; + $state .= PHP_EOL . $this->_t(2) + . "\$this->setState('filter.category', \$category);"; + $state .= PHP_EOL . PHP_EOL . $this->_t(2) + . "\$categoryId = \$this->getUserStateFromRequest(\$this->context . '.filter.category_id', 'filter_category_id');"; + $state .= PHP_EOL . $this->_t(2) + . "\$this->setState('filter.category_id', \$categoryId);"; if ($filter['code'] != 'category') { - $state .= PHP_EOL . PHP_EOL . $this->_t(2) . "\$" . $filter['code'] . " = \$app->getUserStateFromRequest(\$this->context . '.filter." . $filter['code'] . "', 'filter_" . $filter['code'] . "');"; - $state .= PHP_EOL . $this->_t(2) . "\$this->setState('filter." . $filter['code'] . "', \$" . $filter['code'] . ");"; + $state .= PHP_EOL . PHP_EOL . $this->_t(2) . "\$" + . $filter['code'] + . " = \$app->getUserStateFromRequest(\$this->context . '.filter." + . $filter['code'] . "', 'filter_" + . $filter['code'] . "');"; + $state .= PHP_EOL . $this->_t(2) + . "\$this->setState('filter." . $filter['code'] + . "', \$" . $filter['code'] . ");"; } } else @@ -12835,13 +19469,19 @@ class Interpretation extends Fields $state .= PHP_EOL.$this->_t(2) . "\$this->setState('filter.".$filter['code']."_".$filter['custom']['text']."', \$".$filter['code']."_".$filter['custom']['text'].");"; $spacer = PHP_EOL.PHP_EOL.$this->_t(2); } */ - $state .= $spacer . "\$" . $filter['code'] . " = \$this->getUserStateFromRequest(\$this->context . '.filter." . $filter['code'] . "', 'filter_" . $filter['code'] . "');"; - $state .= PHP_EOL . $this->_t(2) . "\$this->setState('filter." . $filter['code'] . "', \$" . $filter['code'] . ");"; + $state .= $spacer . "\$" . $filter['code'] + . " = \$this->getUserStateFromRequest(\$this->context . '.filter." + . $filter['code'] . "', 'filter_" . $filter['code'] + . "');"; + $state .= PHP_EOL . $this->_t(2) + . "\$this->setState('filter." . $filter['code'] + . "', \$" . $filter['code'] . ");"; } $donelist[] = $filter['code']; } } } + return $state; } @@ -12851,11 +19491,14 @@ class Interpretation extends Fields $donelist = array('sorting', 'published'); // set the default first $fields = "return array("; - $fields .= PHP_EOL . $this->_t(3) . "'a.sorting' => JText:" . ":_('JGRID_HEADING_ORDERING')"; - $fields .= "," . PHP_EOL . $this->_t(3) . "'a.published' => JText:" . ":_('JSTATUS')"; + $fields .= PHP_EOL . $this->_t(3) . "'a.sorting' => JText:" + . ":_('JGRID_HEADING_ORDERING')"; + $fields .= "," . PHP_EOL . $this->_t(3) . "'a.published' => JText:" + . ":_('JSTATUS')"; // add the rest of the set filters - if (isset($this->sortBuilder[$view]) && ComponentbuilderHelper::checkArray($this->sortBuilder[$view])) + if (isset($this->sortBuilder[$view]) + && ComponentbuilderHelper::checkArray($this->sortBuilder[$view])) { foreach ($this->sortBuilder[$view] as $filter) { @@ -12863,28 +19506,40 @@ class Interpretation extends Fields { if ($filter['type'] === 'category') { - $fields .= "," . PHP_EOL . $this->_t(3) . "'c.category_title' => JText:" . ":_('" . $filter['lang'] . "')"; + $fields .= "," . PHP_EOL . $this->_t(3) + . "'c.category_title' => JText:" . ":_('" + . $filter['lang'] . "')"; } - elseif (ComponentbuilderHelper::checkArray($filter['custom'])) + elseif (ComponentbuilderHelper::checkArray( + $filter['custom'] + )) { - $fields .= "," . PHP_EOL . $this->_t(3) . "'" . $filter['custom']['db'] . "." . $filter['custom']['text'] . "' => JText:" . ":_('" . $filter['lang'] . "')"; + $fields .= "," . PHP_EOL . $this->_t(3) . "'" + . $filter['custom']['db'] . "." + . $filter['custom']['text'] . "' => JText:" . ":_('" + . $filter['lang'] . "')"; } else { - $fields .= "," . PHP_EOL . $this->_t(3) . "'a." . $filter['code'] . "' => JText:" . ":_('" . $filter['lang'] . "')"; + $fields .= "," . PHP_EOL . $this->_t(3) . "'a." + . $filter['code'] . "' => JText:" . ":_('" + . $filter['lang'] . "')"; } } } } - $fields .= "," . PHP_EOL . $this->_t(3) . "'a.id' => JText:" . ":_('JGRID_HEADING_ID')"; + $fields .= "," . PHP_EOL . $this->_t(3) . "'a.id' => JText:" + . ":_('JGRID_HEADING_ID')"; $fields .= PHP_EOL . $this->_t(2) . ");"; + // return fields return $fields; } public function setCheckinCall() { - $call = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " check in items"; + $call = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " check in items"; $call .= PHP_EOL . $this->_t(2) . "\$this->checkInNow();" . PHP_EOL; return $call; @@ -12893,44 +19548,69 @@ class Interpretation extends Fields public function setAutoCheckin($view, $component) { $checkin = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $checkin .= PHP_EOL . $this->_t(1) . " * Build an SQL query to checkin all items left checked out longer then a set time."; + $checkin .= PHP_EOL . $this->_t(1) + . " * Build an SQL query to checkin all items left checked out longer then a set time."; $checkin .= PHP_EOL . $this->_t(1) . " *"; $checkin .= PHP_EOL . $this->_t(1) . " * @return a bool"; $checkin .= PHP_EOL . $this->_t(1) . " *"; $checkin .= PHP_EOL . $this->_t(1) . " */"; $checkin .= PHP_EOL . $this->_t(1) . "protected function checkInNow()"; $checkin .= PHP_EOL . $this->_t(1) . "{"; - $checkin .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get set check in time"; - $checkin .= PHP_EOL . $this->_t(2) . "\$time = JComponentHelper::getParams('com_" . $component . "')->get('check_in');"; + $checkin .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " Get set check in time"; + $checkin .= PHP_EOL . $this->_t(2) + . "\$time = JComponentHelper::getParams('com_" . $component + . "')->get('check_in');"; $checkin .= PHP_EOL . PHP_EOL . $this->_t(2) . "if (\$time)"; $checkin .= PHP_EOL . $this->_t(2) . "{"; - $checkin .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get a db connection."; + $checkin .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " Get a db connection."; $checkin .= PHP_EOL . $this->_t(3) . "\$db = JFactory::getDbo();"; - $checkin .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " reset query"; + $checkin .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + . " reset query"; $checkin .= PHP_EOL . $this->_t(3) . "\$query = \$db->getQuery(true);"; $checkin .= PHP_EOL . $this->_t(3) . "\$query->select('*');"; - $checkin .= PHP_EOL . $this->_t(3) . "\$query->from(\$db->quoteName('#__" . $component . "_" . $view . "'));"; + $checkin .= PHP_EOL . $this->_t(3) + . "\$query->from(\$db->quoteName('#__" . $component . "_" . $view + . "'));"; $checkin .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query);"; $checkin .= PHP_EOL . $this->_t(3) . "\$db->execute();"; $checkin .= PHP_EOL . $this->_t(3) . "if (\$db->getNumRows())"; $checkin .= PHP_EOL . $this->_t(3) . "{"; - $checkin .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Get Yesterdays date"; - $checkin .= PHP_EOL . $this->_t(4) . "\$date = JFactory::getDate()->modify(\$time)->toSql();"; - $checkin .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " reset query"; + $checkin .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) + . " Get Yesterdays date"; + $checkin .= PHP_EOL . $this->_t(4) + . "\$date = JFactory::getDate()->modify(\$time)->toSql();"; + $checkin .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) + . " reset query"; $checkin .= PHP_EOL . $this->_t(4) . "\$query = \$db->getQuery(true);"; - $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Fields to update."; + $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) . "//" . $this->setLine( + __LINE__ + ) . " Fields to update."; $checkin .= PHP_EOL . $this->_t(4) . "\$fields = array("; - $checkin .= PHP_EOL . $this->_t(5) . "\$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',"; - $checkin .= PHP_EOL . $this->_t(5) . "\$db->quoteName('checked_out') . '=0'"; + $checkin .= PHP_EOL . $this->_t(5) + . "\$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',"; + $checkin .= PHP_EOL . $this->_t(5) + . "\$db->quoteName('checked_out') . '=0'"; $checkin .= PHP_EOL . $this->_t(4) . ");"; - $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Conditions for which records should be updated."; + $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) . "//" . $this->setLine( + __LINE__ + ) . " Conditions for which records should be updated."; $checkin .= PHP_EOL . $this->_t(4) . "\$conditions = array("; - $checkin .= PHP_EOL . $this->_t(5) . "\$db->quoteName('checked_out') . '!=0', "; - $checkin .= PHP_EOL . $this->_t(5) . "\$db->quoteName('checked_out_time') . '<\''.\$date.'\''"; + $checkin .= PHP_EOL . $this->_t(5) + . "\$db->quoteName('checked_out') . '!=0', "; + $checkin .= PHP_EOL . $this->_t(5) + . "\$db->quoteName('checked_out_time') . '<\''.\$date.'\''"; $checkin .= PHP_EOL . $this->_t(4) . ");"; - $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " Check table"; - $checkin .= PHP_EOL . $this->_t(4) . "\$query->update(\$db->quoteName('#__" . $component . "_" . $view . "'))->set(\$fields)->where(\$conditions); "; - $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) . "\$db->setQuery(\$query);"; + $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) . "//" . $this->setLine( + __LINE__ + ) . " Check table"; + $checkin .= PHP_EOL . $this->_t(4) + . "\$query->update(\$db->quoteName('#__" . $component . "_" . $view + . "'))->set(\$fields)->where(\$conditions); "; + $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) + . "\$db->setQuery(\$query);"; $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) . "\$db->execute();"; $checkin .= PHP_EOL . $this->_t(3) . "}"; $checkin .= PHP_EOL . $this->_t(2) . "}"; @@ -12940,12 +19620,13 @@ class Interpretation extends Fields return $checkin; } - public function setGetItemsMethodStringFix($viewName_single, $viewName_list, $Component, $tab = '', $export = false, $all = false) - { + public function setGetItemsMethodStringFix($viewName_single, $viewName_list, + $Component, $tab = '', $export = false, $all = false + ) { // add the fix if this view has the need for it - $fix = ''; + $fix = ''; $forEachStart = ''; - $fix_access = ''; + $fix_access = ''; // encryption switches foreach ($this->cryptionTypes as $cryptionType) { @@ -12955,20 +19636,37 @@ class Interpretation extends Fields $coreLoad = false; if (isset($this->permissionCore[$viewName_single])) { - $core = $this->permissionCore[$viewName_single]; + $core = $this->permissionCore[$viewName_single]; $coreLoad = true; } $component = ComponentbuilderHelper::safeString($Component); // check if the item has permissions. - if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder[$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.access']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.access']])) + if ($coreLoad && isset($core['core.access']) + && isset($this->permissionBuilder[$core['core.access']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder[$core['core.access']] + ) + && in_array( + $viewName_single, $this->permissionBuilder[$core['core.access']] + )) { - $fix_access = PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Remove items the user can't access."; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$access = (\$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$item->id) && \$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "'));"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "if (!\$access)"; + $fix_access = PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" + . $this->setLine(__LINE__) + . " Remove items the user can't access."; + $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "\$access = (\$user->authorise('" . $core['core.access'] + . "', 'com_" . $component . "." . $viewName_single + . ".' . (int) \$item->id) && \$user->authorise('" + . $core['core.access'] . "', 'com_" . $component . "'));"; + $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "if (!\$access)"; $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "unset(\$items[\$nr]);"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "continue;"; - $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}" . PHP_EOL; + $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + . "unset(\$items[\$nr]);"; + $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + . "continue;"; + $fix_access .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}" + . PHP_EOL; } // get the correct array if ($export || $all) @@ -12980,21 +19678,31 @@ class Interpretation extends Fields $methodName = 'getItemsMethodListStringFixBuilder'; } // load the relations before modeling - if (isset($this->fieldRelations[$viewName_list]) && ComponentbuilderHelper::checkArray($this->fieldRelations[$viewName_list])) + if (isset($this->fieldRelations[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->fieldRelations[$viewName_list] + )) { - foreach ($this->fieldRelations[$viewName_list] as $field_id => $fields) + foreach ( + $this->fieldRelations[$viewName_list] as $field_id => $fields + ) { foreach ($fields as $area => $field) { if ($area == 1 && isset($field['code'])) { - $fix .= $this->setModelFieldRelation($field, $viewName_list, $tab); + $fix .= $this->setModelFieldRelation( + $field, $viewName_list, $tab + ); } } } } // open the values - if (isset($this->{$methodName}[$viewName_single]) && ComponentbuilderHelper::checkArray($this->{$methodName}[$viewName_single])) + if (isset($this->{$methodName}[$viewName_single]) + && ComponentbuilderHelper::checkArray( + $this->{$methodName}[$viewName_single] + )) { foreach ($this->{$methodName}[$viewName_single] as $item) { @@ -13002,30 +19710,30 @@ class Interpretation extends Fields { case 1: // JSON_STRING_ENCODE - $decode = 'json_decode'; + $decode = 'json_decode'; $suffix_decode = ', true'; break; case 2: // BASE_SIXTY_FOUR - $decode = 'base64_decode'; + $decode = 'base64_decode'; $suffix_decode = ''; break; case 3: // BASIC_ENCRYPTION_LOCALKEY - $decode = '$basic->decryptString'; - $basicCrypt = true; + $decode = '$basic->decryptString'; + $basicCrypt = true; $suffix_decode = ''; break; case 4: // WHMCS_ENCRYPTION_WHMCS - $decode = '$whmcs->decryptString'; - $whmcsCrypt = true; + $decode = '$whmcs->decryptString'; + $whmcsCrypt = true; $suffix_decode = ''; break; case 5: // MEDIUM_ENCRYPTION_LOCALFILE - $decode = '$medium->decryptString'; - $mediumCrypt = true; + $decode = '$medium->decryptString'; + $mediumCrypt = true; $suffix_decode = ''; break; case 6: @@ -13034,25 +19742,38 @@ class Interpretation extends Fields break; default: // JSON_ARRAY_ENCODE - $decode = 'json_decode'; + $decode = 'json_decode'; $suffix_decode = ', true'; // fallback on json $item['method'] = 1; break; } - if ($item['type'] === 'usergroup' && !$export && $item['method'] != 6) + if ($item['type'] === 'usergroup' && !$export + && $item['method'] != 6) { - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" . $this->setLine(__LINE__) . " decode " . $item['name']; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$" . $item['name'] . "Array = " . $decode . "(\$item->" . $item['name'] . $suffix_decode . ");"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "if (" . $Component . "Helper::checkArray(\$" . $item['name'] . "Array))"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" + . $this->setLine(__LINE__) . " decode " . $item['name']; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$" + . $item['name'] . "Array = " . $decode . "(\$item->" + . $item['name'] . $suffix_decode . ");"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "if (" . $Component . "Helper::checkArray(\$" + . $item['name'] . "Array))"; $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "\$" . $item['name'] . "Names = array();"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "foreach (\$" . $item['name'] . "Array as \$" . $item['name'] . ")"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "\$" + . $item['name'] . "Names = array();"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + . "foreach (\$" . $item['name'] . "Array as \$" + . $item['name'] . ")"; $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "{"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "\$" . $item['name'] . "Names[] = " . $Component . "Helper::getGroupName(\$" . $item['name'] . ");"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "\$" + . $item['name'] . "Names[] = " . $Component + . "Helper::getGroupName(\$" . $item['name'] . ");"; $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "}"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "\$item->" . $item['name'] . " = implode(', ', \$" . $item['name'] . "Names);"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + . "\$item->" . $item['name'] . " = implode(', ', \$" + . $item['name'] . "Names);"; $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}"; } /* elseif ($item['type'] === 'usergroup' && $export) @@ -13064,29 +19785,56 @@ class Interpretation extends Fields $fix .= PHP_EOL.$this->_t(1).$tab.$this->_t(4) . "\$item->".$item['name']." = implode('|',\$".$item['name']."Array);"; $fix .= PHP_EOL.$this->_t(1).$tab.$this->_t(3) . "}"; } */ - elseif ($item['translation'] && !$export && $item['method'] != 6) + elseif ($item['translation'] && !$export + && $item['method'] != 6) { - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" . $this->setLine(__LINE__) . " decode " . $item['name']; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$" . $item['name'] . "Array = " . $decode . "(\$item->" . $item['name'] . $suffix_decode . ");"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "if (" . $Component . "Helper::checkArray(\$" . $item['name'] . "Array))"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" + . $this->setLine(__LINE__) . " decode " . $item['name']; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$" + . $item['name'] . "Array = " . $decode . "(\$item->" + . $item['name'] . $suffix_decode . ");"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "if (" . $Component . "Helper::checkArray(\$" + . $item['name'] . "Array))"; $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "\$" . $item['name'] . "Names = array();"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "foreach (\$" . $item['name'] . "Array as \$" . $item['name'] . ")"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "\$" + . $item['name'] . "Names = array();"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + . "foreach (\$" . $item['name'] . "Array as \$" + . $item['name'] . ")"; $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "{"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "\$" . $item['name'] . "Names[] = JText:" . ":_(\$this->selectionTranslation(\$" . $item['name'] . ", '" . $item['name'] . "'));"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "\$" + . $item['name'] . "Names[] = JText:" + . ":_(\$this->selectionTranslation(\$" . $item['name'] + . ", '" . $item['name'] . "'));"; $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "}"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "\$item->" . $item['name'] . " = implode(', ', \$" . $item['name'] . "Names);"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + . "\$item->" . $item['name'] . " = implode(', ', \$" + . $item['name'] . "Names);"; $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}"; } else { - if ($item['method'] == 2 || $item['method'] == 3 || $item['method'] == 4 || $item['method'] == 5 || $item['method'] == 6) + if ($item['method'] == 2 || $item['method'] == 3 + || $item['method'] == 4 + || $item['method'] == 5 + || $item['method'] == 6) { // expert mode (dev must do it all) if ($item['method'] == 6) { - $_placeholder_for_field = array('[[[field]]]' => "\$item->" . $item['name']); - $fix .= $this->setPlaceholders(PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . implode(PHP_EOL . $this->_t(1) . $tab . $this->_t(3), $this->expertFieldModeling[$viewName_single][$item['name']]['get']), $_placeholder_for_field); + $_placeholder_for_field + = array('[[[field]]]' => "\$item->" + . $item['name']); + $fix .= $this->setPlaceholders( + PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . implode( + PHP_EOL . $this->_t(1) . $tab . $this->_t( + 3 + ), + $this->expertFieldModeling[$viewName_single][$item['name']]['get'] + ), $_placeholder_for_field + ); } else { @@ -13094,34 +19842,67 @@ class Interpretation extends Fields if ($item['method'] == 3) { $taber = $this->_t(1); - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "if (\$basickey && !is_numeric(\$item->" . $item['name'] . ") && \$item->" . $item['name'] . " === base64_encode(base64_decode(\$item->" . $item['name'] . ", true)))"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{"; + $fix .= PHP_EOL . $this->_t(1) . $tab + . $this->_t(3) + . "if (\$basickey && !is_numeric(\$item->" + . $item['name'] . ") && \$item->" + . $item['name'] + . " === base64_encode(base64_decode(\$item->" + . $item['name'] . ", true)))"; + $fix .= PHP_EOL . $this->_t(1) . $tab + . $this->_t(3) . "{"; } elseif ($item['method'] == 5) { $taber = $this->_t(1); - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "if (\$mediumkey && !is_numeric(\$item->" . $item['name'] . ") && \$item->" . $item['name'] . " === base64_encode(base64_decode(\$item->" . $item['name'] . ", true)))"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{"; + $fix .= PHP_EOL . $this->_t(1) . $tab + . $this->_t(3) + . "if (\$mediumkey && !is_numeric(\$item->" + . $item['name'] . ") && \$item->" + . $item['name'] + . " === base64_encode(base64_decode(\$item->" + . $item['name'] . ", true)))"; + $fix .= PHP_EOL . $this->_t(1) . $tab + . $this->_t(3) . "{"; } elseif ($item['method'] == 4) { $taber = $this->_t(1); - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "if (\$whmcskey && !is_numeric(\$item->" . $item['name'] . ") && \$item->" . $item['name'] . " === base64_encode(base64_decode(\$item->" . $item['name'] . ", true)))"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{"; + $fix .= PHP_EOL . $this->_t(1) . $tab + . $this->_t(3) + . "if (\$whmcskey && !is_numeric(\$item->" + . $item['name'] . ") && \$item->" + . $item['name'] + . " === base64_encode(base64_decode(\$item->" + . $item['name'] . ", true)))"; + $fix .= PHP_EOL . $this->_t(1) . $tab + . $this->_t(3) . "{"; } - if ($item['method'] == 3 || $item['method'] == 4 || $item['method'] == 5) + if ($item['method'] == 3 || $item['method'] == 4 + || $item['method'] == 5) { - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "//" . $this->setLine(__LINE__) . " decrypt " . $item['name']; + $fix .= PHP_EOL . $this->_t(1) . $tab + . $this->_t(4) . "//" . $this->setLine( + __LINE__ + ) . " decrypt " . $item['name']; } else { - $fix .= PHP_EOL . $this->_t(1) . $tab . $taber . $this->_t(3) . "//" . $this->setLine(__LINE__) . " decode " . $item['name']; + $fix .= PHP_EOL . $this->_t(1) . $tab . $taber + . $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " decode " . $item['name']; } - $fix .= PHP_EOL . $this->_t(1) . $tab . $taber . $this->_t(3) . "\$item->" . $item['name'] . " = " . $decode . "(\$item->" . $item['name'] . ");"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $taber + . $this->_t(3) . "\$item->" . $item['name'] + . " = " . $decode . "(\$item->" . $item['name'] + . ");"; - if ($item['method'] == 3 || $item['method'] == 4 || $item['method'] == 5) + if ($item['method'] == 3 || $item['method'] == 4 + || $item['method'] == 5) { - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}"; + $fix .= PHP_EOL . $this->_t(1) . $tab + . $this->_t(3) . "}"; } } } @@ -13129,50 +19910,111 @@ class Interpretation extends Fields { if ($export && $item['type'] === 'repeatable') { - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" . $this->setLine(__LINE__) . " decode repeatable " . $item['name']; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$" . $item['name'] . "Array = " . $decode . "(\$item->" . $item['name'] . $suffix_decode . ");"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "if (" . $Component . "Helper::checkArray(\$" . $item['name'] . "Array))"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "\$bucket" . $item['name'] . " = array();"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "foreach (\$" . $item['name'] . "Array as \$" . $item['name'] . "FieldName => \$" . $item['name'] . ")"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "{"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "if (" . $Component . "Helper::checkArray(\$" . $item['name'] . "))"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "{"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(6) . "\$bucket" . $item['name'] . "[] = \$" . $item['name'] . "FieldName . '<||VDM||>' . implode('<|VDM|>',\$" . $item['name'] . ");"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "}"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "}"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "//" . $this->setLine(__LINE__) . " make sure the bucket has values."; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "if (" . $Component . "Helper::checkArray(\$bucket" . $item['name'] . "))"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "{"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "//" . $this->setLine(__LINE__) . " clear the repeatable field."; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "unset(\$item->" . $item['name'] . ");"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "//" . $this->setLine(__LINE__) . " set repeatable field for export."; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "\$item->" . $item['name'] . " = implode('<|||VDM|||>',\$bucket" . $item['name'] . ");"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "//" . $this->setLine(__LINE__) . " unset the bucket."; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "unset(\$bucket" . $item['name'] . ");"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "}"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "//" . $this->setLine(__LINE__) + . " decode repeatable " . $item['name']; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "\$" . $item['name'] . "Array = " . $decode + . "(\$item->" . $item['name'] . $suffix_decode + . ");"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "if (" . $Component . "Helper::checkArray(\$" + . $item['name'] . "Array))"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "{"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + . "\$bucket" . $item['name'] . " = array();"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + . "foreach (\$" . $item['name'] . "Array as \$" + . $item['name'] . "FieldName => \$" + . $item['name'] . ")"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + . "{"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) + . "if (" . $Component . "Helper::checkArray(\$" + . $item['name'] . "))"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) + . "{"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(6) + . "\$bucket" . $item['name'] . "[] = \$" + . $item['name'] + . "FieldName . '<||VDM||>' . implode('<|VDM|>',\$" + . $item['name'] . ");"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) + . "}"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + . "}"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + . "//" . $this->setLine(__LINE__) + . " make sure the bucket has values."; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + . "if (" . $Component + . "Helper::checkArray(\$bucket" . $item['name'] + . "))"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + . "{"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) + . "//" . $this->setLine(__LINE__) + . " clear the repeatable field."; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) + . "unset(\$item->" . $item['name'] . ");"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) + . "//" . $this->setLine(__LINE__) + . " set repeatable field for export."; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) + . "\$item->" . $item['name'] + . " = implode('<|||VDM|||>',\$bucket" + . $item['name'] . ");"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) + . "//" . $this->setLine(__LINE__) + . " unset the bucket."; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) + . "unset(\$bucket" . $item['name'] . ");"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) + . "}"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "}"; } elseif ($item['method'] == 1 && !$export) { // TODO we check if this works well. - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" . $this->setLine(__LINE__) . " convert " . $item['name']; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "//" . $this->setLine(__LINE__) . " convert " + . $item['name']; if (isset($item['custom']['table'])) { // check if this is a local table - if (strpos($item['custom']['table'], '#__' . $this->componentCodeName . '_') !== false) + if (strpos( + $item['custom']['table'], + '#__' . $this->componentCodeName . '_' + ) !== false) { - $keyTableNAme = str_replace('#__' . $this->componentCodeName . '_', '', $item['custom']['table']); + $keyTableNAme = str_replace( + '#__' . $this->componentCodeName . '_', + '', $item['custom']['table'] + ); } else { $keyTableNAme = $item['custom']['table']; } - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$item->" . $item['name'] . " = " . $Component . "Helper::jsonToString(\$item->" . $item['name'] . ", ', ', '" . $keyTableNAme . "', '" . $item['custom']['id'] . "', '" . $item['custom']['text'] . "');"; + $fix .= PHP_EOL . $this->_t(1) . $tab + . $this->_t(3) . "\$item->" . $item['name'] + . " = " . $Component + . "Helper::jsonToString(\$item->" + . $item['name'] . ", ', ', '" + . $keyTableNAme . "', '" + . $item['custom']['id'] . "', '" + . $item['custom']['text'] . "');"; } else { - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$item->" . $item['name'] . " = " . $Component . "Helper::jsonToString(\$item->" . $item['name'] . ", ', ', '" . $item['name'] . "');"; + $fix .= PHP_EOL . $this->_t(1) . $tab + . $this->_t(3) . "\$item->" . $item['name'] + . " = " . $Component + . "Helper::jsonToString(\$item->" + . $item['name'] . ", ', ', '" + . $item['name'] . "');"; } } else @@ -13180,8 +20022,15 @@ class Interpretation extends Fields if (!$export) { // For those we have not cached yet. - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" . $this->setLine(__LINE__) . " convert " . $item['name']; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$item->" . $item['name'] . " = " . $Component . "Helper::jsonToString(\$item->" . $item['name'] . ");"; + $fix .= PHP_EOL . $this->_t(1) . $tab + . $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " convert " . $item['name']; + $fix .= PHP_EOL . $this->_t(1) . $tab + . $this->_t(3) . "\$item->" . $item['name'] + . " = " . $Component + . "Helper::jsonToString(\$item->" + . $item['name'] . ");"; } } } @@ -13198,7 +20047,10 @@ class Interpretation extends Fields } } */ // load the relations after modeling - if (isset($this->fieldRelations[$viewName_list]) && ComponentbuilderHelper::checkArray($this->fieldRelations[$viewName_list])) + if (isset($this->fieldRelations[$viewName_list]) + && ComponentbuilderHelper::checkArray( + $this->fieldRelations[$viewName_list] + )) { foreach ($this->fieldRelations[$viewName_list] as $fields) { @@ -13206,37 +20058,64 @@ class Interpretation extends Fields { if ($area == 3 && isset($field['code'])) { - $fix .= $this->setModelFieldRelation($field, $viewName_list, $tab); + $fix .= $this->setModelFieldRelation( + $field, $viewName_list, $tab + ); } } } } // close the foreach if needed - if (ComponentbuilderHelper::checkString($fix) || ComponentbuilderHelper::checkString($fix_access) || $export || $all) + if (ComponentbuilderHelper::checkString($fix) + || ComponentbuilderHelper::checkString($fix_access) + || $export + || $all) { // start the loop - $forEachStart = PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Set values to display correctly."; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "if (" . $Component . "Helper::checkArray(\$items))"; + $forEachStart = PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t( + 1 + ) . "//" . $this->setLine(__LINE__) + . " Set values to display correctly."; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + . "if (" . $Component . "Helper::checkArray(\$items))"; $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; // do not add to export since it is already done if (!$export) { - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the user object if not set."; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "if (!isset(\$user) || !" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkObject(\$user))"; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "{"; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$user = JFactory::getUser();"; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "}"; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) + . "//" . $this->setLine(__LINE__) + . " Get the user object if not set."; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) + . "if (!isset(\$user) || !" + . $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . "Helper::checkObject(\$user))"; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) + . "{"; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "\$user = JFactory::getUser();"; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) + . "}"; } // the permissional acttion switch $hasPermissional = false; // add the permissional removal of values the user has not right to view or access - if ($this->strictFieldExportPermissions && isset($this->permissionFields[$viewName_single]) && ComponentbuilderHelper::checkArray($this->permissionFields[$viewName_single])) + if ($this->strictFieldExportPermissions + && isset($this->permissionFields[$viewName_single]) + && ComponentbuilderHelper::checkArray( + $this->permissionFields[$viewName_single] + )) { - foreach ($this->permissionFields[$viewName_single] as $fieldName => $permission_options) + foreach ( + $this->permissionFields[$viewName_single] as $fieldName => + $permission_options + ) { if (!$hasPermissional) { - foreach($permission_options as $permission_option => $fieldType) + foreach ( + $permission_options as $permission_option => + $fieldType + ) { if (!$hasPermissional) { @@ -13245,7 +20124,7 @@ class Interpretation extends Fields case 'access': case 'view': $hasPermissional = true; - break; + break; } } } @@ -13254,65 +20133,120 @@ class Interpretation extends Fields // add the notes and get the global switch if ($hasPermissional) { - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get global permissional control activation. (default is inactive)"; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "\$strict_permission_per_field = JComponentHelper::getParams('com_" . $component . "')->get('strict_permission_per_field', 0);" . PHP_EOL; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t( + 2 + ) . "//" . $this->setLine(__LINE__) + . " Get global permissional control activation. (default is inactive)"; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t( + 2 + ) + . "\$strict_permission_per_field = JComponentHelper::getParams('com_" + . $component + . "')->get('strict_permission_per_field', 0);" + . PHP_EOL; } } - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "foreach (\$items as \$nr => &\$item)"; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) + . "foreach (\$items as \$nr => &\$item)"; $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "{"; // add the access options $forEachStart .= $fix_access; // add the permissional removal of values the user has not right to view or access if ($hasPermissional) { - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" . $this->setLine(__LINE__) . " use permissional control if globaly set."; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "if (\$strict_permission_per_field)"; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "{"; - foreach ($this->permissionFields[$viewName_single] as $fieldName => $permission_options) + $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "//" . $this->setLine(__LINE__) + . " use permissional control if globaly set."; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "if (\$strict_permission_per_field)"; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "{"; + foreach ( + $this->permissionFields[$viewName_single] as $fieldName => + $permission_options + ) { - foreach($permission_options as $permission_option => $fieldType) + foreach ( + $permission_options as $permission_option => $fieldType + ) { switch ($permission_option) { case 'access': case 'view': - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "//" . $this->setLine(__LINE__) . " set " . $permission_option . " permissional control for " . $fieldName . " value."; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "if (isset(\$item->" . $fieldName . ") && (!\$user->authorise('" . $viewName_single . "." . $permission_option . "." . $fieldName . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$item->id)"; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "|| !\$user->authorise('" . $viewName_single . "." . $permission_option . "." . $fieldName . "', 'com_" . $component . "')))"; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "{"; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "//" . $this->setLine(__LINE__) . " We JUST empty the value (do you have a better idea)"; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(5) . "\$item->" . $fieldName . " = '';"; - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(4) . "}"; - break; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab + . $this->_t(4) . "//" . $this->setLine( + __LINE__ + ) . " set " . $permission_option + . " permissional control for " . $fieldName + . " value."; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab + . $this->_t(4) . "if (isset(\$item->" + . $fieldName . ") && (!\$user->authorise('" + . $viewName_single . "." + . $permission_option . "." . $fieldName + . "', 'com_" . $component . "." + . $viewName_single + . ".' . (int) \$item->id)"; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab + . $this->_t(5) . "|| !\$user->authorise('" + . $viewName_single . "." + . $permission_option . "." . $fieldName + . "', 'com_" . $component . "')))"; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab + . $this->_t(4) . "{"; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab + . $this->_t(5) . "//" . $this->setLine( + __LINE__ + ) + . " We JUST empty the value (do you have a better idea)"; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab + . $this->_t(5) . "\$item->" . $fieldName + . " = '';"; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab + . $this->_t(4) . "}"; + break; } } } - $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "}"; + $forEachStart .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "}"; } // remove these values if export if ($export) { - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" . $this->setLine(__LINE__) . " unset the values we don't want exported."; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "unset(\$item->asset_id);"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "unset(\$item->checked_out);"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "unset(\$item->checked_out_time);"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" + . $this->setLine(__LINE__) + . " unset the values we don't want exported."; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "unset(\$item->asset_id);"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "unset(\$item->checked_out);"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "unset(\$item->checked_out_time);"; } $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "}"; $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}"; if ($export) { - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Add headers to items array."; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$headers = \$this->getExImPortHeaders();"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "if (" . $Component . "Helper::checkObject(\$headers))"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" + . $this->setLine(__LINE__) . " Add headers to items array."; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + . "\$headers = \$this->getExImPortHeaders();"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "if (" + . $Component . "Helper::checkObject(\$headers))"; $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "array_unshift(\$items,\$headers);"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) + . "array_unshift(\$items,\$headers);"; $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}"; } } // add custom php to getitems method - $fix .= $this->getCustomScriptBuilder('php_getitems', $viewName_single, PHP_EOL . PHP_EOL . $tab); + $fix .= $this->getCustomScriptBuilder( + 'php_getitems', $viewName_single, PHP_EOL . PHP_EOL . $tab + ); // load the encryption object if needed $script = ''; @@ -13322,21 +20256,44 @@ class Interpretation extends Fields { if ('expert' !== $cryptionType) { - $script .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption key."; - $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; - $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Get the encryption object."; - $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; + $script .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab + . $this->_t(1) . "//" . $this->setLine(__LINE__) + . " Get the " . $cryptionType . " encryption key."; + $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + . "\$" . $cryptionType . "key = " . $Component + . "Helper::getCryptKey('" . $cryptionType . "');"; + $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + . "//" . $this->setLine(__LINE__) + . " Get the encryption object."; + $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + . "\$" . $cryptionType . " = new FOFEncryptAes(\$" + . $cryptionType . "key);"; } - elseif (isset($this->{$cryptionType . 'FieldModelInitiator'}[$viewName_single]) - && isset($this->{$cryptionType . 'FieldModelInitiator'}[$viewName_single]['get'])) + elseif (isset( + $this->{$cryptionType + . 'FieldModelInitiator'}[$viewName_single] + ) + && isset( + $this->{$cryptionType + . 'FieldModelInitiator'}[$viewName_single]['get'] + )) { - foreach ($this->{$cryptionType . 'FieldModelInitiator'}[$viewName_single]['get'] as $block) + foreach ( + $this->{$cryptionType + . 'FieldModelInitiator'}[$viewName_single]['get'] as + $block + ) { - $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . implode(PHP_EOL . $this->_t(1) . $tab . $this->_t(1), $block); + $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + . implode( + PHP_EOL . $this->_t(1) . $tab . $this->_t(1), + $block + ); } } } } + // add the encryption script return $script . $forEachStart . $fix; } @@ -13347,28 +20304,45 @@ class Interpretation extends Fields // set fields $field = array(); // set list field name - $field['$item->{' . (int) $item['listfield'] . '}'] = '$item->' . $item['code']; + $field['$item->{' . (int) $item['listfield'] . '}'] = '$item->' + . $item['code']; // load joint field names - if (isset($item['joinfields']) && ComponentbuilderHelper::checkArray($item['joinfields'])) + if (isset($item['joinfields']) + && ComponentbuilderHelper::checkArray( + $item['joinfields'] + )) { foreach ($item['joinfields'] as $join) { - $field['$item->{' . (int) $join . '}'] = '$item->' . $this->listJoinBuilder[$viewName_list][(int) $join]['code']; + $field['$item->{' . (int) $join . '}'] = '$item->' + . $this->listJoinBuilder[$viewName_list][(int) $join]['code']; } } // set based on join_type if ($item['join_type'] == 2) { // code - $code = (array) explode(PHP_EOL, str_replace(array_keys($field), array_values($field), $item['set'])); - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . implode(PHP_EOL . $this->_t(1) . $tab . $this->_t(3), $code); + $code = (array) explode( + PHP_EOL, str_replace( + array_keys($field), array_values($field), $item['set'] + ) + ); + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . implode( + PHP_EOL . $this->_t(1) . $tab . $this->_t(3), $code + ); } else { // concatenate - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" . $this->setLine(__LINE__) . " concatenate these fields"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$item->" . $item['code'] . ' = ' . implode(" . '" . str_replace("'", ''', $item['set']) . "' . ", $field) . ';'; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" + . $this->setLine(__LINE__) . " concatenate these fields"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$item->" + . $item['code'] . ' = ' . implode( + " . '" . str_replace("'", ''', $item['set']) . "' . ", + $field + ) . ';'; } + return $this->setPlaceholders($fix, $this->placeholders); } @@ -13376,21 +20350,37 @@ class Interpretation extends Fields { // add the fix if this view has the need for it $fix = ''; - if (isset($this->selectionTranslationFixBuilder[$views]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$views])) + if (isset($this->selectionTranslationFixBuilder[$views]) + && ComponentbuilderHelper::checkArray( + $this->selectionTranslationFixBuilder[$views] + )) { - $fix .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " set selection value to a translatable value"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "if (" . $Component . "Helper::checkArray(\$items))"; + $fix .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) + . "//" . $this->setLine(__LINE__) + . " set selection value to a translatable value"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "if (" + . $Component . "Helper::checkArray(\$items))"; $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "foreach (\$items as \$nr => &\$item)"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) + . "foreach (\$items as \$nr => &\$item)"; $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "{"; - foreach ($this->selectionTranslationFixBuilder[$views] as $name => $values) + foreach ( + $this->selectionTranslationFixBuilder[$views] as $name => + $values + ) { - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" . $this->setLine(__LINE__) . " convert " . $name; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "\$item->" . $name . " = \$this->selectionTranslation(\$item->" . $name . ", '" . $name . "');"; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) . "//" + . $this->setLine(__LINE__) . " convert " . $name; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(3) + . "\$item->" . $name + . " = \$this->selectionTranslation(\$item->" . $name . ", '" + . $name . "');"; } $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "}"; - $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}" . PHP_EOL; + $fix .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}" + . PHP_EOL; } + return $fix; } @@ -13398,23 +20388,35 @@ class Interpretation extends Fields { // add the fix if this view has the need for it $fix = ''; - if (isset($this->selectionTranslationFixBuilder[$views]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$views])) + if (isset($this->selectionTranslationFixBuilder[$views]) + && ComponentbuilderHelper::checkArray( + $this->selectionTranslationFixBuilder[$views] + )) { $fix .= PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; - $fix .= PHP_EOL . $this->_t(1) . " * Method to convert selection values to translatable string."; + $fix .= PHP_EOL . $this->_t(1) + . " * Method to convert selection values to translatable string."; $fix .= PHP_EOL . $this->_t(1) . " *"; $fix .= PHP_EOL . $this->_t(1) . " * @return translatable string"; $fix .= PHP_EOL . $this->_t(1) . " */"; - $fix .= PHP_EOL . $this->_t(1) . "public function selectionTranslation(\$value,\$name)"; + $fix .= PHP_EOL . $this->_t(1) + . "public function selectionTranslation(\$value,\$name)"; $fix .= PHP_EOL . $this->_t(1) . "{"; - foreach ($this->selectionTranslationFixBuilder[$views] as $name => $values) + foreach ( + $this->selectionTranslationFixBuilder[$views] as $name => + $values + ) { if (ComponentbuilderHelper::checkArray($values)) { - $fix .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Array of " . $name . " language strings"; - $fix .= PHP_EOL . $this->_t(2) . "if (\$name === '" . $name . "')"; - $fix .= PHP_EOL . $this->_t(2) . "{"; - $fix .= PHP_EOL . $this->_t(3) . "\$" . $name . "Array = array("; + $fix .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Array of " . $name . " language strings"; + $fix .= PHP_EOL . $this->_t(2) . "if (\$name === '" + . $name . "')"; + $fix .= PHP_EOL . $this->_t(2) . "{"; + $fix .= PHP_EOL . $this->_t(3) . "\$" . $name + . "Array = array("; $counter = 0; foreach ($values as $value => $translang) { @@ -13433,19 +20435,26 @@ class Interpretation extends Fields } if ($counter == 0) { - $fix .= PHP_EOL . $this->_t(4) . $key . " => '" . $translang . "'"; + $fix .= PHP_EOL . $this->_t(4) . $key . " => '" + . $translang . "'"; } else { - $fix .= "," . PHP_EOL . $this->_t(4) . $key . " => '" . $translang . "'"; + $fix .= "," . PHP_EOL . $this->_t(4) . $key + . " => '" . $translang . "'"; } $counter++; } $fix .= PHP_EOL . $this->_t(3) . ");"; - $fix .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Now check if value is found in this array"; - $fix .= PHP_EOL . $this->_t(3) . "if (isset(\$" . $name . "Array[\$value]) && " . $Component . "Helper::checkString(\$" . $name . "Array[\$value]))"; + $fix .= PHP_EOL . $this->_t(3) . "//" . $this->setLine( + __LINE__ + ) . " Now check if value is found in this array"; + $fix .= PHP_EOL . $this->_t(3) . "if (isset(\$" . $name + . "Array[\$value]) && " . $Component + . "Helper::checkString(\$" . $name . "Array[\$value]))"; $fix .= PHP_EOL . $this->_t(3) . "{"; - $fix .= PHP_EOL . $this->_t(4) . "return \$" . $name . "Array[\$value];"; + $fix .= PHP_EOL . $this->_t(4) . "return \$" . $name + . "Array[\$value];"; $fix .= PHP_EOL . $this->_t(3) . "}"; $fix .= PHP_EOL . $this->_t(2) . "}"; } @@ -13453,6 +20462,7 @@ class Interpretation extends Fields $fix .= PHP_EOL . $this->_t(2) . "return \$value;"; $fix .= PHP_EOL . $this->_t(1) . "}"; } + return $fix; } @@ -13461,13 +20471,16 @@ class Interpretation extends Fields if (strlen($viewName) > 0) { $router = PHP_EOL . $this->_t(2) . "case '" . $viewName . "':"; - $router .= PHP_EOL . $this->_t(3) . "\$id = explode(':', \$segments[$count-1]);"; + $router .= PHP_EOL . $this->_t(3) + . "\$id = explode(':', \$segments[$count-1]);"; $router .= PHP_EOL . $this->_t(3) . "\$vars['id'] = (int) \$id[0];"; - $router .= PHP_EOL . $this->_t(3) . "\$vars['view'] = '" . $viewName . "';"; + $router .= PHP_EOL . $this->_t(3) . "\$vars['view'] = '" . $viewName + . "';"; $router .= PHP_EOL . $this->_t(2) . "break;"; return $router; } + return ''; } @@ -13478,47 +20491,72 @@ class Interpretation extends Fields { $imagePath = $this->componentPath . '/admin/assets/images'; // move the image to its place - JFile::copy(JPATH_SITE . '/' . $path, $imagePath . '/vdm-component.' . $type, '', true); + JFile::copy( + JPATH_SITE . '/' . $path, + $imagePath . '/vdm-component.' . $type, '', true + ); // now set the type to global for re-use $this->componentImageType = $type; + // return image type return $type; } $this->componentImageType = 'jpg'; + return 'jpg'; } public function setDashboardIconAccess() { - if (isset($this->permissionDashboard) && ComponentbuilderHelper::checkArray($this->permissionDashboard)) + if (isset($this->permissionDashboard) + && ComponentbuilderHelper::checkArray($this->permissionDashboard)) { - $this->permissionDashboard = array_unique($this->permissionDashboard); - return PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " view access array" . PHP_EOL . $this->_t(2) . "\$viewAccess = array(" . PHP_EOL . $this->_t(3) . implode("," . PHP_EOL . $this->_t(3), $this->permissionDashboard) . ");"; + $this->permissionDashboard = array_unique( + $this->permissionDashboard + ); + + return PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) + . " view access array" . PHP_EOL . $this->_t(2) + . "\$viewAccess = array(" . PHP_EOL . $this->_t(3) . implode( + "," . PHP_EOL . $this->_t(3), $this->permissionDashboard + ) . ");"; } + return ''; } public function setDashboardIcons() { - if (isset($this->componentData->admin_views) && ComponentbuilderHelper::checkArray($this->componentData->admin_views)) + if (isset($this->componentData->admin_views) + && ComponentbuilderHelper::checkArray( + $this->componentData->admin_views + )) { - $icons = ''; - $counter = 0; + $icons = ''; + $counter = 0; $catArray = array(); foreach ($this->componentData->admin_views as $view) { - $name_single = ComponentbuilderHelper::safeString($view['settings']->name_single); - $name_list = ComponentbuilderHelper::safeString($view['settings']->name_list); + $name_single = ComponentbuilderHelper::safeString( + $view['settings']->name_single + ); + $name_list = ComponentbuilderHelper::safeString( + $view['settings']->name_list + ); $icons .= $this->addCustomDashboardIcons($view, $counter); - if (isset($view['dashboard_add']) && $view['dashboard_add'] == 1) + if (isset($view['dashboard_add']) + && $view['dashboard_add'] == 1) { - $type = ComponentbuilderHelper::imageInfo($view['settings']->icon_add); + $type = ComponentbuilderHelper::imageInfo( + $view['settings']->icon_add + ); if ($type) { $type = $type . "."; // icon builder loader - $this->iconBuilder[$type . $name_single . ".add"] = $view['settings']->icon_add; + $this->iconBuilder[$type . $name_single . ".add"] + = $view['settings']->icon_add; } else { @@ -13533,20 +20571,30 @@ class Interpretation extends Fields $icons .= ", '" . $type . $name_single . ".add'"; } // build lang - $langName = 'Add ' . ComponentbuilderHelper::safeString($view['settings']->name_single, 'W') . '

    '; - $langKey = $this->langPrefix . '_DASHBOARD_' . ComponentbuilderHelper::safeString($view['settings']->name_single, 'U') . '_ADD'; + $langName = 'Add ' + . ComponentbuilderHelper::safeString( + $view['settings']->name_single, 'W' + ) . '

    '; + $langKey = $this->langPrefix . '_DASHBOARD_' + . ComponentbuilderHelper::safeString( + $view['settings']->name_single, 'U' + ) . '_ADD'; // add to lang $this->setLangContent($this->lang, $langKey, $langName); $counter++; } - if (isset($view['dashboard_list']) && $view['dashboard_list'] == 1) + if (isset($view['dashboard_list']) + && $view['dashboard_list'] == 1) { - $type = ComponentbuilderHelper::imageInfo($view['settings']->icon); + $type = ComponentbuilderHelper::imageInfo( + $view['settings']->icon + ); if ($type) { $type = $type . "."; // icon builder loader - $this->iconBuilder[$type . $name_list] = $view['settings']->icon; + $this->iconBuilder[$type . $name_list] + = $view['settings']->icon; } else { @@ -13561,42 +20609,67 @@ class Interpretation extends Fields $icons .= ", '" . $type . $name_list . "'"; } // build lang - $langName = ComponentbuilderHelper::safeString($view['settings']->name_list, 'W') . '

    '; - $langKey = $this->langPrefix . '_DASHBOARD_' . ComponentbuilderHelper::safeString($view['settings']->name_list, 'U'); + $langName = ComponentbuilderHelper::safeString( + $view['settings']->name_list, 'W' + ) . '

    '; + $langKey = $this->langPrefix . '_DASHBOARD_' + . ComponentbuilderHelper::safeString( + $view['settings']->name_list, 'U' + ); // add to lang $this->setLangContent($this->lang, $langKey, $langName); $counter++; } - if (isset($this->categoryBuilder[$name_list]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$name_list])) + if (isset($this->categoryBuilder[$name_list]) + && ComponentbuilderHelper::checkArray( + $this->categoryBuilder[$name_list] + )) { $catCode = $this->categoryBuilder[$name_list]['code']; // check if category has another name - if (isset($this->catOtherName[$name_list]) && ComponentbuilderHelper::checkArray($this->catOtherName[$name_list])) + if (isset($this->catOtherName[$name_list]) + && ComponentbuilderHelper::checkArray( + $this->catOtherName[$name_list] + )) { $otherViews = $this->catOtherName[$name_list]['views']; $otherNames = $this->catOtherName[$name_list]['name']; // build lang - $langName = ComponentbuilderHelper::safeString($otherNames, 'W'); + $langName = ComponentbuilderHelper::safeString( + $otherNames, 'W' + ); } else { $otherViews = $name_list; // build lang - $langName = 'Categories For
    ' . ComponentbuilderHelper::safeString($otherViews, 'W'); + $langName = 'Categories For
    ' + . ComponentbuilderHelper::safeString( + $otherViews, 'W' + ); } if (!in_array($otherViews, $catArray)) { // add to lang - $langKey = $this->langPrefix . '_DASHBOARD_' . ComponentbuilderHelper::safeString($otherViews, 'U') . '_' . ComponentbuilderHelper::safeString($catCode, 'U'); + $langKey = $this->langPrefix . '_DASHBOARD_' + . ComponentbuilderHelper::safeString( + $otherViews, 'U' + ) . '_' . ComponentbuilderHelper::safeString( + $catCode, 'U' + ); $this->setLangContent($this->lang, $langKey, $langName); // get image type - $type = ComponentbuilderHelper::imageInfo($view['settings']->icon_category); + $type = ComponentbuilderHelper::imageInfo( + $view['settings']->icon_category + ); if ($type) { $type = $type . "."; // icon builder loader - $this->iconBuilder[$type . $otherViews . "." . $catCode] = $view['settings']->icon_category; + $this->iconBuilder[$type . $otherViews . "." + . $catCode] + = $view['settings']->icon_category; } else { @@ -13604,11 +20677,13 @@ class Interpretation extends Fields } if ($counter == 0) { - $icons .= "'" . $type . $otherViews . "." . $catCode . "'"; + $icons .= "'" . $type . $otherViews . "." . $catCode + . "'"; } else { - $icons .= ", '" . $type . $otherViews . "." . $catCode . "'"; + $icons .= ", '" . $type . $otherViews . "." + . $catCode . "'"; } $counter++; // make sure we add a category only once @@ -13616,7 +20691,10 @@ class Interpretation extends Fields } } } - if (isset($this->lastCustomDashboardIcon) && ComponentbuilderHelper::checkArray($this->lastCustomDashboardIcon)) + if (isset($this->lastCustomDashboardIcon) + && ComponentbuilderHelper::checkArray( + $this->lastCustomDashboardIcon + )) { foreach ($this->lastCustomDashboardIcon as $icon) { @@ -13624,9 +20702,13 @@ class Interpretation extends Fields } unset($this->lastCustomDashboardIcon); } - if (isset($this->iconBuilder) && ComponentbuilderHelper::checkArray($this->iconBuilder)) + if (isset($this->iconBuilder) + && ComponentbuilderHelper::checkArray( + $this->iconBuilder + )) { - $imagePath = $this->componentPath . '/admin/assets/images/icons'; + $imagePath = $this->componentPath + . '/admin/assets/images/icons'; foreach ($this->iconBuilder as $icon => $path) { $array_buket = explode('.', $icon); @@ -13649,30 +20731,49 @@ class Interpretation extends Fields $imageName = $name . '.' . $type; } // move the image to its place - JFile::copy(JPATH_SITE . '/' . $path, $imagePath . '/' . $imageName, '', true); + JFile::copy( + JPATH_SITE . '/' . $path, $imagePath . '/' . $imageName, + '', true + ); } } + return $icons; } + return false; } public function setDashboardModelMethods() { - if (isset($this->componentData->php_dashboard_methods) && ComponentbuilderHelper::checkString($this->componentData->php_dashboard_methods)) + if (isset($this->componentData->php_dashboard_methods) + && ComponentbuilderHelper::checkString( + $this->componentData->php_dashboard_methods + )) { // get all the mothods that should load date to the view - $this->DashboardGetCustomData = ComponentbuilderHelper::getAllBetween($this->componentData->php_dashboard_methods, 'public function get', '()'); + $this->DashboardGetCustomData + = ComponentbuilderHelper::getAllBetween( + $this->componentData->php_dashboard_methods, + 'public function get', '()' + ); // return the methods - return PHP_EOL . PHP_EOL . $this->setPlaceholders($this->componentData->php_dashboard_methods, $this->placeholders); + return PHP_EOL . PHP_EOL . $this->setPlaceholders( + $this->componentData->php_dashboard_methods, + $this->placeholders + ); } + return ''; } public function setDashboardGetCustomData() { - if (isset($this->DashboardGetCustomData) && ComponentbuilderHelper::checkArray($this->DashboardGetCustomData)) + if (isset($this->DashboardGetCustomData) + && ComponentbuilderHelper::checkArray( + $this->DashboardGetCustomData + )) { // gets array reset $gets = array(); @@ -13680,41 +20781,55 @@ class Interpretation extends Fields foreach ($this->DashboardGetCustomData as $get) { $string = ComponentbuilderHelper::safeString($get); - $gets[] = "\$this->" . $string . " = \$this->get('" . $get . "');"; + $gets[] = "\$this->" . $string . " = \$this->get('" . $get + . "');"; } + // return the gets - return PHP_EOL . $this->_t(2) . implode(PHP_EOL . $this->_t(2), $gets); + return PHP_EOL . $this->_t(2) . implode( + PHP_EOL . $this->_t(2), $gets + ); } + return ''; } public function setDashboardDisplayData() { // display array reset - $display = array(); + $display = array(); $mainAccordianName = 'cPanel'; - $builder = array(); - $tab = $this->_t(1); - $loadTabs = false; + $builder = array(); + $tab = $this->_t(1); + $loadTabs = false; // check if we have custom tabs - if (isset($this->componentData->dashboard_tab) && ComponentbuilderHelper::checkArray($this->componentData->dashboard_tab)) + if (isset($this->componentData->dashboard_tab) + && ComponentbuilderHelper::checkArray( + $this->componentData->dashboard_tab + )) { // build the tabs and accordians foreach ($this->componentData->dashboard_tab as $data) { - $builder[$data['name']][$data['header']] = $this->setPlaceholders($data['html'], $this->placeholders); + $builder[$data['name']][$data['header']] + = $this->setPlaceholders( + $data['html'], $this->placeholders + ); } // since we have custom tabs we must load the tab structure around the cpanel $display[] = '
    '; $display[] = $this->_t(1) . '
    '; - $display[] = $this->_t(1) . " 'cpanel')); ?>"; - $display[] = PHP_EOL . $this->_t(2) . ""; + $display[] = $this->_t(1) + . " 'cpanel')); ?>"; + $display[] = PHP_EOL . $this->_t(2) + . ""; $display[] = $this->_t(2) . '
    '; // set the tab to insure correct spacing $tab = $this->_t(3); // change the name of the main tab $mainAccordianName = 'Control Panel'; - $loadTabs = true; + $loadTabs = true; } else { @@ -13722,62 +20837,104 @@ class Interpretation extends Fields } // set dashboard display $display[] = $tab . '
    '; - $display[] = $tab . $this->_t(1) . " 'main')); ?>"; - $display[] = $tab . $this->_t(2) . ""; - $display[] = $tab . $this->_t(3) . "loadTemplate('main');?>"; - $display[] = $tab . $this->_t(2) . ""; - $display[] = $tab . $this->_t(1) . ""; + $display[] = $tab . $this->_t(1) + . " 'main')); ?>"; + $display[] = $tab . $this->_t(2) + . ""; + $display[] = $tab . $this->_t(3) + . "loadTemplate('main');?>"; + $display[] = $tab . $this->_t(2) + . ""; + $display[] = $tab . $this->_t(1) + . ""; $display[] = $tab . "
    "; $display[] = $tab . '
    '; - $display[] = $tab . $this->_t(1) . " 'vdm')); ?>"; - $display[] = $tab . $this->_t(2) . "fileContentStatic[$this->hhh . 'COMPANYNAME' . $this->hhh] . "', 'vdm'); ?>"; - $display[] = $tab . $this->_t(3) . "loadTemplate('vdm');?>"; - $display[] = $tab . $this->_t(2) . ""; - $display[] = $tab . $this->_t(1) . ""; + $display[] = $tab . $this->_t(1) + . " 'vdm')); ?>"; + $display[] = $tab . $this->_t(2) + . "fileContentStatic[$this->hhh . 'COMPANYNAME' . $this->hhh] + . "', 'vdm'); ?>"; + $display[] = $tab . $this->_t(3) + . "loadTemplate('vdm');?>"; + $display[] = $tab . $this->_t(2) + . ""; + $display[] = $tab . $this->_t(1) + . ""; $display[] = $tab . "
    "; if ($loadTabs) { $display[] = $this->_t(2) . "
    "; - $display[] = $this->_t(2) . ""; + $display[] = $this->_t(2) + . ""; // load the new tabs foreach ($builder as $tabname => $accordians) { - $alias = ComponentbuilderHelper::safeString($tabname); - $display[] = PHP_EOL . $this->_t(2) . ""; - $display[] = $this->_t(2) . '
    '; - $display[] = $tab . '
    '; - $display[] = $tab . $this->_t(1) . " '" . $alias . "_one')); ?>"; + $alias = ComponentbuilderHelper::safeString($tabname); + $display[] = PHP_EOL . $this->_t(2) + . ""; + $display[] = $this->_t(2) . '
    '; + $display[] = $tab . '
    '; + $display[] = $tab . $this->_t(1) + . " '" . $alias + . "_one')); ?>"; $slidecounter = 1; foreach ($accordians as $accordianname => $html) { - $ac_alias = ComponentbuilderHelper::safeString($accordianname); - $counterName = ComponentbuilderHelper::safeString($slidecounter); - $tempName = $alias . '_' . $ac_alias; - $display[] = $tab . $this->_t(2) . ""; - $display[] = $tab . $this->_t(3) . "loadTemplate('" . $tempName . "');?>"; - $display[] = $tab . $this->_t(2) . ""; + $ac_alias = ComponentbuilderHelper::safeString( + $accordianname + ); + $counterName = ComponentbuilderHelper::safeString( + $slidecounter + ); + $tempName = $alias . '_' . $ac_alias; + $display[] = $tab . $this->_t(2) + . ""; + $display[] = $tab . $this->_t(3) + . "loadTemplate('" . $tempName + . "');?>"; + $display[] = $tab . $this->_t(2) + . ""; $slidecounter++; // build the template file $target = array('custom_admin' => $this->componentCodeName); $this->buildDynamique($target, 'template', $tempName); // set the file data - $TARGET = ComponentbuilderHelper::safeString($this->target, 'U'); + $TARGET = ComponentbuilderHelper::safeString( + $this->target, 'U' + ); // SITE_TEMPLATE_BODY <<>> - $this->fileContentDynamic[$this->componentCodeName . '_' . $tempName][$this->hhh . 'CUSTOM_ADMIN_TEMPLATE_BODY' . $this->hhh] = PHP_EOL . $html; + $this->fileContentDynamic[$this->componentCodeName . '_' + . $tempName][$this->hhh . 'CUSTOM_ADMIN_TEMPLATE_BODY' + . $this->hhh] + = PHP_EOL . $html; // SITE_TEMPLATE_CODE_BODY <<>> - $this->fileContentDynamic[$this->componentCodeName . '_' . $tempName][$this->hhh . 'CUSTOM_ADMIN_TEMPLATE_CODE_BODY' . $this->hhh] = ''; + $this->fileContentDynamic[$this->componentCodeName . '_' + . $tempName][$this->hhh . 'CUSTOM_ADMIN_TEMPLATE_CODE_BODY' + . $this->hhh] + = ''; } - $display[] = $tab . $this->_t(1) . ""; + $display[] = $tab . $this->_t(1) + . ""; $display[] = $tab . "
    "; $display[] = $this->_t(2) . "
    "; - $display[] = $this->_t(2) . ""; + $display[] = $this->_t(2) + . ""; } - $display[] = PHP_EOL . $this->_t(1) . ""; + $display[] = PHP_EOL . $this->_t(1) + . ""; $display[] = $this->_t(1) . "
    "; } $display[] = "
    "; + // return the display return PHP_EOL . implode(PHP_EOL, $display); } @@ -13785,18 +20942,27 @@ class Interpretation extends Fields public function addCustomDashboardIcons(&$view, &$counter) { $icon = ''; - if (isset($this->componentData->custom_admin_views) && ComponentbuilderHelper::checkArray($this->componentData->custom_admin_views)) + if (isset($this->componentData->custom_admin_views) + && ComponentbuilderHelper::checkArray( + $this->componentData->custom_admin_views + )) { foreach ($this->componentData->custom_admin_views as $nr => $menu) { - if (!isset($this->customAdminAdded[$menu['settings']->code]) && isset($menu['dashboard_list']) && $menu['dashboard_list'] == 1 && $menu['before'] == $view['adminview']) + if (!isset($this->customAdminAdded[$menu['settings']->code]) + && isset($menu['dashboard_list']) + && $menu['dashboard_list'] == 1 + && $menu['before'] == $view['adminview']) { - $type = ComponentbuilderHelper::imageInfo($menu['settings']->icon); + $type = ComponentbuilderHelper::imageInfo( + $menu['settings']->icon + ); if ($type) { $type = $type . "."; // icon builder loader - $this->iconBuilder[$type . $menu['settings']->code] = $menu['settings']->icon; + $this->iconBuilder[$type . $menu['settings']->code] + = $menu['settings']->icon; } else { @@ -13804,7 +20970,8 @@ class Interpretation extends Fields } // build lang $langName = $menu['settings']->name . '

    '; - $langKey = $this->langPrefix . '_DASHBOARD_' . $menu['settings']->CODE; + $langKey = $this->langPrefix . '_DASHBOARD_' + . $menu['settings']->CODE; // add to lang $this->setLangContent($this->lang, $langKey, $langName); // set icon @@ -13819,14 +20986,20 @@ class Interpretation extends Fields $icon .= ", '" . $type . $menu['settings']->code . "'"; } } - elseif (!isset($this->customAdminAdded[$menu['settings']->code]) && isset($menu['dashboard_list']) && $menu['dashboard_list'] == 1 && empty($menu['before'])) + elseif (!isset($this->customAdminAdded[$menu['settings']->code]) + && isset($menu['dashboard_list']) + && $menu['dashboard_list'] == 1 + && empty($menu['before'])) { - $type = ComponentbuilderHelper::imageInfo($menu['settings']->icon); + $type = ComponentbuilderHelper::imageInfo( + $menu['settings']->icon + ); if ($type) { $type = $type . "."; // icon builder loader - $this->iconBuilder[$type . $menu['settings']->code] = $menu['settings']->icon; + $this->iconBuilder[$type . $menu['settings']->code] + = $menu['settings']->icon; } else { @@ -13834,29 +21007,43 @@ class Interpretation extends Fields } // build lang $langName = $menu['settings']->name . '

    '; - $langKey = $this->langPrefix . '_DASHBOARD_' . $menu['settings']->CODE; + $langKey = $this->langPrefix . '_DASHBOARD_' + . $menu['settings']->CODE; // add to lang $this->setLangContent($this->lang, $langKey, $langName); // set icon - $this->lastCustomDashboardIcon[$nr] = ", '" . $type . $menu['settings']->code . "'"; + $this->lastCustomDashboardIcon[$nr] = ", '" . $type + . $menu['settings']->code . "'"; } } } // see if we should have custom menus - if (isset($this->componentData->custommenus) && ComponentbuilderHelper::checkArray($this->componentData->custommenus)) + if (isset($this->componentData->custommenus) + && ComponentbuilderHelper::checkArray( + $this->componentData->custommenus + )) { foreach ($this->componentData->custommenus as $nr => $menu) { - $nr = $nr + 100; - $nameList = ComponentbuilderHelper::safeString($menu['name_code']); - $nameUpper = ComponentbuilderHelper::safeString($menu['name_code'], 'U'); - if (isset($menu['dashboard_list']) && $menu['dashboard_list'] == 1 && $view['adminview'] == $menu['before']) + $nr = $nr + 100; + $nameList = ComponentbuilderHelper::safeString( + $menu['name_code'] + ); + $nameUpper = ComponentbuilderHelper::safeString( + $menu['name_code'], 'U' + ); + if (isset($menu['dashboard_list']) + && $menu['dashboard_list'] == 1 + && $view['adminview'] == $menu['before']) { - $type = ComponentbuilderHelper::imageInfo('images/' . $menu['icon']); + $type = ComponentbuilderHelper::imageInfo( + 'images/' . $menu['icon'] + ); if ($type) { // icon builder loader - $this->iconBuilder[$type . "." . $nameList] = 'images/' . $menu['icon']; + $this->iconBuilder[$type . "." . $nameList] = 'images/' + . $menu['icon']; } else { @@ -13864,23 +21051,26 @@ class Interpretation extends Fields } // build lang $langName = $menu['name'] . '

    '; - $langKey = $this->langPrefix . '_DASHBOARD_' . $nameUpper; + $langKey = $this->langPrefix . '_DASHBOARD_' . $nameUpper; // add to lang $this->setLangContent($this->lang, $langKey, $langName); // if this is a link build the icon values with pipe - if (isset($menu['link']) && ComponentbuilderHelper::checkString($menu['link'])) + if (isset($menu['link']) + && ComponentbuilderHelper::checkString($menu['link'])) { // set icon if ($counter == 0) { $counter++; - $icon .= "'" . $type . "||" . $nameList . "||" . $menu['link'] . "'"; + $icon .= "'" . $type . "||" . $nameList . "||" + . $menu['link'] . "'"; } else { $counter++; - $icon .= ", '" . $type . "||" . $nameList . "||" . $menu['link'] . "'"; + $icon .= ", '" . $type . "||" . $nameList . "||" + . $menu['link'] . "'"; } } else @@ -13898,13 +21088,18 @@ class Interpretation extends Fields } } } - elseif (isset($menu['dashboard_list']) && $menu['dashboard_list'] == 1 && empty($menu['before'])) + elseif (isset($menu['dashboard_list']) + && $menu['dashboard_list'] == 1 + && empty($menu['before'])) { - $type = ComponentbuilderHelper::imageInfo('images/' . $menu['icon']); + $type = ComponentbuilderHelper::imageInfo( + 'images/' . $menu['icon'] + ); if ($type) { // icon builder loader - $this->iconBuilder[$type . "." . $nameList] = 'images/' . $menu['icon']; + $this->iconBuilder[$type . "." . $nameList] = 'images/' + . $menu['icon']; } else { @@ -13912,30 +21107,37 @@ class Interpretation extends Fields } // build lang $langName = $menu['name'] . '

    '; - $langKey = $this->langPrefix . '_DASHBOARD_' . $nameUpper; + $langKey = $this->langPrefix . '_DASHBOARD_' . $nameUpper; // add to lang $this->setLangContent($this->lang, $langKey, $langName); // if this is a link build the icon values with pipe - if (isset($menu['link']) && ComponentbuilderHelper::checkString($menu['link'])) + if (isset($menu['link']) + && ComponentbuilderHelper::checkString($menu['link'])) { // set icon - $this->lastCustomDashboardIcon[$nr] = ", '" . $type . "||" . $nameList . "||" . $menu['link'] . "'"; + $this->lastCustomDashboardIcon[$nr] = ", '" . $type + . "||" . $nameList . "||" . $menu['link'] . "'"; } else { // set icon - $this->lastCustomDashboardIcon[$nr] = ", '" . $type . "." . $nameList . "'"; + $this->lastCustomDashboardIcon[$nr] = ", '" . $type + . "." . $nameList . "'"; } } } } + return $icon; } public function setSubMenus() { - if (isset($this->componentData->admin_views) && ComponentbuilderHelper::checkArray($this->componentData->admin_views)) + if (isset($this->componentData->admin_views) + && ComponentbuilderHelper::checkArray( + $this->componentData->admin_views + )) { $menus = ''; // main lang prefix @@ -13945,39 +21147,72 @@ class Interpretation extends Fields // set default dashboard if (!ComponentbuilderHelper::checkString($this->dynamicDashboard)) { - $menus .= "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_DASHBOARD'), 'index.php?option=com_" . $codeName . "&view=" . $codeName . "', \$submenu === '" . $codeName . "');"; - $this->setLangContent($this->lang, $lang . '_DASHBOARD', 'Dashboard'); + $menus .= "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang + . "_DASHBOARD'), 'index.php?option=com_" . $codeName + . "&view=" . $codeName . "', \$submenu === '" . $codeName + . "');"; + $this->setLangContent( + $this->lang, $lang . '_DASHBOARD', 'Dashboard' + ); } $catArray = array(); foreach ($this->componentData->admin_views as $view) { // set custom menu - $menus .= $this->addCustomSubMenu($view, $codeName, $lang); - $nameSingle = ComponentbuilderHelper::safeString($view['settings']->name_single); - $nameList = ComponentbuilderHelper::safeString($view['settings']->name_list); - $nameUpper = ComponentbuilderHelper::safeString($view['settings']->name_list, 'U'); + $menus .= $this->addCustomSubMenu($view, $codeName, $lang); + $nameSingle = ComponentbuilderHelper::safeString( + $view['settings']->name_single + ); + $nameList = ComponentbuilderHelper::safeString( + $view['settings']->name_list + ); + $nameUpper = ComponentbuilderHelper::safeString( + $view['settings']->name_list, 'U' + ); if (isset($view['submenu']) && $view['submenu'] == 1) { // setup access defaults - $tab = ""; + $tab = ""; $coreLoad = false; if (isset($this->permissionCore[$nameSingle])) { - $core = $this->permissionCore[$nameSingle]; + $core = $this->permissionCore[$nameSingle]; $coreLoad = true; } // check if the item has permissions. - if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($nameSingle, $this->permissionBuilder['global'][$core['core.access']])) + if ($coreLoad && isset($core['core.access']) + && isset($this->permissionBuilder['global'][$core['core.access']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.access']] + ) + && in_array( + $nameSingle, + $this->permissionBuilder['global'][$core['core.access']] + )) { - $menus .= PHP_EOL . $this->_t(2) . "if (\$user->authorise('" . $core['core.access'] . "', 'com_" . $codeName . "') && \$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; + $menus .= PHP_EOL . $this->_t(2) + . "if (\$user->authorise('" . $core['core.access'] + . "', 'com_" . $codeName + . "') && \$user->authorise('" . $nameSingle + . ".submenu', 'com_" . $codeName . "'))"; $menus .= PHP_EOL . $this->_t(2) . "{"; // add tab to lines to follow $tab = $this->_t(1); } - $menus .= PHP_EOL . $this->_t(2) . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "'), 'index.php?option=com_" . $codeName . "&view=" . $nameList . "', \$submenu === '" . $nameList . "');"; - $this->setLangContent($this->lang, $lang . "_" . $nameUpper, $view['settings']->name_list); + $menus .= PHP_EOL . $this->_t(2) . $tab + . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" + . $nameUpper . "'), 'index.php?option=com_" . $codeName + . "&view=" . $nameList . "', \$submenu === '" + . $nameList . "');"; + $this->setLangContent( + $this->lang, $lang . "_" . $nameUpper, + $view['settings']->name_list + ); // check if category has another name - if (isset($this->catOtherName[$nameList]) && ComponentbuilderHelper::checkArray($this->catOtherName[$nameList])) + if (isset($this->catOtherName[$nameList]) + && ComponentbuilderHelper::checkArray( + $this->catOtherName[$nameList] + )) { $otherViews = $this->catOtherName[$nameList]['views']; } @@ -13985,10 +21220,16 @@ class Interpretation extends Fields { $otherViews = $nameList; } - if (isset($this->categoryBuilder[$nameList]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$nameList]) && !in_array($otherViews, $catArray)) + if (isset($this->categoryBuilder[$nameList]) + && ComponentbuilderHelper::checkArray( + $this->categoryBuilder[$nameList] + ) + && !in_array($otherViews, $catArray)) { // get the extention array - $_extetion_array = (array) explode('.', $this->categoryBuilder[$nameList]['extension']); + $_extetion_array = (array) explode( + '.', $this->categoryBuilder[$nameList]['extension'] + ); // set the meny selection if (isset($_extetion_array[1])) { @@ -13999,32 +21240,66 @@ class Interpretation extends Fields $_menu = "categories"; } // now load the menus - $menus .= PHP_EOL . $this->_t(2) . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $this->categoryBuilder[$nameList]['name'] . "'), 'index.php?option=com_categories&view=categories&extension=" . $this->categoryBuilder[$nameList]['extension'] . "', \$submenu === '" . $_menu ."');"; + $menus .= PHP_EOL . $this->_t(2) . $tab + . "JHtmlSidebar::addEntry(JText:" . ":_('" + . $this->categoryBuilder[$nameList]['name'] + . "'), 'index.php?option=com_categories&view=categories&extension=" + . $this->categoryBuilder[$nameList]['extension'] + . "', \$submenu === '" . $_menu . "');"; // make sure we add a category only once $catArray[] = $otherViews; } // check if the item has permissions. - if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($nameSingle, $this->permissionBuilder['global'][$core['core.access']])) + if ($coreLoad && isset($core['core.access']) + && isset($this->permissionBuilder['global'][$core['core.access']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.access']] + ) + && in_array( + $nameSingle, + $this->permissionBuilder['global'][$core['core.access']] + )) { $menus .= PHP_EOL . $this->_t(2) . "}"; } } // set the Joomla cutstom fields options - if (isset($view['joomla_fields']) && $view['joomla_fields'] == 1) + if (isset($view['joomla_fields']) + && $view['joomla_fields'] == 1) { - $menus .= PHP_EOL . $this->_t(2) . "if (JComponentHelper::isEnabled('com_fields'))"; + $menus .= PHP_EOL . $this->_t(2) + . "if (JComponentHelper::isEnabled('com_fields'))"; $menus .= PHP_EOL . $this->_t(2) . "{"; - $menus .= PHP_EOL . $this->_t(3) . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "_FIELDS'), 'index.php?option=com_fields&context=com_" . $codeName . "." . $nameSingle . "', \$submenu === 'fields.fields');"; - $menus .= PHP_EOL . $this->_t(3) . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "_FIELDS_GROUPS'), 'index.php?option=com_fields&view=groups&context=com_" . $codeName . "." . $nameSingle . "', \$submenu === 'fields.groups');"; + $menus .= PHP_EOL . $this->_t(3) + . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" + . $nameUpper + . "_FIELDS'), 'index.php?option=com_fields&context=com_" + . $codeName . "." . $nameSingle + . "', \$submenu === 'fields.fields');"; + $menus .= PHP_EOL . $this->_t(3) + . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" + . $nameUpper + . "_FIELDS_GROUPS'), 'index.php?option=com_fields&view=groups&context=com_" + . $codeName . "." . $nameSingle + . "', \$submenu === 'fields.groups');"; $menus .= PHP_EOL . $this->_t(2) . "}"; - $this->setLangContent($this->lang, $lang . "_" . $nameUpper . "_FIELDS", $view['settings']->name_list . ' Fields'); - $this->setLangContent($this->lang, $lang . "_" . $nameUpper . "_FIELDS_GROUPS", $view['settings']->name_list . ' Field Groups'); + $this->setLangContent( + $this->lang, $lang . "_" . $nameUpper . "_FIELDS", + $view['settings']->name_list . ' Fields' + ); + $this->setLangContent( + $this->lang, + $lang . "_" . $nameUpper . "_FIELDS_GROUPS", + $view['settings']->name_list . ' Field Groups' + ); // build uninstall script for fields - $this->uninstallScriptBuilder[$nameSingle] = 'com_' . $codeName . '.' . $nameSingle; - $this->uninstallScriptFields[$nameSingle] = $nameSingle; + $this->uninstallScriptBuilder[$nameSingle] = 'com_' + . $codeName . '.' . $nameSingle; + $this->uninstallScriptFields[$nameSingle] = $nameSingle; } } - if (isset($this->lastCustomSubMenu) && ComponentbuilderHelper::checkArray($this->lastCustomSubMenu)) + if (isset($this->lastCustomSubMenu) + && ComponentbuilderHelper::checkArray($this->lastCustomSubMenu)) { foreach ($this->lastCustomSubMenu as $menu) { @@ -14032,8 +21307,10 @@ class Interpretation extends Fields } unset($this->lastCustomSubMenu); } + return $menus; } + return false; } @@ -14041,49 +21318,64 @@ class Interpretation extends Fields { // see if we should have custom menus $custom = ''; - if (isset($this->componentData->custom_admin_views) && ComponentbuilderHelper::checkArray($this->componentData->custom_admin_views)) + if (isset($this->componentData->custom_admin_views) + && ComponentbuilderHelper::checkArray( + $this->componentData->custom_admin_views + )) { foreach ($this->componentData->custom_admin_views as $nr => $menu) { if (!isset($this->customAdminAdded[$menu['settings']->code])) { - if (($_custom = $this->setCustomAdminSubMenu($view, $codeName, $lang, $nr, $menu, 'customView')) !== false) + if (($_custom = $this->setCustomAdminSubMenu( + $view, $codeName, $lang, $nr, $menu, 'customView' + )) !== false) { $custom .= $_custom; } } } } - if (isset($this->componentData->custommenus) && ComponentbuilderHelper::checkArray($this->componentData->custommenus)) + if (isset($this->componentData->custommenus) + && ComponentbuilderHelper::checkArray( + $this->componentData->custommenus + )) { foreach ($this->componentData->custommenus as $nr => $menu) { - if (($_custom = $this->setCustomAdminSubMenu($view, $codeName, $lang, $nr, $menu, 'customMenu')) !== false) + if (($_custom = $this->setCustomAdminSubMenu( + $view, $codeName, $lang, $nr, $menu, 'customMenu' + )) !== false) { $custom .= $_custom; } } } + return $custom; } - public function setCustomAdminSubMenu(&$view, &$codeName, &$lang, &$nr, &$menu, $type) - { + public function setCustomAdminSubMenu(&$view, &$codeName, &$lang, &$nr, + &$menu, $type + ) { if ($type === 'customMenu') { - $name = $menu['name']; + $name = $menu['name']; $nameSingle = ComponentbuilderHelper::safeString($menu['name']); - $nameList = ComponentbuilderHelper::safeString($menu['name']); - $nameUpper = ComponentbuilderHelper::safeString($menu['name'], 'U'); + $nameList = ComponentbuilderHelper::safeString($menu['name']); + $nameUpper = ComponentbuilderHelper::safeString( + $menu['name'], 'U' + ); } elseif ($type === 'customView') { - $name = $menu['settings']->name; + $name = $menu['settings']->name; $nameSingle = $menu['settings']->code; - $nameList = $menu['settings']->code; - $nameUpper = $menu['settings']->CODE; + $nameList = $menu['settings']->code; + $nameUpper = $menu['settings']->CODE; } - if (isset($menu['submenu']) && $menu['submenu'] == 1 && $view['adminview'] == $menu['before']) + if (isset($menu['submenu']) && $menu['submenu'] == 1 + && $view['adminview'] == $menu['before']) { // setup access defaults $tab = ""; @@ -14091,93 +21383,156 @@ class Interpretation extends Fields $coreLoad = false; if (isset($this->permissionCore[$nameSingle])) { - $core = $this->permissionCore[$nameSingle]; + $core = $this->permissionCore[$nameSingle]; $coreLoad = true; } $custom = ''; // check if the item has permissions. - if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($nameSingle, $this->permissionBuilder['global'][$core['core.access']])) + if ($coreLoad && isset($core['core.access']) + && isset($this->permissionBuilder['global'][$core['core.access']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.access']] + ) + && in_array( + $nameSingle, + $this->permissionBuilder['global'][$core['core.access']] + )) { - $custom .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Access control (" . $core['core.access'] . " && " . $nameSingle . ".submenu)."; - $custom .= PHP_EOL . $this->_t(2) . "if (\$user->authorise('" . $core['core.access'] . "', 'com_" . $codeName . "') && \$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; + $custom .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Access control (" . $core['core.access'] . " && " + . $nameSingle . ".submenu)."; + $custom .= PHP_EOL . $this->_t(2) . "if (\$user->authorise('" + . $core['core.access'] . "', 'com_" . $codeName + . "') && \$user->authorise('" . $nameSingle + . ".submenu', 'com_" . $codeName . "'))"; $custom .= PHP_EOL . $this->_t(2) . "{"; // add tab to lines to follow $tab = $this->_t(1); } else { - $custom .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Access control (" . $nameSingle . ".submenu)."; - $custom .= PHP_EOL . $this->_t(2) . "if (\$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; + $custom .= PHP_EOL . $this->_t(2) . "//" . $this->setLine( + __LINE__ + ) . " Access control (" . $nameSingle . ".submenu)."; + $custom .= PHP_EOL . $this->_t(2) . "if (\$user->authorise('" + . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; $custom .= PHP_EOL . $this->_t(2) . "{"; // add tab to lines to follow $tab = $this->_t(1); } - if (isset($menu['link']) && ComponentbuilderHelper::checkString($menu['link'])) + if (isset($menu['link']) + && ComponentbuilderHelper::checkString( + $menu['link'] + )) { - $this->setLangContent($this->lang, $lang . '_' . $nameUpper, $name); + $this->setLangContent( + $this->lang, $lang . '_' . $nameUpper, $name + ); // add custom menu - $custom .= PHP_EOL . $this->_t(2) . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "'), '" . $menu['link'] . "', \$submenu === '" . $nameList . "');"; + $custom .= PHP_EOL . $this->_t(2) . $tab + . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" + . $nameUpper . "'), '" . $menu['link'] + . "', \$submenu === '" . $nameList . "');"; } else { - $this->setLangContent($this->lang, $lang . '_' . $nameUpper, $name); + $this->setLangContent( + $this->lang, $lang . '_' . $nameUpper, $name + ); // add custom menu - $custom .= PHP_EOL . $this->_t(2) . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "'), 'index.php?option=com_" . $codeName . "&view=" . $nameList . "', \$submenu === '" . $nameList . "');"; + $custom .= PHP_EOL . $this->_t(2) . $tab + . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" + . $nameUpper . "'), 'index.php?option=com_" . $codeName + . "&view=" . $nameList . "', \$submenu === '" . $nameList + . "');"; } // check if the item has permissions. $custom .= PHP_EOL . $this->_t(2) . "}"; return $custom; } - elseif (isset($menu['submenu']) && $menu['submenu'] == 1 && empty($menu['before'])) + elseif (isset($menu['submenu']) && $menu['submenu'] == 1 + && empty($menu['before'])) { // setup access defaults - $tab = ""; + $tab = ""; $nameSingle = ComponentbuilderHelper::safeString($name); - $coreLoad = false; + $coreLoad = false; if (isset($this->permissionCore[$nameSingle])) { - $core = $this->permissionCore[$nameSingle]; + $core = $this->permissionCore[$nameSingle]; $coreLoad = true; } $this->lastCustomSubMenu[$nr] = ''; // check if the item has permissions. - if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($nameSingle, $this->permissionBuilder['global'][$core['core.access']])) + if ($coreLoad && isset($core['core.access']) + && isset($this->permissionBuilder['global'][$core['core.access']]) + && ComponentbuilderHelper::checkArray( + $this->permissionBuilder['global'][$core['core.access']] + ) + && in_array( + $nameSingle, + $this->permissionBuilder['global'][$core['core.access']] + )) { - $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) . "if (\$user->authorise('" . $core['core.access'] . "', 'com_" . $codeName . "') && \$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; + $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) + . "if (\$user->authorise('" . $core['core.access'] + . "', 'com_" . $codeName . "') && \$user->authorise('" + . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) . "{"; // add tab to lines to follow $tab = $this->_t(1); } else { - $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) . "if (\$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; + $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) + . "if (\$user->authorise('" . $nameSingle + . ".submenu', 'com_" . $codeName . "'))"; $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) . "{"; // add tab to lines to follow $tab = $this->_t(1); } - if (isset($menu['link']) && ComponentbuilderHelper::checkString($menu['link'])) + if (isset($menu['link']) + && ComponentbuilderHelper::checkString( + $menu['link'] + )) { - $this->setLangContent($this->lang, $lang . '_' . $nameUpper, $name); + $this->setLangContent( + $this->lang, $lang . '_' . $nameUpper, $name + ); // add custom menu - $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "'), '" . $menu['link'] . "', \$submenu === '" . $nameList . "');"; + $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) . $tab + . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" + . $nameUpper . "'), '" . $menu['link'] + . "', \$submenu === '" . $nameList . "');"; } else { - $this->setLangContent($this->lang, $lang . '_' . $nameUpper, $name); + $this->setLangContent( + $this->lang, $lang . '_' . $nameUpper, $name + ); // add custom menu - $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "'), 'index.php?option=com_" . $codeName . "&view=" . $nameList . "', \$submenu === '" . $nameList . "');"; + $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) . $tab + . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" + . $nameUpper . "'), 'index.php?option=com_" . $codeName + . "&view=" . $nameList . "', \$submenu === '" . $nameList + . "');"; } // check if the item has permissions. $this->lastCustomSubMenu[$nr] .= PHP_EOL . $this->_t(2) . "}"; } + return false; } public function setMainMenus() { - if (isset($this->componentData->admin_views) && ComponentbuilderHelper::checkArray($this->componentData->admin_views)) + if (isset($this->componentData->admin_views) + && ComponentbuilderHelper::checkArray( + $this->componentData->admin_views + )) { $menus = ''; // main lang prefix @@ -14187,11 +21542,17 @@ class Interpretation extends Fields // default prefix is none $prefix = ''; // check if local is set - if (isset($this->componentData->add_menu_prefix) && is_numeric($this->componentData->add_menu_prefix)) + if (isset($this->componentData->add_menu_prefix) + && is_numeric( + $this->componentData->add_menu_prefix + )) { // set main menu prefix switch $addPrefix = $this->componentData->add_menu_prefix; - if ($addPrefix == 1 && isset($this->componentData->menu_prefix) && ComponentbuilderHelper::checkString($this->componentData->menu_prefix)) + if ($addPrefix == 1 && isset($this->componentData->menu_prefix) + && ComponentbuilderHelper::checkString( + $this->componentData->menu_prefix + )) { $prefix = trim($this->componentData->menu_prefix) . ' '; } @@ -14202,17 +21563,22 @@ class Interpretation extends Fields $addPrefix = $this->params->get('add_menu_prefix', 1); if ($addPrefix == 1) { - $prefix = trim($this->params->get('menu_prefix', '»')) . ' '; + $prefix = trim($this->params->get('menu_prefix', '»')) + . ' '; } } // add the prefix if ($addPrefix == 1) { - $this->setLangContent('adminsys', $lang, $prefix . $this->componentData->name); + $this->setLangContent( + 'adminsys', $lang, $prefix . $this->componentData->name + ); } else { - $this->setLangContent('adminsys', $lang, $this->componentData->name); + $this->setLangContent( + 'adminsys', $lang, $this->componentData->name + ); } // loop over the admin views foreach ($this->componentData->admin_views as $view) @@ -14221,13 +21587,25 @@ class Interpretation extends Fields $menus .= $this->addCustomMainMenu($view, $codeName, $lang); if (isset($view['mainmenu']) && $view['mainmenu'] == 1) { - $nameList = ComponentbuilderHelper::safeString($view['settings']->name_list); - $nameUpper = ComponentbuilderHelper::safeString($view['settings']->name_list, 'U'); - $menus .= PHP_EOL . $this->_t(3) . '' . $lang . '_' . $nameUpper . ''; - $this->setLangContent('adminsys', $lang . '_' . $nameUpper, $view['settings']->name_list); + $nameList = ComponentbuilderHelper::safeString( + $view['settings']->name_list + ); + $nameUpper = ComponentbuilderHelper::safeString( + $view['settings']->name_list, 'U' + ); + $menus .= PHP_EOL . $this->_t(3) . '' . $lang + . '_' . $nameUpper . ''; + $this->setLangContent( + 'adminsys', $lang . '_' . $nameUpper, + $view['settings']->name_list + ); } } - if (isset($this->lastCustomMainMenu) && ComponentbuilderHelper::checkArray($this->lastCustomMainMenu)) + if (isset($this->lastCustomMainMenu) + && ComponentbuilderHelper::checkArray( + $this->lastCustomMainMenu + )) { foreach ($this->lastCustomMainMenu as $menu) { @@ -14235,8 +21613,10 @@ class Interpretation extends Fields } unset($this->lastCustomMainMenu); } + return $menus; } + return false; } @@ -14244,101 +21624,180 @@ class Interpretation extends Fields { $customMenu = ''; // see if we should have custom admin views - if (isset($this->componentData->custom_admin_views) && ComponentbuilderHelper::checkArray($this->componentData->custom_admin_views)) + if (isset($this->componentData->custom_admin_views) + && ComponentbuilderHelper::checkArray( + $this->componentData->custom_admin_views + )) { foreach ($this->componentData->custom_admin_views as $nr => $menu) { if (!isset($this->customAdminAdded[$menu['settings']->code])) { - if (isset($menu['mainmenu']) && $menu['mainmenu'] == 1 && $view['adminview'] == $menu['before']) + if (isset($menu['mainmenu']) && $menu['mainmenu'] == 1 + && $view['adminview'] == $menu['before']) { - $this->setLangContent('adminsys', $lang . '_' . $menu['settings']->CODE, $menu['settings']->name); + $this->setLangContent( + 'adminsys', $lang . '_' . $menu['settings']->CODE, + $menu['settings']->name + ); // add custom menu - $customMenu .= PHP_EOL . $this->_t(3) . '' . $lang . '_' . $menu['settings']->CODE . ''; + $customMenu .= PHP_EOL . $this->_t(3) + . '' . $lang . '_' + . $menu['settings']->CODE . ''; } - elseif (isset($menu['mainmenu']) && $menu['mainmenu'] == 1 && empty($menu['before'])) + elseif (isset($menu['mainmenu']) && $menu['mainmenu'] == 1 + && empty($menu['before'])) { - $this->setLangContent('adminsys', $lang . '_' . $menu['settings']->CODE, $menu['settings']->name); + $this->setLangContent( + 'adminsys', $lang . '_' . $menu['settings']->CODE, + $menu['settings']->name + ); // add custom menu - $this->lastCustomMainMenu[$nr] = PHP_EOL . $this->_t(3) . '' . $lang . '_' . $menu['settings']->CODE . ''; + $this->lastCustomMainMenu[$nr] = PHP_EOL . $this->_t(3) + . '' . $lang . '_' + . $menu['settings']->CODE . ''; } } } } // see if we should have custom menus - if (isset($this->componentData->custommenus) && ComponentbuilderHelper::checkArray($this->componentData->custommenus)) + if (isset($this->componentData->custommenus) + && ComponentbuilderHelper::checkArray( + $this->componentData->custommenus + )) { foreach ($this->componentData->custommenus as $nr => $menu) { $nr = $nr + 100; - if (isset($menu['mainmenu']) && $menu['mainmenu'] == 1 && $view['adminview'] == $menu['before']) + if (isset($menu['mainmenu']) && $menu['mainmenu'] == 1 + && $view['adminview'] == $menu['before']) { - if (isset($menu['link']) && ComponentbuilderHelper::checkString($menu['link'])) + if (isset($menu['link']) + && ComponentbuilderHelper::checkString($menu['link'])) { - $nameList = ComponentbuilderHelper::safeString($menu['name']); - $nameUpper = ComponentbuilderHelper::safeString($menu['name'], 'U'); - $this->setLangContent('adminsys', $lang . '_' . $nameUpper, $menu['name']); + $nameList = ComponentbuilderHelper::safeString( + $menu['name'] + ); + $nameUpper = ComponentbuilderHelper::safeString( + $menu['name'], 'U' + ); + $this->setLangContent( + 'adminsys', $lang . '_' . $nameUpper, $menu['name'] + ); // sanitize url if (strpos($menu['link'], 'http') === false) { - $menu['link'] = str_replace('/administrator/index.php?', '', $menu['link']); - $menu['link'] = str_replace('administrator/index.php?', '', $menu['link']); + $menu['link'] = str_replace( + '/administrator/index.php?', '', $menu['link'] + ); + $menu['link'] = str_replace( + 'administrator/index.php?', '', $menu['link'] + ); // check if the index is still there if (strpos($menu['link'], 'index.php?') !== false) { - $menu['link'] = str_replace('/index.php?', '', $menu['link']); - $menu['link'] = str_replace('index.php?', '', $menu['link']); + $menu['link'] = str_replace( + '/index.php?', '', $menu['link'] + ); + $menu['link'] = str_replace( + 'index.php?', '', $menu['link'] + ); } } // urlencode - $menu['link'] = htmlspecialchars($menu['link'], ENT_XML1, 'UTF-8'); + $menu['link'] = htmlspecialchars( + $menu['link'], ENT_XML1, 'UTF-8' + ); // add custom menu - $customMenu .= PHP_EOL . $this->_t(3) . '' . $lang . '_' . $nameUpper . ''; + $customMenu .= PHP_EOL . $this->_t(3) . '' . $lang . '_' . $nameUpper + . ''; } else { - $nameList = ComponentbuilderHelper::safeString($menu['name_code']); - $nameUpper = ComponentbuilderHelper::safeString($menu['name_code'], 'U'); - $this->setLangContent('adminsys', $lang . '_' . $nameUpper, $menu['name']); + $nameList = ComponentbuilderHelper::safeString( + $menu['name_code'] + ); + $nameUpper = ComponentbuilderHelper::safeString( + $menu['name_code'], 'U' + ); + $this->setLangContent( + 'adminsys', $lang . '_' . $nameUpper, $menu['name'] + ); // add custom menu - $customMenu .= PHP_EOL . $this->_t(3) . '' . $lang . '_' . $nameUpper . ''; + $customMenu .= PHP_EOL . $this->_t(3) + . '' . $lang . '_' . $nameUpper + . ''; } } - elseif (isset($menu['mainmenu']) && $menu['mainmenu'] == 1 && empty($menu['before'])) + elseif (isset($menu['mainmenu']) && $menu['mainmenu'] == 1 + && empty($menu['before'])) { - if (isset($menu['link']) && ComponentbuilderHelper::checkString($menu['link'])) + if (isset($menu['link']) + && ComponentbuilderHelper::checkString($menu['link'])) { - $nameList = ComponentbuilderHelper::safeString($menu['name']); - $nameUpper = ComponentbuilderHelper::safeString($menu['name'], 'U'); - $this->setLangContent('adminsys', $lang . '_' . $nameUpper, $menu['name']); + $nameList = ComponentbuilderHelper::safeString( + $menu['name'] + ); + $nameUpper = ComponentbuilderHelper::safeString( + $menu['name'], 'U' + ); + $this->setLangContent( + 'adminsys', $lang . '_' . $nameUpper, $menu['name'] + ); // sanitize url if (strpos($menu['link'], 'http') === false) { - $menu['link'] = str_replace('/administrator/index.php?', '', $menu['link']); - $menu['link'] = str_replace('administrator/index.php?', '', $menu['link']); + $menu['link'] = str_replace( + '/administrator/index.php?', '', $menu['link'] + ); + $menu['link'] = str_replace( + 'administrator/index.php?', '', $menu['link'] + ); // check if the index is still there if (strpos($menu['link'], 'index.php?') !== false) { - $menu['link'] = str_replace('/index.php?', '', $menu['link']); - $menu['link'] = str_replace('index.php?', '', $menu['link']); + $menu['link'] = str_replace( + '/index.php?', '', $menu['link'] + ); + $menu['link'] = str_replace( + 'index.php?', '', $menu['link'] + ); } } // urlencode - $menu['link'] = htmlspecialchars($menu['link'], ENT_XML1, 'UTF-8'); + $menu['link'] = htmlspecialchars( + $menu['link'], ENT_XML1, 'UTF-8' + ); // add custom menu - $this->lastCustomMainMenu[$nr] = PHP_EOL . $this->_t(3) . '' . $lang . '_' . $nameUpper . ''; + $this->lastCustomMainMenu[$nr] = PHP_EOL . $this->_t(3) + . '' . $lang + . '_' . $nameUpper . ''; } else { - $nameList = ComponentbuilderHelper::safeString($menu['name_code']); - $nameUpper = ComponentbuilderHelper::safeString($menu['name_code'], 'U'); - $this->setLangContent('adminsys', $lang . '_' . $nameUpper, $menu['name']); + $nameList = ComponentbuilderHelper::safeString( + $menu['name_code'] + ); + $nameUpper = ComponentbuilderHelper::safeString( + $menu['name_code'], 'U' + ); + $this->setLangContent( + 'adminsys', $lang . '_' . $nameUpper, $menu['name'] + ); // add custom menu - $this->lastCustomMainMenu[$nr] = PHP_EOL . $this->_t(3) . '' . $lang . '_' . $nameUpper . ''; + $this->lastCustomMainMenu[$nr] = PHP_EOL . $this->_t(3) + . '' . $lang . '_' . $nameUpper + . ''; } } } } + return $customMenu; } @@ -14349,42 +21808,78 @@ class Interpretation extends Fields if (1 == $timer) // this is before the admin views are build { // start loading Global params - $autorName = ComponentbuilderHelper::htmlEscape($this->componentData->author); - $autorEmail = ComponentbuilderHelper::htmlEscape($this->componentData->email); - $this->extensionsParams[] = '"autorName":"' . $autorName . '","autorEmail":"' . $autorEmail . '"'; + $autorName = ComponentbuilderHelper::htmlEscape( + $this->componentData->author + ); + $autorEmail = ComponentbuilderHelper::htmlEscape( + $this->componentData->email + ); + $this->extensionsParams[] = '"autorName":"' . $autorName + . '","autorEmail":"' . $autorEmail . '"'; // set the custom fields - if (isset($this->componentData->config) && ComponentbuilderHelper::checkArray($this->componentData->config)) + if (isset($this->componentData->config) + && ComponentbuilderHelper::checkArray( + $this->componentData->config + )) { // set component code name - $component = $this->componentCodeName; - $viewName = 'config'; + $component = $this->componentCodeName; + $viewName = 'config'; $listViewName = 'configs'; // set place holders $placeholders = array(); - $placeholders[$this->hhh . 'component' . $this->hhh] = $this->componentCodeName; - $placeholders[$this->hhh . 'Component' . $this->hhh] = ComponentbuilderHelper::safeString($this->componentData->name_code, 'F'); - $placeholders[$this->hhh . 'COMPONENT' . $this->hhh] = ComponentbuilderHelper::safeString($this->componentData->name_code, 'U'); - $placeholders[$this->hhh . 'view' . $this->hhh] = $viewName; - $placeholders[$this->hhh . 'views' . $this->hhh] = $listViewName; - $placeholders[$this->bbb . 'component' . $this->ddd] = $this->componentCodeName; - $placeholders[$this->bbb . 'Component' . $this->ddd] = $placeholders[$this->hhh . 'Component' . $this->hhh]; - $placeholders[$this->bbb . 'COMPONENT' . $this->ddd] = $placeholders[$this->hhh . 'COMPONENT' . $this->hhh]; - $placeholders[$this->bbb . 'view' . $this->ddd] = $viewName; - $placeholders[$this->bbb . 'views' . $this->ddd] = $listViewName; + $placeholders[$this->hhh . 'component' . $this->hhh] + = $this->componentCodeName; + $placeholders[$this->hhh . 'Component' . $this->hhh] + = ComponentbuilderHelper::safeString( + $this->componentData->name_code, 'F' + ); + $placeholders[$this->hhh . 'COMPONENT' . $this->hhh] + = ComponentbuilderHelper::safeString( + $this->componentData->name_code, 'U' + ); + $placeholders[$this->hhh . 'view' . $this->hhh] + = $viewName; + $placeholders[$this->hhh . 'views' . $this->hhh] + = $listViewName; + $placeholders[$this->bbb . 'component' . $this->ddd] + = $this->componentCodeName; + $placeholders[$this->bbb . 'Component' . $this->ddd] + = $placeholders[$this->hhh . 'Component' + . $this->hhh]; + $placeholders[$this->bbb . 'COMPONENT' . $this->ddd] + = $placeholders[$this->hhh . 'COMPONENT' + . $this->hhh]; + $placeholders[$this->bbb . 'view' . $this->ddd] + = $viewName; + $placeholders[$this->bbb . 'views' . $this->ddd] + = $listViewName; // load the global placeholders - if (ComponentbuilderHelper::checkArray($this->globalPlaceholders)) + if (ComponentbuilderHelper::checkArray( + $this->globalPlaceholders + )) { - foreach ($this->globalPlaceholders as $globalPlaceholder => $gloabalValue) + foreach ( + $this->globalPlaceholders as $globalPlaceholder => + $gloabalValue + ) { $placeholders[$globalPlaceholder] = $gloabalValue; } } - $view = ''; + $view = ''; $viewType = 0; // set the custom table key $dbkey = 'g'; // Trigger Event: jcb_ce_onBeforeSetConfigFieldsets - $this->triggerEvent('jcb_ce_onBeforeSetConfigFieldsets', array(&$this->componentContext, &$timer, &$this->configFieldSets, &$this->configFieldSetsCustomField, &$this->componentData->config, &$this->extensionsParams, &$placeholders)); + $this->triggerEvent( + 'jcb_ce_onBeforeSetConfigFieldsets', + array(&$this->componentContext, &$timer, + &$this->configFieldSets, + &$this->configFieldSetsCustomField, + &$this->componentData->config, + &$this->extensionsParams, &$placeholders) + ); // build the config fields foreach ($this->componentData->config as $field) { @@ -14392,43 +21887,80 @@ class Interpretation extends Fields if ($this->fieldBuilderType == 1) { // string manipulation - $xmlField = $this->setDynamicField($field, $view, $viewType, $lang, $viewName, $listViewName, $placeholders, $dbkey, false); + $xmlField = $this->setDynamicField( + $field, $view, $viewType, $lang, $viewName, + $listViewName, $placeholders, $dbkey, false + ); } else { // simpleXMLElement class - $newxmlField = $this->setDynamicField($field, $view, $viewType, $lang, $viewName, $listViewName, $placeholders, $dbkey, false); + $newxmlField = $this->setDynamicField( + $field, $view, $viewType, $lang, $viewName, + $listViewName, $placeholders, $dbkey, false + ); if (isset($newxmlField->fieldXML)) { - $xmlField = dom_import_simplexml($newxmlField->fieldXML); - $xmlField = PHP_EOL . $this->_t(1) . "' . PHP_EOL . $this->_t(1) . $this->xmlPrettyPrint($xmlField, 'field'); + $xmlField = dom_import_simplexml( + $newxmlField->fieldXML + ); + $xmlField = PHP_EOL . $this->_t(1) . "' . PHP_EOL + . $this->_t(1) . $this->xmlPrettyPrint( + $xmlField, 'field' + ); } } // make sure the xml is set and a string - if (isset($xmlField) && ComponentbuilderHelper::checkString($xmlField)) + if (isset($xmlField) + && ComponentbuilderHelper::checkString( + $xmlField + )) { - $this->configFieldSetsCustomField[$field['tabname']][] = $xmlField; + $this->configFieldSetsCustomField[$field['tabname']][] + = $xmlField; // set global params to db on install - $fieldName = ComponentbuilderHelper::safeString($this->setPlaceholders(ComponentbuilderHelper::getBetween($xmlField, 'name="', '"'), $placeholders)); - $fieldDefault = $this->setPlaceholders(ComponentbuilderHelper::getBetween($xmlField, 'default="', '"'), $placeholders); - if (isset($field['custom_value']) && ComponentbuilderHelper::checkString($field['custom_value'])) + $fieldName = ComponentbuilderHelper::safeString( + $this->setPlaceholders( + ComponentbuilderHelper::getBetween( + $xmlField, 'name="', '"' + ), $placeholders + ) + ); + $fieldDefault = $this->setPlaceholders( + ComponentbuilderHelper::getBetween( + $xmlField, 'default="', '"' + ), $placeholders + ); + if (isset($field['custom_value']) + && ComponentbuilderHelper::checkString( + $field['custom_value'] + )) { // add array if found - if ((strpos($field['custom_value'], '["') !== false) && (strpos($field['custom_value'], '"]') !== false)) + if ((strpos($field['custom_value'], '["') !== false) + && (strpos($field['custom_value'], '"]') + !== false)) { // load the Global checkin defautls - $this->extensionsParams[] = '"' . $fieldName . '":' . $field['custom_value']; + $this->extensionsParams[] = '"' . $fieldName + . '":' . $field['custom_value']; } else { // load the Global checkin defautls - $this->extensionsParams[] = '"' . $fieldName . '":"' . $field['custom_value'] . '"'; + $this->extensionsParams[] = '"' . $fieldName + . '":"' . $field['custom_value'] . '"'; } } - elseif (ComponentbuilderHelper::checkString($fieldDefault)) + elseif (ComponentbuilderHelper::checkString( + $fieldDefault + )) { // load the Global checkin defautls - $this->extensionsParams[] = '"' . $fieldName . '":"' . $fieldDefault . '"'; + $this->extensionsParams[] = '"' . $fieldName . '":"' + . $fieldDefault . '"'; } } } @@ -14440,7 +21972,14 @@ class Interpretation extends Fields elseif (2 == $timer) // this is after the admin views are build { // Trigger Event: jcb_ce_onBeforeSetConfigFieldsets - $this->triggerEvent('jcb_ce_onBeforeSetConfigFieldsets', array(&$this->componentContext, &$timer, &$this->configFieldSets, &$this->configFieldSetsCustomField, &$this->componentData->config, &$this->extensionsParams, &$this->placeholders)); + $this->triggerEvent( + 'jcb_ce_onBeforeSetConfigFieldsets', + array(&$this->componentContext, &$timer, + &$this->configFieldSets, + &$this->configFieldSetsCustomField, + &$this->componentData->config, &$this->extensionsParams, + &$this->placeholders) + ); // these field sets can only be added after admin view is build $this->setGroupControlConfigFieldsets($lang); // these can be added anytime really (but looks best after groups @@ -14452,14 +21991,22 @@ class Interpretation extends Fields $this->setCustomControlConfigFieldsets($lang); } // Trigger Event: jcb_ce_onAfterSetConfigFieldsets - $this->triggerEvent('jcb_ce_onAfterSetConfigFieldsets', array(&$this->componentContext, &$timer, &$this->configFieldSets, &$this->configFieldSetsCustomField, &$this->extensionsParams, &$this->frontEndParams, &$this->placeholders)); + $this->triggerEvent( + 'jcb_ce_onAfterSetConfigFieldsets', + array(&$this->componentContext, &$timer, &$this->configFieldSets, + &$this->configFieldSetsCustomField, &$this->extensionsParams, + &$this->frontEndParams, &$this->placeholders) + ); } public function setSiteControlConfigFieldsets($lang) { $front_end = array(); // do quick build of front-end views - if (isset($this->componentData->site_views) && ComponentbuilderHelper::checkArray($this->componentData->site_views)) + if (isset($this->componentData->site_views) + && ComponentbuilderHelper::checkArray( + $this->componentData->site_views + )) { // load the names only to link the page params foreach ($this->componentData->site_views as $siteView) @@ -14470,11 +22017,15 @@ class Interpretation extends Fields } // add frontend view stuff including menus - if (isset($this->configFieldSetsCustomField) && ComponentbuilderHelper::checkArray($this->configFieldSetsCustomField)) + if (isset($this->configFieldSetsCustomField) + && ComponentbuilderHelper::checkArray( + $this->configFieldSetsCustomField + )) { foreach ($this->configFieldSetsCustomField as $tab => &$tabFields) { - $tabCode = ComponentbuilderHelper::safeString($tab) . '_custom_config'; + $tabCode = ComponentbuilderHelper::safeString($tab) + . '_custom_config'; $tabUpper = ComponentbuilderHelper::safeString($tab, 'U'); $tabLower = ComponentbuilderHelper::safeString($tab); // load the request id setters for menu views @@ -14483,15 +22034,24 @@ class Interpretation extends Fields { if (strpos($id_field, $viewRequest) !== false) { - $this->setRequestValues($tabLower, $id_field, $viewRequest, 'id', 'hasIdRequest'); + $this->setRequestValues( + $tabLower, $id_field, $viewRequest, 'id', + 'hasIdRequest' + ); unset($tabFields[$et]); } elseif (strpos($id_field, '_request_id') !== false) { // not loaded to a tab "view" name - $_viewRequest = ComponentbuilderHelper::getBetween($id_field, 'name="', '_request_id'); - $searchIdKe = 'name="' . $_viewRequest . '_request_id'; - $this->setRequestValues($_viewRequest, $id_field, $searchIdKe, 'id', 'hasIdRequest'); + $_viewRequest = ComponentbuilderHelper::getBetween( + $id_field, 'name="', '_request_id' + ); + $searchIdKe = 'name="' . $_viewRequest + . '_request_id'; + $this->setRequestValues( + $_viewRequest, $id_field, $searchIdKe, 'id', + 'hasIdRequest' + ); unset($tabFields[$et]); } } @@ -14502,20 +22062,29 @@ class Interpretation extends Fields if (strpos($catid_field, $viewRequestC) !== false) { - $this->setRequestValues($tabLower, $catid_field, $viewRequestC, 'catid', 'hasCatIdRequest'); + $this->setRequestValues( + $tabLower, $catid_field, $viewRequestC, 'catid', + 'hasCatIdRequest' + ); unset($tabFields[$ci]); } elseif (strpos($catid_field, '_request_catid') !== false) { // not loaded to a tab "view" name - $_viewRequestC = ComponentbuilderHelper::getBetween($catid_field, 'name="', '_request_catid'); - $searchCatidKe = 'name="' . $_viewRequestC . '_request_catid'; - $this->setRequestValues($_viewRequestC, $catid_field, $searchCatidKe, 'catid', 'hasCatIdRequest'); + $_viewRequestC = ComponentbuilderHelper::getBetween( + $catid_field, 'name="', '_request_catid' + ); + $searchCatidKe = 'name="' . $_viewRequestC + . '_request_catid'; + $this->setRequestValues( + $_viewRequestC, $catid_field, $searchCatidKe, + 'catid', 'hasCatIdRequest' + ); unset($tabFields[$ci]); } } // load the global menu setters for single fields - $menuSetter = $tabLower . '_menu'; + $menuSetter = $tabLower . '_menu'; $pageSettings = array(); foreach ($tabFields as $ct => $field) { @@ -14527,7 +22096,9 @@ class Interpretation extends Fields elseif (strpos($field, '_menu"') !== false) { // not loaded to a tab "view" name - $_tabLower = ComponentbuilderHelper::getBetween($field, 'name="', '_menu"'); + $_tabLower = ComponentbuilderHelper::getBetween( + $field, 'name="', '_menu"' + ); // set the values needed to insure route is done correclty $this->hasMenuGlobal[$_tabLower] = $_tabLower . '_menu'; } @@ -14558,7 +22129,9 @@ class Interpretation extends Fields else { // update field - $field = str_replace($search . $key . '"', 'name="' . $key . '"', $field); + $field = str_replace( + $search . $key . '"', 'name="' . $key . '"', $field + ); } if (!isset($this->{$store}[$view])) { @@ -14571,33 +22144,46 @@ class Interpretation extends Fields public function setCustomControlConfigFieldsets($lang) { // add custom new global fields set - if (isset($this->configFieldSetsCustomField) && ComponentbuilderHelper::checkArray($this->configFieldSetsCustomField)) + if (isset($this->configFieldSetsCustomField) + && ComponentbuilderHelper::checkArray( + $this->configFieldSetsCustomField + )) { foreach ($this->configFieldSetsCustomField as $tab => $tabFields) { - $tabCode = ComponentbuilderHelper::safeString($tab) . '_custom_config'; + $tabCode = ComponentbuilderHelper::safeString($tab) + . '_custom_config'; $tabUpper = ComponentbuilderHelper::safeString($tab, 'U'); $tabLower = ComponentbuilderHelper::safeString($tab); // remove display targeted fields $bucket = array(); foreach ($tabFields as $tabField) { - $display = ComponentbuilderHelper::getBetween($tabField, 'display="', '"'); - if (!ComponentbuilderHelper::checkString($display) || $display === 'config') + $display = ComponentbuilderHelper::getBetween( + $tabField, 'display="', '"' + ); + if (!ComponentbuilderHelper::checkString($display) + || $display === 'config') { // remove this display since it is not used in Joomla - $bucket[] = str_replace('display="config"', '', $tabField); + $bucket[] = str_replace( + 'display="config"', '', $tabField + ); } } // only add the tab if it has values if (ComponentbuilderHelper::checkArray($bucket)) { // setup lang - $this->setLangContent($this->lang, $lang . '_' . $tabUpper, $tab); + $this->setLangContent( + $this->lang, $lang . '_' . $tabUpper, $tab + ); // start field set $this->configFieldSets[] = $this->_t(1) . "configFieldSets[] = $this->_t(2) . 'name="' . $tabCode . '"'; - $this->configFieldSets[] = $this->_t(2) . 'label="' . $lang . '_' . $tabUpper . '">'; + $this->configFieldSets[] = $this->_t(2) . 'name="' + . $tabCode . '"'; + $this->configFieldSets[] = $this->_t(2) . 'label="' . $lang + . '_' . $tabUpper . '">'; // set the fields $this->configFieldSets[] = implode("", $bucket); // close field set @@ -14612,33 +22198,54 @@ class Interpretation extends Fields public function setGroupControlConfigFieldsets($lang) { // start loading Group control params if needed - if (isset($this->setGroupControl) && ComponentbuilderHelper::checkArray($this->setGroupControl)) + if (isset($this->setGroupControl) + && ComponentbuilderHelper::checkArray( + $this->setGroupControl + )) { // start building field set for config $this->configFieldSets[] = $this->_t(1) . "configFieldSets[] = $this->_t(2) . 'name="group_config"'; - $this->configFieldSets[] = $this->_t(2) . 'label="' . $lang . '_GROUPS_LABEL"'; - $this->configFieldSets[] = $this->_t(2) . 'description="' . $lang . '_GROUPS_DESC">'; + $this->configFieldSets[] = $this->_t(2) . 'label="' . $lang + . '_GROUPS_LABEL"'; + $this->configFieldSets[] = $this->_t(2) . 'description="' . $lang + . '_GROUPS_DESC">'; // setup lang - $this->setLangContent($this->lang, $lang . '_GROUPS_LABEL', "Target Groups"); - $this->setLangContent($this->lang, $lang . '_GROUPS_DESC', "The Parameters for the targeted groups are set here."); - $this->setLangContent($this->lang, $lang . '_TARGET_GROUP_DESC', "Set the group/s being targeted by this user type."); + $this->setLangContent( + $this->lang, $lang . '_GROUPS_LABEL', "Target Groups" + ); + $this->setLangContent( + $this->lang, $lang . '_GROUPS_DESC', + "The Parameters for the targeted groups are set here." + ); + $this->setLangContent( + $this->lang, $lang . '_TARGET_GROUP_DESC', + "Set the group/s being targeted by this user type." + ); foreach ($this->setGroupControl as $selector => $label) { - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="usergroup"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $label . '"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_TARGET_GROUP_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $label + . '"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' + . $lang . '_TARGET_GROUP_DESC"'; $this->configFieldSets[] = $this->_t(3) . 'multiple="true"'; $this->configFieldSets[] = $this->_t(2) . "/>"; // set params defaults $this->extensionsParams[] = '"' . $selector . '":["2"]'; } // add custom Target Groups fields - if (isset($this->configFieldSetsCustomField['Target Groups']) && ComponentbuilderHelper::checkArray($this->configFieldSetsCustomField['Target Groups'])) + if (isset($this->configFieldSetsCustomField['Target Groups']) + && ComponentbuilderHelper::checkArray( + $this->configFieldSetsCustomField['Target Groups'] + )) { - $this->configFieldSets[] = implode("", $this->configFieldSetsCustomField['Target Groups']); + $this->configFieldSets[] = implode( + "", $this->configFieldSetsCustomField['Target Groups'] + ); unset($this->configFieldSetsCustomField['Target Groups']); } // close that fieldse @@ -14658,14 +22265,22 @@ class Interpretation extends Fields // start building field set for config $this->configFieldSets[] = 'configFieldSets[] = $this->_t(2) . 'addrulepath="/administrator/components/com_' . $component . '/models/rules"'; - $this->configFieldSets[] = $this->_t(2) . 'addfieldpath="/administrator/components/com_' . $component . '/models/fields"'; + $this->configFieldSets[] = $this->_t(2) + . 'addrulepath="/administrator/components/com_' . $component + . '/models/rules"'; + $this->configFieldSets[] = $this->_t(2) + . 'addfieldpath="/administrator/components/com_' . $component + . '/models/fields"'; $this->configFieldSets[] = $this->_t(2) . 'name="global_config"'; - $this->configFieldSets[] = $this->_t(2) . 'label="' . $lang . '_GLOBAL_LABEL"'; - $this->configFieldSets[] = $this->_t(2) . 'description="' . $lang . '_GLOBAL_DESC">'; + $this->configFieldSets[] = $this->_t(2) . 'label="' . $lang + . '_GLOBAL_LABEL"'; + $this->configFieldSets[] = $this->_t(2) . 'description="' . $lang + . '_GLOBAL_DESC">'; // setup lang $this->setLangContent($this->lang, $lang . '_GLOBAL_LABEL', "Global"); - $this->setLangContent($this->lang, $lang . '_GLOBAL_DESC', "The Global Parameters"); + $this->setLangContent( + $this->lang, $lang . '_GLOBAL_DESC', "The Global Parameters" + ); // add auto checin if required if ($this->addCheckin) { @@ -14673,31 +22288,60 @@ class Interpretation extends Fields $this->configFieldSets[] = $this->_t(3) . 'name="check_in"'; $this->configFieldSets[] = $this->_t(3) . 'type="list"'; $this->configFieldSets[] = $this->_t(3) . 'default="0"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_CHECK_TIMER_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_CHECK_TIMER_DESC">'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang + . '_CHECK_TIMER_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang + . '_CHECK_TIMER_DESC">'; $this->configFieldSets[] = $this->_t(3) . 'configFieldSets[] = $this->_t(4) . 'value="-5 hours">' . $lang . '_CHECK_TIMER_OPTION_ONE'; + $this->configFieldSets[] = $this->_t(4) . 'value="-5 hours">' + . $lang . '_CHECK_TIMER_OPTION_ONE'; $this->configFieldSets[] = $this->_t(3) . 'configFieldSets[] = $this->_t(4) . 'value="-12 hours">' . $lang . '_CHECK_TIMER_OPTION_TWO'; + $this->configFieldSets[] = $this->_t(4) . 'value="-12 hours">' + . $lang . '_CHECK_TIMER_OPTION_TWO'; $this->configFieldSets[] = $this->_t(3) . 'configFieldSets[] = $this->_t(4) . 'value="-1 day">' . $lang . '_CHECK_TIMER_OPTION_THREE'; + $this->configFieldSets[] = $this->_t(4) . 'value="-1 day">' . $lang + . '_CHECK_TIMER_OPTION_THREE'; $this->configFieldSets[] = $this->_t(3) . 'configFieldSets[] = $this->_t(4) . 'value="-2 day">' . $lang . '_CHECK_TIMER_OPTION_FOUR'; + $this->configFieldSets[] = $this->_t(4) . 'value="-2 day">' . $lang + . '_CHECK_TIMER_OPTION_FOUR'; $this->configFieldSets[] = $this->_t(3) . 'configFieldSets[] = $this->_t(4) . 'value="-1 week">' . $lang . '_CHECK_TIMER_OPTION_FIVE'; + $this->configFieldSets[] = $this->_t(4) . 'value="-1 week">' . $lang + . '_CHECK_TIMER_OPTION_FIVE'; $this->configFieldSets[] = $this->_t(3) . 'configFieldSets[] = $this->_t(4) . 'value="0">' . $lang . '_CHECK_TIMER_OPTION_SIX'; + $this->configFieldSets[] = $this->_t(4) . 'value="0">' . $lang + . '_CHECK_TIMER_OPTION_SIX'; $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ''; + $this->configFieldSets[] = $this->_t(2) + . ''; // setup lang - $this->setLangContent($this->lang, $lang . '_CHECK_TIMER_LABEL', "Check in timer"); - $this->setLangContent($this->lang, $lang . '_CHECK_TIMER_DESC', "Set the intervals for the auto checkin fuction of tables that checks out the items to an user."); - $this->setLangContent($this->lang, $lang . '_CHECK_TIMER_OPTION_ONE', "Every five hours"); - $this->setLangContent($this->lang, $lang . '_CHECK_TIMER_OPTION_TWO', "Every twelve hours"); - $this->setLangContent($this->lang, $lang . '_CHECK_TIMER_OPTION_THREE', "Once a day"); - $this->setLangContent($this->lang, $lang . '_CHECK_TIMER_OPTION_FOUR', "Every second day"); - $this->setLangContent($this->lang, $lang . '_CHECK_TIMER_OPTION_FIVE', "Once a week"); - $this->setLangContent($this->lang, $lang . '_CHECK_TIMER_OPTION_SIX', "Never"); + $this->setLangContent( + $this->lang, $lang . '_CHECK_TIMER_LABEL', "Check in timer" + ); + $this->setLangContent( + $this->lang, $lang . '_CHECK_TIMER_DESC', + "Set the intervals for the auto checkin fuction of tables that checks out the items to an user." + ); + $this->setLangContent( + $this->lang, $lang . '_CHECK_TIMER_OPTION_ONE', + "Every five hours" + ); + $this->setLangContent( + $this->lang, $lang . '_CHECK_TIMER_OPTION_TWO', + "Every twelve hours" + ); + $this->setLangContent( + $this->lang, $lang . '_CHECK_TIMER_OPTION_THREE', "Once a day" + ); + $this->setLangContent( + $this->lang, $lang . '_CHECK_TIMER_OPTION_FOUR', + "Every second day" + ); + $this->setLangContent( + $this->lang, $lang . '_CHECK_TIMER_OPTION_FIVE', "Once a week" + ); + $this->setLangContent( + $this->lang, $lang . '_CHECK_TIMER_OPTION_SIX', "Never" + ); // load the Global checkin defautls $this->extensionsParams[] = '"check_in":"-1 day"'; } @@ -14707,142 +22351,234 @@ class Interpretation extends Fields $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . 'name="save_history"'; $this->configFieldSets[] = $this->_t(3) . 'type="radio"'; - $this->configFieldSets[] = $this->_t(3) . 'class="btn-group btn-group-yesno"'; + $this->configFieldSets[] = $this->_t(3) + . 'class="btn-group btn-group-yesno"'; $this->configFieldSets[] = $this->_t(3) . 'default="1"'; - $this->configFieldSets[] = $this->_t(3) . 'label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC"'; + $this->configFieldSets[] = $this->_t(3) + . 'label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL"'; + $this->configFieldSets[] = $this->_t(3) + . 'description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC"'; $this->configFieldSets[] = $this->_t(3) . ">"; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) + . ''; + $this->configFieldSets[] = $this->_t(3) + . ''; $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . 'name="history_limit"'; $this->configFieldSets[] = $this->_t(3) . 'type="text"'; $this->configFieldSets[] = $this->_t(3) . 'filter="integer"'; - $this->configFieldSets[] = $this->_t(3) . 'label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC"'; + $this->configFieldSets[] = $this->_t(3) + . 'label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"'; + $this->configFieldSets[] = $this->_t(3) + . 'description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC"'; $this->configFieldSets[] = $this->_t(3) . 'default="10"'; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ''; + $this->configFieldSets[] = $this->_t(2) + . ''; // load the Global checkin defautls - $this->extensionsParams[] = '"save_history":"1","history_limit":"10"'; + $this->extensionsParams[] + = '"save_history":"1","history_limit":"10"'; } // add custom global fields - if (isset($this->configFieldSetsCustomField['Global']) && ComponentbuilderHelper::checkArray($this->configFieldSetsCustomField['Global'])) + if (isset($this->configFieldSetsCustomField['Global']) + && ComponentbuilderHelper::checkArray( + $this->configFieldSetsCustomField['Global'] + )) { - $this->configFieldSets[] = implode("", $this->configFieldSetsCustomField['Global']); + $this->configFieldSets[] = implode( + "", $this->configFieldSetsCustomField['Global'] + ); unset($this->configFieldSetsCustomField['Global']); } // set the author details $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="spacer"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_AUTHOR"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang + . '_AUTHOR"'; $this->configFieldSets[] = $this->_t(2) . "/>"; $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="text"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_AUTHOR_NAME_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_AUTHOR_NAME_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang + . '_AUTHOR_NAME_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang + . '_AUTHOR_NAME_DESC"'; $this->configFieldSets[] = $this->_t(3) . 'size="60"'; - $this->configFieldSets[] = $this->_t(3) . 'default="' . $autorName . '"'; + $this->configFieldSets[] = $this->_t(3) . 'default="' . $autorName + . '"'; $this->configFieldSets[] = $this->_t(3) . 'readonly="true"'; $this->configFieldSets[] = $this->_t(3) . 'class="readonly"'; $this->configFieldSets[] = $this->_t(2) . "/>"; $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="email"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_AUTHOR_EMAIL_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_AUTHOR_EMAIL_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang + . '_AUTHOR_EMAIL_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang + . '_AUTHOR_EMAIL_DESC"'; $this->configFieldSets[] = $this->_t(3) . 'size="60"'; - $this->configFieldSets[] = $this->_t(3) . 'default="' . $autorEmail . '"'; + $this->configFieldSets[] = $this->_t(3) . 'default="' . $autorEmail + . '"'; $this->configFieldSets[] = $this->_t(3) . 'readonly="true"'; $this->configFieldSets[] = $this->_t(3) . 'class="readonly"'; $this->configFieldSets[] = $this->_t(2) . "/>"; // setup lang $this->setLangContent($this->lang, $lang . '_AUTHOR', "Author Info"); - $this->setLangContent($this->lang, $lang . '_AUTHOR_NAME_LABEL', "Author Name"); - $this->setLangContent($this->lang, $lang . '_AUTHOR_NAME_DESC', "The name of the author of this component."); - $this->setLangContent($this->lang, $lang . '_AUTHOR_EMAIL_LABEL', "Author Email"); - $this->setLangContent($this->lang, $lang . '_AUTHOR_EMAIL_DESC', "The email address of the author of this component."); + $this->setLangContent( + $this->lang, $lang . '_AUTHOR_NAME_LABEL', "Author Name" + ); + $this->setLangContent( + $this->lang, $lang . '_AUTHOR_NAME_DESC', + "The name of the author of this component." + ); + $this->setLangContent( + $this->lang, $lang . '_AUTHOR_EMAIL_LABEL', "Author Email" + ); + $this->setLangContent( + $this->lang, $lang . '_AUTHOR_EMAIL_DESC', + "The email address of the author of this component." + ); // set if contributors were added $langCont = $lang . '_CONTRIBUTOR'; - if (isset($this->addContributors) && $this->addContributors && isset($this->componentData->contributors) && ComponentbuilderHelper::checkArray($this->componentData->contributors)) + if (isset($this->addContributors) && $this->addContributors + && isset($this->componentData->contributors) + && ComponentbuilderHelper::checkArray( + $this->componentData->contributors + )) { - foreach ($this->componentData->contributors as $counter => $contributor) + foreach ( + $this->componentData->contributors as $counter => $contributor + ) { // make sure we dont use 0 $counter++; // get the word for this number $COUNTER = ComponentbuilderHelper::safeString($counter, 'U'); // set the dynamic values - $cbTitle = htmlspecialchars($contributor['title'], ENT_XML1, 'UTF-8'); - $cbName = htmlspecialchars($contributor['name'], ENT_XML1, 'UTF-8'); - $cbEmail = htmlspecialchars($contributor['email'], ENT_XML1, 'UTF-8'); - $cbWebsite = htmlspecialchars($contributor['website'], ENT_XML1, 'UTF-8'); // ComponentbuilderHelper::htmlEscape($contributor['website']); + $cbTitle = htmlspecialchars( + $contributor['title'], ENT_XML1, 'UTF-8' + ); + $cbName = htmlspecialchars( + $contributor['name'], ENT_XML1, 'UTF-8' + ); + $cbEmail = htmlspecialchars( + $contributor['email'], ENT_XML1, 'UTF-8' + ); + $cbWebsite = htmlspecialchars( + $contributor['website'], ENT_XML1, 'UTF-8' + ); // ComponentbuilderHelper::htmlEscape($contributor['website']); // load to the $fieldsets - $this->configFieldSets[] = $this->_t(2) . ''; - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(2) + . ''; + $this->configFieldSets[] = $this->_t(2) + . 'configFieldSets[] = $this->_t(3) . 'type="spacer"'; $this->configFieldSets[] = $this->_t(3) . 'class="text"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_' . $COUNTER . '"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + . '_' . $COUNTER . '"'; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(2) + . 'configFieldSets[] = $this->_t(3) . 'type="text"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_TITLE_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_TITLE_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + . '_TITLE_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' + . $langCont . '_TITLE_DESC"'; $this->configFieldSets[] = $this->_t(3) . 'size="60"'; - $this->configFieldSets[] = $this->_t(3) . 'default="' . $cbTitle . '"'; + $this->configFieldSets[] = $this->_t(3) . 'default="' . $cbTitle + . '"'; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(2) + . 'configFieldSets[] = $this->_t(3) . 'type="text"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_NAME_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_NAME_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + . '_NAME_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' + . $langCont . '_NAME_DESC"'; $this->configFieldSets[] = $this->_t(3) . 'size="60"'; - $this->configFieldSets[] = $this->_t(3) . 'default="' . $cbName . '"'; + $this->configFieldSets[] = $this->_t(3) . 'default="' . $cbName + . '"'; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(2) + . 'configFieldSets[] = $this->_t(3) . 'type="email"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_EMAIL_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_EMAIL_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + . '_EMAIL_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' + . $langCont . '_EMAIL_DESC"'; $this->configFieldSets[] = $this->_t(3) . 'size="60"'; - $this->configFieldSets[] = $this->_t(3) . 'default="' . $cbEmail . '"'; + $this->configFieldSets[] = $this->_t(3) . 'default="' . $cbEmail + . '"'; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(2) + . 'configFieldSets[] = $this->_t(3) . 'type="url"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_LINK_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_LINK_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + . '_LINK_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' + . $langCont . '_LINK_DESC"'; $this->configFieldSets[] = $this->_t(3) . 'size="60"'; - $this->configFieldSets[] = $this->_t(3) . 'default="' . $cbWebsite . '"'; + $this->configFieldSets[] = $this->_t(3) . 'default="' + . $cbWebsite . '"'; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(2) + . 'configFieldSets[] = $this->_t(3) . 'type="list"'; - $this->configFieldSets[] = $this->_t(3) . 'default="' . (int) $contributor['use'] . '"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_USE_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_USE_DESC">'; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . 'default="' + . (int) $contributor['use'] . '"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + . '_USE_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' + . $langCont . '_USE_DESC">'; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(2) + . 'configFieldSets[] = $this->_t(3) . 'type="list"'; - $this->configFieldSets[] = $this->_t(3) . 'default="' . (int) $contributor['show'] . '"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_SHOW_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_SHOW_DESC">'; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . 'default="' + . (int) $contributor['show'] . '"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + . '_SHOW_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' + . $langCont . '_SHOW_DESC">'; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; $this->configFieldSets[] = $this->_t(2) . ""; // add the contributor - $this->theContributors .= PHP_EOL . $this->_t(1) . "@" . strtolower($contributor['title']) . $this->_t(2) . $contributor['name'] . ' <' . $contributor['website'] . '>'; + $this->theContributors .= PHP_EOL . $this->_t(1) . "@" + . strtolower($contributor['title']) . $this->_t(2) + . $contributor['name'] . ' <' . $contributor['website'] + . '>'; // setup lang $Counter = ComponentbuilderHelper::safeString($counter, 'Ww'); - $this->setLangContent($this->lang, $langCont . '_' . $COUNTER, "Contributor " . $Counter); + $this->setLangContent( + $this->lang, $langCont . '_' . $COUNTER, + "Contributor " . $Counter + ); // load the Global checkin defautls - $this->extensionsParams[] = '"titleContributor' . $counter . '":"' . $cbTitle . '"'; - $this->extensionsParams[] = '"nameContributor' . $counter . '":"' . $cbName . '"'; - $this->extensionsParams[] = '"emailContributor' . $counter . '":"' . $cbEmail . '"'; - $this->extensionsParams[] = '"linkContributor' . $counter . '":"' . $cbWebsite . '"'; - $this->extensionsParams[] = '"useContributor' . $counter . '":"' . (int) $contributor['use'] . '"'; - $this->extensionsParams[] = '"showContributor' . $counter . '":"' . (int) $contributor['show'] . '"'; + $this->extensionsParams[] = '"titleContributor' . $counter + . '":"' . $cbTitle . '"'; + $this->extensionsParams[] = '"nameContributor' . $counter + . '":"' . $cbName . '"'; + $this->extensionsParams[] = '"emailContributor' . $counter + . '":"' . $cbEmail . '"'; + $this->extensionsParams[] = '"linkContributor' . $counter + . '":"' . $cbWebsite . '"'; + $this->extensionsParams[] = '"useContributor' . $counter . '":"' + . (int) $contributor['use'] . '"'; + $this->extensionsParams[] = '"showContributor' . $counter + . '":"' . (int) $contributor['show'] . '"'; } } // add more contributors if required @@ -14857,92 +22593,165 @@ class Interpretation extends Fields { $min = 1; } - $max = $min + $this->componentData->number - 1; + $max = $min + $this->componentData->number - 1; $moreContributerFields = range($min, $max, 1); foreach ($moreContributerFields as $counter) { $COUNTER = ComponentbuilderHelper::safeString($counter, 'U'); - $this->configFieldSets[] = $this->_t(2) . ''; - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(2) + . ''; + $this->configFieldSets[] = $this->_t(2) + . 'configFieldSets[] = $this->_t(3) . 'type="spacer"'; $this->configFieldSets[] = $this->_t(3) . 'class="text"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_' . $COUNTER . '"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + . '_' . $COUNTER . '"'; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(2) + . 'configFieldSets[] = $this->_t(3) . 'type="text"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_TITLE_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_TITLE_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + . '_TITLE_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' + . $langCont . '_TITLE_DESC"'; $this->configFieldSets[] = $this->_t(3) . 'size="60"'; $this->configFieldSets[] = $this->_t(3) . 'default=""'; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(2) + . 'configFieldSets[] = $this->_t(3) . 'type="text"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_NAME_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_NAME_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + . '_NAME_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' + . $langCont . '_NAME_DESC"'; $this->configFieldSets[] = $this->_t(3) . 'size="60"'; $this->configFieldSets[] = $this->_t(3) . 'default=""'; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(2) + . 'configFieldSets[] = $this->_t(3) . 'type="email"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_EMAIL_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_EMAIL_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + . '_EMAIL_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' + . $langCont . '_EMAIL_DESC"'; $this->configFieldSets[] = $this->_t(3) . 'size="60"'; $this->configFieldSets[] = $this->_t(3) . 'default=""'; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(2) + . 'configFieldSets[] = $this->_t(3) . 'type="url"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_LINK_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_LINK_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + . '_LINK_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' + . $langCont . '_LINK_DESC"'; $this->configFieldSets[] = $this->_t(3) . 'size="60"'; $this->configFieldSets[] = $this->_t(3) . 'default=""'; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(2) + . 'configFieldSets[] = $this->_t(3) . 'type="list"'; $this->configFieldSets[] = $this->_t(3) . 'default="0"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_USE_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_USE_DESC">'; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + . '_USE_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' + . $langCont . '_USE_DESC">'; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(2) + . 'configFieldSets[] = $this->_t(3) . 'type="list"'; $this->configFieldSets[] = $this->_t(3) . 'default="0"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont . '_SHOW_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $langCont . '_SHOW_DESC">'; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . ''; - $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $langCont + . '_SHOW_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' + . $langCont . '_SHOW_DESC">'; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; $this->configFieldSets[] = $this->_t(2) . ""; // setup lang $Counter = ComponentbuilderHelper::safeString($counter, 'Ww'); - $this->setLangContent($this->lang, $langCont . '_' . $COUNTER, "Contributor " . $Counter); + $this->setLangContent( + $this->lang, $langCont . '_' . $COUNTER, + "Contributor " . $Counter + ); } } - if ($this->addContributors || $this->componentData->emptycontributors == 1) + if ($this->addContributors + || $this->componentData->emptycontributors == 1) { // setup lang - $this->setLangContent($this->lang, $langCont . '_TITLE_LABEL', "Contributor Job Title"); - $this->setLangContent($this->lang, $langCont . '_TITLE_DESC', "The job title that best describes the contributor's relationship to this component."); - $this->setLangContent($this->lang, $langCont . '_NAME_LABEL', "Contributor Name"); - $this->setLangContent($this->lang, $langCont . '_NAME_DESC', "The name of this contributor."); - $this->setLangContent($this->lang, $langCont . '_EMAIL_LABEL', "Contributor Email"); - $this->setLangContent($this->lang, $langCont . '_EMAIL_DESC', "The email of this contributor."); - $this->setLangContent($this->lang, $langCont . '_LINK_LABEL', "Contributor Website"); - $this->setLangContent($this->lang, $langCont . '_LINK_DESC', "The link to this contributor's website."); + $this->setLangContent( + $this->lang, $langCont . '_TITLE_LABEL', "Contributor Job Title" + ); + $this->setLangContent( + $this->lang, $langCont . '_TITLE_DESC', + "The job title that best describes the contributor's relationship to this component." + ); + $this->setLangContent( + $this->lang, $langCont . '_NAME_LABEL', "Contributor Name" + ); + $this->setLangContent( + $this->lang, $langCont . '_NAME_DESC', + "The name of this contributor." + ); + $this->setLangContent( + $this->lang, $langCont . '_EMAIL_LABEL', "Contributor Email" + ); + $this->setLangContent( + $this->lang, $langCont . '_EMAIL_DESC', + "The email of this contributor." + ); + $this->setLangContent( + $this->lang, $langCont . '_LINK_LABEL', "Contributor Website" + ); + $this->setLangContent( + $this->lang, $langCont . '_LINK_DESC', + "The link to this contributor's website." + ); $this->setLangContent($this->lang, $langCont . '_USE_LABEL', "Use"); - $this->setLangContent($this->lang, $langCont . '_USE_DESC', "How should we link to this contributor."); + $this->setLangContent( + $this->lang, $langCont . '_USE_DESC', + "How should we link to this contributor." + ); $this->setLangContent($this->lang, $langCont . '_USE_NONE', "None"); - $this->setLangContent($this->lang, $langCont . '_USE_EMAIL', "Email"); - $this->setLangContent($this->lang, $langCont . '_USE_WWW', "Website"); - $this->setLangContent($this->lang, $langCont . '_SHOW_LABEL', "Show"); - $this->setLangContent($this->lang, $langCont . '_SHOW_DESC', "Select where you want this contributor's details to show in the component."); - $this->setLangContent($this->lang, $langCont . '_SHOW_NONE', "Hide"); - $this->setLangContent($this->lang, $langCont . '_SHOW_BACK', "Back-end"); - $this->setLangContent($this->lang, $langCont . '_SHOW_FRONT', "Front-end"); - $this->setLangContent($this->lang, $langCont . '_SHOW_ALL', "Both Front & Back-end"); + $this->setLangContent( + $this->lang, $langCont . '_USE_EMAIL', "Email" + ); + $this->setLangContent( + $this->lang, $langCont . '_USE_WWW', "Website" + ); + $this->setLangContent( + $this->lang, $langCont . '_SHOW_LABEL', "Show" + ); + $this->setLangContent( + $this->lang, $langCont . '_SHOW_DESC', + "Select where you want this contributor's details to show in the component." + ); + $this->setLangContent( + $this->lang, $langCont . '_SHOW_NONE', "Hide" + ); + $this->setLangContent( + $this->lang, $langCont . '_SHOW_BACK', "Back-end" + ); + $this->setLangContent( + $this->lang, $langCont . '_SHOW_FRONT', "Front-end" + ); + $this->setLangContent( + $this->lang, $langCont . '_SHOW_ALL', "Both Front & Back-end" + ); } // close that fieldset $this->configFieldSets[] = $this->_t(1) . "
    "; @@ -14957,96 +22766,155 @@ class Interpretation extends Fields // start building field set for uikit functions $this->configFieldSets[] = $this->_t(1) . "configFieldSets[] = $this->_t(2) . 'name="uikit_config"'; - $this->configFieldSets[] = $this->_t(2) . 'label="' . $lang . '_UIKIT_LABEL"'; - $this->configFieldSets[] = $this->_t(2) . 'description="' . $lang . '_UIKIT_DESC">'; + $this->configFieldSets[] = $this->_t(2) . 'label="' . $lang + . '_UIKIT_LABEL"'; + $this->configFieldSets[] = $this->_t(2) . 'description="' . $lang + . '_UIKIT_DESC">'; // set tab lang if (1 == $this->uikit) { - $this->setLangContent($this->lang, $lang . '_UIKIT_LABEL', "Uikit2 Settings"); - $this->setLangContent($this->lang, $lang . '_UIKIT_DESC', "The Parameters for the uikit are set here.
    Uikit is a lightweight and modular front-end framework -for developing fast and powerful web interfaces. For more info visit https://getuikit.com/v2/"); + $this->setLangContent( + $this->lang, $lang . '_UIKIT_LABEL', "Uikit2 Settings" + ); + $this->setLangContent( + $this->lang, $lang . '_UIKIT_DESC', "The Parameters for the uikit are set here.
    Uikit is a lightweight and modular front-end framework +for developing fast and powerful web interfaces. For more info visit https://getuikit.com/v2/" + ); } elseif (2 == $this->uikit) { - $this->setLangContent($this->lang, $lang . '_UIKIT_LABEL', "Uikit2 and Uikit3 Settings"); - $this->setLangContent($this->lang, $lang . '_UIKIT_DESC', "The Parameters for the uikit are set here.
    Uikit is a lightweight and modular front-end framework -for developing fast and powerful web interfaces. For more info visit version 2 or version 3"); + $this->setLangContent( + $this->lang, $lang . '_UIKIT_LABEL', + "Uikit2 and Uikit3 Settings" + ); + $this->setLangContent( + $this->lang, $lang . '_UIKIT_DESC', "The Parameters for the uikit are set here.
    Uikit is a lightweight and modular front-end framework +for developing fast and powerful web interfaces. For more info visit version 2 or version 3" + ); } elseif (3 == $this->uikit) { - $this->setLangContent($this->lang, $lang . '_UIKIT_LABEL', "Uikit3 Settings"); - $this->setLangContent($this->lang, $lang . '_UIKIT_DESC', "The Parameters for the uikit are set here.
    Uikit is a lightweight and modular front-end framework -for developing fast and powerful web interfaces. For more info visit https://getuikit.com/"); + $this->setLangContent( + $this->lang, $lang . '_UIKIT_LABEL', "Uikit3 Settings" + ); + $this->setLangContent( + $this->lang, $lang . '_UIKIT_DESC', "The Parameters for the uikit are set here.
    Uikit is a lightweight and modular front-end framework +for developing fast and powerful web interfaces. For more info visit https://getuikit.com/" + ); } // add version selection if (2 == $this->uikit) { // set field lang - $this->setLangContent($this->lang, $lang . '_UIKIT_VERSION_LABEL', "Uikit Versions"); - $this->setLangContent($this->lang, $lang . '_UIKIT_VERSION_DESC', "Select what version you would like to use"); - $this->setLangContent($this->lang, $lang . '_UIKIT_V2', "Version 2"); - $this->setLangContent($this->lang, $lang . '_UIKIT_V3', "Version 3"); + $this->setLangContent( + $this->lang, $lang . '_UIKIT_VERSION_LABEL', + "Uikit Versions" + ); + $this->setLangContent( + $this->lang, $lang . '_UIKIT_VERSION_DESC', + "Select what version you would like to use" + ); + $this->setLangContent( + $this->lang, $lang . '_UIKIT_V2', "Version 2" + ); + $this->setLangContent( + $this->lang, $lang . '_UIKIT_V3', "Version 3" + ); // set the field - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(2) + . 'configFieldSets[] = $this->_t(3) . 'type="radio"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_UIKIT_VERSION_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_UIKIT_VERSION_DESC"'; - $this->configFieldSets[] = $this->_t(3) . 'class="btn-group btn-group-yesno"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang + . '_UIKIT_VERSION_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' + . $lang . '_UIKIT_VERSION_DESC"'; + $this->configFieldSets[] = $this->_t(3) + . 'class="btn-group btn-group-yesno"'; $this->configFieldSets[] = $this->_t(3) . 'default="2">'; - $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; $this->configFieldSets[] = $this->_t(3) . '"'; + $this->configFieldSets[] = $this->_t(4) . $lang + . '_UIKIT_V2"'; $this->configFieldSets[] = $this->_t(3) . '"'; + $this->configFieldSets[] = $this->_t(4) . $lang + . '_UIKIT_V3"'; $this->configFieldSets[] = $this->_t(2) . ""; // set params defaults $this->extensionsParams[] = '"uikit_version":"2"'; } // set field lang - $this->setLangContent($this->lang, $lang . '_UIKIT_LOAD_LABEL', "Loading Options"); - $this->setLangContent($this->lang, $lang . '_UIKIT_LOAD_DESC', "Set the uikit loading option."); + $this->setLangContent( + $this->lang, $lang . '_UIKIT_LOAD_LABEL', "Loading Options" + ); + $this->setLangContent( + $this->lang, $lang . '_UIKIT_LOAD_DESC', + "Set the uikit loading option." + ); $this->setLangContent($this->lang, $lang . '_AUTO_LOAD', "Auto"); $this->setLangContent($this->lang, $lang . '_FORCE_LOAD', "Force"); $this->setLangContent($this->lang, $lang . '_DONT_LOAD', "Not"); - $this->setLangContent($this->lang, $lang . '_ONLY_EXTRA', "Only Extra"); + $this->setLangContent( + $this->lang, $lang . '_ONLY_EXTRA', "Only Extra" + ); // set the field - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(2) + . 'configFieldSets[] = $this->_t(3) . 'type="radio"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_UIKIT_LOAD_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_UIKIT_LOAD_DESC"'; - $this->configFieldSets[] = $this->_t(3) . 'class="btn-group btn-group-yesno"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang + . '_UIKIT_LOAD_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang + . '_UIKIT_LOAD_DESC"'; + $this->configFieldSets[] = $this->_t(3) + . 'class="btn-group btn-group-yesno"'; $this->configFieldSets[] = $this->_t(3) . 'default="">'; - $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; $this->configFieldSets[] = $this->_t(3) . '"'; + $this->configFieldSets[] = $this->_t(4) . $lang + . '_AUTO_LOAD"'; $this->configFieldSets[] = $this->_t(3) . '"'; + $this->configFieldSets[] = $this->_t(4) . $lang + . '_FORCE_LOAD"'; if (2 == $this->uikit || 1 == $this->uikit) { $this->configFieldSets[] = $this->_t(3) . '"'; + $this->configFieldSets[] = $this->_t(4) . $lang + . '_ONLY_EXTRA"'; } $this->configFieldSets[] = $this->_t(3) . '"'; + $this->configFieldSets[] = $this->_t(4) . $lang + . '_DONT_LOAD"'; $this->configFieldSets[] = $this->_t(2) . ""; // set params defaults $this->extensionsParams[] = '"uikit_load":"1"'; // set field lang - $this->setLangContent($this->lang, $lang . '_UIKIT_MIN_LABEL', "Load Minified"); - $this->setLangContent($this->lang, $lang . '_UIKIT_MIN_DESC', "Should the minified version of uikit files be loaded?"); + $this->setLangContent( + $this->lang, $lang . '_UIKIT_MIN_LABEL', "Load Minified" + ); + $this->setLangContent( + $this->lang, $lang . '_UIKIT_MIN_DESC', + "Should the minified version of uikit files be loaded?" + ); $this->setLangContent($this->lang, $lang . '_YES', "Yes"); $this->setLangContent($this->lang, $lang . '_NO', "No"); // set the field $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(3) . 'type="radio"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_UIKIT_MIN_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_UIKIT_MIN_DESC"'; - $this->configFieldSets[] = $this->_t(3) . 'class="btn-group btn-group-yesno"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang + . '_UIKIT_MIN_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang + . '_UIKIT_MIN_DESC"'; + $this->configFieldSets[] = $this->_t(3) + . 'class="btn-group btn-group-yesno"'; $this->configFieldSets[] = $this->_t(3) . 'default="">'; - $this->configFieldSets[] = $this->_t(3) . ''; + $this->configFieldSets[] = $this->_t(3) . ''; $this->configFieldSets[] = $this->_t(3) . '"'; $this->configFieldSets[] = $this->_t(3) . '"'; + $this->configFieldSets[] = $this->_t(3) + . '"'; + $this->configFieldSets[] = $this->_t(3) + . '"'; $this->configFieldSets[] = $this->_t(2) . ""; // set params defaults $this->extensionsParams[] = '"uikit_style":""'; } // add custom Uikit Settings fields - if (isset($this->configFieldSetsCustomField['Uikit Settings']) && ComponentbuilderHelper::checkArray($this->configFieldSetsCustomField['Uikit Settings'])) + if (isset($this->configFieldSetsCustomField['Uikit Settings']) + && ComponentbuilderHelper::checkArray( + $this->configFieldSetsCustomField['Uikit Settings'] + )) { - $this->configFieldSets[] = implode("", $this->configFieldSetsCustomField['Uikit Settings']); + $this->configFieldSets[] = implode( + "", $this->configFieldSetsCustomField['Uikit Settings'] + ); unset($this->configFieldSetsCustomField['Uikit Settings']); } // close that fieldset @@ -15098,270 +22993,479 @@ for developing fast and powerful web interfaces. For more info visit componentData->add_email_helper) && $this->componentData->add_email_helper) + if (isset($this->componentData->add_email_helper) + && $this->componentData->add_email_helper) { // main lang prefix $lang = $lang . ''; // set main lang string - $this->setLangContent($this->lang, $lang . '_MAIL_CONFIGURATION', "Mail Configuration"); + $this->setLangContent( + $this->lang, $lang . '_MAIL_CONFIGURATION', "Mail Configuration" + ); $this->setLangContent($this->lang, $lang . '_DKIM', "DKIM"); // start building field set for email helper functions $this->configFieldSets[] = PHP_EOL . $this->_t(1) . "configFieldSets[] = $this->_t(2) . "name=\"mail_configuration_custom_config\""; - $this->configFieldSets[] = $this->_t(2) . "label=\"" . $lang . "_MAIL_CONFIGURATION\">"; + $this->configFieldSets[] = $this->_t(2) + . "name=\"mail_configuration_custom_config\""; + $this->configFieldSets[] = $this->_t(2) . "label=\"" . $lang + . "_MAIL_CONFIGURATION\">"; // add custom Mail Configurations - if (isset($this->configFieldSetsCustomField['Mail Configuration']) && ComponentbuilderHelper::checkArray($this->configFieldSetsCustomField['Mail Configuration'])) + if (isset($this->configFieldSetsCustomField['Mail Configuration']) + && ComponentbuilderHelper::checkArray( + $this->configFieldSetsCustomField['Mail Configuration'] + )) { - $this->configFieldSets[] = implode("", $this->configFieldSetsCustomField['Mail Configuration']); + $this->configFieldSets[] = implode( + "", $this->configFieldSetsCustomField['Mail Configuration'] + ); unset($this->configFieldSetsCustomField['Mail Configuration']); } else { // set all the laguage strings - $this->setLangContent($this->lang, $lang . '_MAILONLINE_LABEL', "Mailer Status"); - $this->setLangContent($this->lang, $lang . '_MAILONLINE_DESCRIPTION', "Warning this will stop all emails from going out."); + $this->setLangContent( + $this->lang, $lang . '_MAILONLINE_LABEL', "Mailer Status" + ); + $this->setLangContent( + $this->lang, $lang . '_MAILONLINE_DESCRIPTION', + "Warning this will stop all emails from going out." + ); $this->setLangContent($this->lang, $lang . '_ON', "On"); $this->setLangContent($this->lang, $lang . '_OFF', "Off"); - $this->setLangContent($this->lang, $lang . '_MAILER_LABEL', "Mailer"); - $this->setLangContent($this->lang, $lang . '_MAILER_DESCRIPTION', "Select what mailer you would like to use to send emails."); + $this->setLangContent( + $this->lang, $lang . '_MAILER_LABEL', "Mailer" + ); + $this->setLangContent( + $this->lang, $lang . '_MAILER_DESCRIPTION', + "Select what mailer you would like to use to send emails." + ); $this->setLangContent($this->lang, $lang . '_GLOBAL', "Global"); - $this->setLangContent($this->lang, $lang . '_PHP_MAIL', "PHP Mail"); - $this->setLangContent($this->lang, $lang . '_SENDMAIL', "Sendmail"); + $this->setLangContent( + $this->lang, $lang . '_PHP_MAIL', "PHP Mail" + ); + $this->setLangContent( + $this->lang, $lang . '_SENDMAIL', "Sendmail" + ); $this->setLangContent($this->lang, $lang . '_SMTP', "SMTP"); - $this->setLangContent($this->lang, $lang . '_EMAILFROM_LABEL', " From Email"); - $this->setLangContent($this->lang, $lang . '_EMAILFROM_DESCRIPTION', "The global email address that will be used to send system email."); - $this->setLangContent($this->lang, $lang . '_EMAILFROM_HINT', "Email Address Here"); - $this->setLangContent($this->lang, $lang . '_FROMNAME_LABEL', "From Name"); - $this->setLangContent($this->lang, $lang . '_FROMNAME_DESCRIPTION', "Text displayed in the header "From:" field when sending a site email. Usually the site name."); - $this->setLangContent($this->lang, $lang . '_FROMNAME_HINT', "From Name Here"); - $this->setLangContent($this->lang, $lang . '_EMAILREPLY_LABEL', " Reply to Email"); - $this->setLangContent($this->lang, $lang . '_EMAILREPLY_DESCRIPTION', "The global email address that will be used to set as the reply email. (leave blank for none)"); - $this->setLangContent($this->lang, $lang . '_EMAILREPLY_HINT', "Email Address Here"); - $this->setLangContent($this->lang, $lang . '_REPLYNAME_LABEL', "Reply to Name"); - $this->setLangContent($this->lang, $lang . '_REPLYNAME_DESCRIPTION', "Text displayed in the header "Reply To:" field when replying to the site email. Usually the the person that receives the response. (leave blank for none)"); - $this->setLangContent($this->lang, $lang . '_REPLYNAME_HINT', "Reply Name Here"); - $this->setLangContent($this->lang, $lang . '_SENDMAIL_LABEL', "Sendmail Path"); - $this->setLangContent($this->lang, $lang . '_SENDMAIL_DESCRIPTION', "Enter the path to the sendmail program directory on your host server."); - $this->setLangContent($this->lang, $lang . '_SENDMAIL_HINT', "/usr/sbin/sendmail"); - $this->setLangContent($this->lang, $lang . '_SMTPAUTH_LABEL', "SMTP Authentication"); - $this->setLangContent($this->lang, $lang . '_SMTPAUTH_DESCRIPTION', "Select yes if your SMTP host requires SMTP Authentication."); + $this->setLangContent( + $this->lang, $lang . '_EMAILFROM_LABEL', " From Email" + ); + $this->setLangContent( + $this->lang, $lang . '_EMAILFROM_DESCRIPTION', + "The global email address that will be used to send system email." + ); + $this->setLangContent( + $this->lang, $lang . '_EMAILFROM_HINT', "Email Address Here" + ); + $this->setLangContent( + $this->lang, $lang . '_FROMNAME_LABEL', "From Name" + ); + $this->setLangContent( + $this->lang, $lang . '_FROMNAME_DESCRIPTION', + "Text displayed in the header "From:" field when sending a site email. Usually the site name." + ); + $this->setLangContent( + $this->lang, $lang . '_FROMNAME_HINT', "From Name Here" + ); + $this->setLangContent( + $this->lang, $lang . '_EMAILREPLY_LABEL', " Reply to Email" + ); + $this->setLangContent( + $this->lang, $lang . '_EMAILREPLY_DESCRIPTION', + "The global email address that will be used to set as the reply email. (leave blank for none)" + ); + $this->setLangContent( + $this->lang, $lang . '_EMAILREPLY_HINT', + "Email Address Here" + ); + $this->setLangContent( + $this->lang, $lang . '_REPLYNAME_LABEL', "Reply to Name" + ); + $this->setLangContent( + $this->lang, $lang . '_REPLYNAME_DESCRIPTION', + "Text displayed in the header "Reply To:" field when replying to the site email. Usually the the person that receives the response. (leave blank for none)" + ); + $this->setLangContent( + $this->lang, $lang . '_REPLYNAME_HINT', "Reply Name Here" + ); + $this->setLangContent( + $this->lang, $lang . '_SENDMAIL_LABEL', "Sendmail Path" + ); + $this->setLangContent( + $this->lang, $lang . '_SENDMAIL_DESCRIPTION', + "Enter the path to the sendmail program directory on your host server." + ); + $this->setLangContent( + $this->lang, $lang . '_SENDMAIL_HINT', "/usr/sbin/sendmail" + ); + $this->setLangContent( + $this->lang, $lang . '_SMTPAUTH_LABEL', + "SMTP Authentication" + ); + $this->setLangContent( + $this->lang, $lang . '_SMTPAUTH_DESCRIPTION', + "Select yes if your SMTP host requires SMTP Authentication." + ); $this->setLangContent($this->lang, $lang . '_YES', "Yes"); $this->setLangContent($this->lang, $lang . '_NO', "No"); - $this->setLangContent($this->lang, $lang . '_SMTPSECURE_LABEL', "SMTP Security"); - $this->setLangContent($this->lang, $lang . '_SMTPSECURE_DESCRIPTION', "Select the security model that your SMTP server uses."); + $this->setLangContent( + $this->lang, $lang . '_SMTPSECURE_LABEL', "SMTP Security" + ); + $this->setLangContent( + $this->lang, $lang . '_SMTPSECURE_DESCRIPTION', + "Select the security model that your SMTP server uses." + ); $this->setLangContent($this->lang, $lang . '_NONE', "None"); $this->setLangContent($this->lang, $lang . '_SSL', "SSL"); $this->setLangContent($this->lang, $lang . '_TLS', "TLS"); - $this->setLangContent($this->lang, $lang . '_SMTPPORT_LABEL', "SMTP Port"); - $this->setLangContent($this->lang, $lang . '_SMTPPORT_DESCRIPTION', "Enter the port number of your SMTP server. Use 25 for most unsecured servers and 465 for most secure servers."); - $this->setLangContent($this->lang, $lang . '_SMTPPORT_HINT', "25"); - $this->setLangContent($this->lang, $lang . '_SMTPUSER_LABEL', "SMTP Username"); - $this->setLangContent($this->lang, $lang . '_SMTPUSER_DESCRIPTION', "Enter the username for access to the SMTP host."); - $this->setLangContent($this->lang, $lang . '_SMTPUSER_HINT', "email@demo.com"); - $this->setLangContent($this->lang, $lang . '_SMTPPASS_LABEL', "SMTP Password"); - $this->setLangContent($this->lang, $lang . '_SMTPPASS_DESCRIPTION', "Enter the password for access to the SMTP host."); - $this->setLangContent($this->lang, $lang . '_SMTPHOST_LABEL', "SMTP Host"); - $this->setLangContent($this->lang, $lang . '_SMTPHOST_DESCRIPTION', "Enter the name of the SMTP host."); - $this->setLangContent($this->lang, $lang . '_SMTPHOST_HINT', "localhost"); + $this->setLangContent( + $this->lang, $lang . '_SMTPPORT_LABEL', "SMTP Port" + ); + $this->setLangContent( + $this->lang, $lang . '_SMTPPORT_DESCRIPTION', + "Enter the port number of your SMTP server. Use 25 for most unsecured servers and 465 for most secure servers." + ); + $this->setLangContent( + $this->lang, $lang . '_SMTPPORT_HINT', "25" + ); + $this->setLangContent( + $this->lang, $lang . '_SMTPUSER_LABEL', "SMTP Username" + ); + $this->setLangContent( + $this->lang, $lang . '_SMTPUSER_DESCRIPTION', + "Enter the username for access to the SMTP host." + ); + $this->setLangContent( + $this->lang, $lang . '_SMTPUSER_HINT', "email@demo.com" + ); + $this->setLangContent( + $this->lang, $lang . '_SMTPPASS_LABEL', "SMTP Password" + ); + $this->setLangContent( + $this->lang, $lang . '_SMTPPASS_DESCRIPTION', + "Enter the password for access to the SMTP host." + ); + $this->setLangContent( + $this->lang, $lang . '_SMTPHOST_LABEL', "SMTP Host" + ); + $this->setLangContent( + $this->lang, $lang . '_SMTPHOST_DESCRIPTION', + "Enter the name of the SMTP host." + ); + $this->setLangContent( + $this->lang, $lang . '_SMTPHOST_HINT', "localhost" + ); // set the mailer fields - $this->configFieldSets[] = PHP_EOL . $this->_t(2) . ""; + $this->configFieldSets[] = PHP_EOL . $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"radio\""; $this->configFieldSets[] = $this->_t(3) . "name=\"mailonline\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_MAILONLINE_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_MAILONLINE_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"btn-group btn-group-yesno\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_MAILONLINE_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" + . $lang . "_MAILONLINE_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) + . "class=\"btn-group btn-group-yesno\""; $this->configFieldSets[] = $this->_t(3) . "default=\"1\">"; - $this->configFieldSets[] = $this->_t(3) . ""; - $this->configFieldSets[] = $this->_t(3) . ""; - $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) + . ""; + $this->configFieldSets[] = $this->_t(3) + . ""; $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"list\""; $this->configFieldSets[] = $this->_t(3) . "name=\"mailer\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_MAILER_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_MAILER_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"list_class\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_MAILER_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" + . $lang . "_MAILER_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) + . "class=\"list_class\""; $this->configFieldSets[] = $this->_t(3) . "multiple=\"false\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"WORD\""; $this->configFieldSets[] = $this->_t(3) . "required=\"true\""; $this->configFieldSets[] = $this->_t(3) . "default=\"global\">"; - $this->configFieldSets[] = $this->_t(3) . ""; - $this->configFieldSets[] = $this->_t(3) . ""; - $this->configFieldSets[] = $this->_t(3) . ""; - $this->configFieldSets[] = $this->_t(3) . ""; - $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) + . ""; + $this->configFieldSets[] = $this->_t(3) + . ""; + $this->configFieldSets[] = $this->_t(3) + . ""; + $this->configFieldSets[] = $this->_t(3) + . ""; $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; $this->configFieldSets[] = $this->_t(3) . "name=\"emailfrom\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_EMAILFROM_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_EMAILFROM_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_EMAILFROM_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" + . $lang . "_EMAILFROM_DESCRIPTION\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; $this->configFieldSets[] = $this->_t(3) . "validate=\"email\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add email address here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_EMAILFROM_HINT\""; - $this->configFieldSets[] = $this->_t(3) . "showon=\"mailer:smtp,sendmail,default\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add email address here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_EMAILFROM_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "showon=\"mailer:smtp,sendmail,default\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; $this->configFieldSets[] = $this->_t(3) . "name=\"fromname\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_FROMNAME_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_FROMNAME_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_FROMNAME_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" + . $lang . "_FROMNAME_DESCRIPTION\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add some name here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_FROMNAME_HINT\""; - $this->configFieldSets[] = $this->_t(3) . "showon=\"mailer:smtp,sendmail,default\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add some name here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_FROMNAME_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "showon=\"mailer:smtp,sendmail,default\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; $this->configFieldSets[] = $this->_t(3) . "name=\"replyto\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_EMAILREPLY_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_EMAILREPLY_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_EMAILREPLY_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" + . $lang . "_EMAILREPLY_DESCRIPTION\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; $this->configFieldSets[] = $this->_t(3) . "validate=\"email\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add email address here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_EMAILREPLY_HINT\""; - $this->configFieldSets[] = $this->_t(3) . "showon=\"mailer:smtp,sendmail,default\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add email address here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_EMAILREPLY_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "showon=\"mailer:smtp,sendmail,default\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"replytoname\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_REPLYNAME_LABEL\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"replytoname\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_REPLYNAME_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_REPLYNAME_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" + . $lang . "_REPLYNAME_DESCRIPTION\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add some name here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_REPLYNAME_HINT\""; - $this->configFieldSets[] = $this->_t(3) . "showon=\"mailer:smtp,sendmail,default\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add some name here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_REPLYNAME_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "showon=\"mailer:smtp,sendmail,default\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; $this->configFieldSets[] = $this->_t(3) . "name=\"sendmail\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_SENDMAIL_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_SENDMAIL_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_SENDMAIL_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" + . $lang . "_SENDMAIL_DESCRIPTION\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "required=\"false\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"PATH\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add path to you local sendmail here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_SENDMAIL_HINT\""; - $this->configFieldSets[] = $this->_t(3) . "showon=\"mailer:sendmail\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add path to you local sendmail here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_SENDMAIL_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "showon=\"mailer:sendmail\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"radio\""; $this->configFieldSets[] = $this->_t(3) . "name=\"smtpauth\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_SMTPAUTH_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_SMTPAUTH_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"btn-group btn-group-yesno\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_SMTPAUTH_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" + . $lang . "_SMTPAUTH_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) + . "class=\"btn-group btn-group-yesno\""; $this->configFieldSets[] = $this->_t(3) . "default=\"0\""; - $this->configFieldSets[] = $this->_t(3) . "showon=\"mailer:smtp\">"; - $this->configFieldSets[] = $this->_t(3) . ""; - $this->configFieldSets[] = $this->_t(3) . ""; - $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) + . "showon=\"mailer:smtp\">"; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) + . ""; + $this->configFieldSets[] = $this->_t(3) + . ""; $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"list\""; $this->configFieldSets[] = $this->_t(3) . "name=\"smtpsecure\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_SMTPSECURE_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_SMTPSECURE_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"list_class\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_SMTPSECURE_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" + . $lang . "_SMTPSECURE_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) + . "class=\"list_class\""; $this->configFieldSets[] = $this->_t(3) . "multiple=\"false\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"WORD\""; $this->configFieldSets[] = $this->_t(3) . "default=\"none\""; - $this->configFieldSets[] = $this->_t(3) . "showon=\"mailer:smtp\">"; - $this->configFieldSets[] = $this->_t(3) . ""; - $this->configFieldSets[] = $this->_t(3) . ""; - $this->configFieldSets[] = $this->_t(3) . ""; - $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) + . "showon=\"mailer:smtp\">"; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) + . ""; + $this->configFieldSets[] = $this->_t(3) + . ""; + $this->configFieldSets[] = $this->_t(3) + . ""; $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; $this->configFieldSets[] = $this->_t(3) . "name=\"smtpport\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_SMTPPORT_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_SMTPPORT_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; $this->configFieldSets[] = $this->_t(3) . "default=\"25\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_SMTPPORT_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" + . $lang . "_SMTPPORT_DESCRIPTION\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add the port number of your SMTP server here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_SMTPPORT_HINT\""; - $this->configFieldSets[] = $this->_t(3) . "showon=\"mailer:smtp\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add the port number of your SMTP server here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_SMTPPORT_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "showon=\"mailer:smtp\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; $this->configFieldSets[] = $this->_t(3) . "name=\"smtpuser\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_SMTPUSER_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_SMTPUSER_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_SMTPUSER_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" + . $lang . "_SMTPUSER_DESCRIPTION\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add the username for SMTP server here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_SMTPUSER_HINT\""; - $this->configFieldSets[] = $this->_t(3) . "showon=\"mailer:smtp\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add the username for SMTP server here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_SMTPUSER_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "showon=\"mailer:smtp\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"password\""; $this->configFieldSets[] = $this->_t(3) . "name=\"smtppass\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_SMTPPASS_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_SMTPPASS_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_SMTPPASS_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" + . $lang . "_SMTPPASS_DESCRIPTION\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"raw\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add the password for SMTP server here.\""; - $this->configFieldSets[] = $this->_t(3) . "showon=\"mailer:smtp\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add the password for SMTP server here.\""; + $this->configFieldSets[] = $this->_t(3) + . "showon=\"mailer:smtp\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; $this->configFieldSets[] = $this->_t(3) . "name=\"smtphost\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_SMTPHOST_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_SMTPHOST_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; - $this->configFieldSets[] = $this->_t(3) . "default=\"localhost\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_SMTPHOST_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) + . "default=\"localhost\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" + . $lang . "_SMTPHOST_DESCRIPTION\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add the name of the SMTP host here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_SMTPHOST_HINT\""; - $this->configFieldSets[] = $this->_t(3) . "showon=\"mailer:smtp\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add the name of the SMTP host here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_SMTPHOST_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "showon=\"mailer:smtp\""; $this->configFieldSets[] = $this->_t(2) . "/>"; } // close that fieldset @@ -15369,37 +23473,91 @@ for developing fast and powerful web interfaces. For more info visit configFieldSets[] = $this->_t(1) . "configFieldSets[] = $this->_t(2) . "name=\"dkim_custom_config\""; - $this->configFieldSets[] = $this->_t(2) . "label=\"" . $lang . "_DKIM\">"; + $this->configFieldSets[] = $this->_t(2) + . "name=\"dkim_custom_config\""; + $this->configFieldSets[] = $this->_t(2) . "label=\"" . $lang + . "_DKIM\">"; // add custom DKIM fields - if (isset($this->configFieldSetsCustomField['DKIM']) && ComponentbuilderHelper::checkArray($this->configFieldSetsCustomField['DKIM'])) + if (isset($this->configFieldSetsCustomField['DKIM']) + && ComponentbuilderHelper::checkArray( + $this->configFieldSetsCustomField['DKIM'] + )) { - $this->configFieldSets[] = implode("", $this->configFieldSetsCustomField['DKIM']); + $this->configFieldSets[] = implode( + "", $this->configFieldSetsCustomField['DKIM'] + ); unset($this->configFieldSetsCustomField['DKIM']); } else { - $this->setLangContent($this->lang, $lang . '_DKIM_LABEL', "Enable DKIM"); - $this->setLangContent($this->lang, $lang . '_DKIM_DESCRIPTION', "Set this option to Yes if you want to sign your emails using DKIM."); + $this->setLangContent( + $this->lang, $lang . '_DKIM_LABEL', "Enable DKIM" + ); + $this->setLangContent( + $this->lang, $lang . '_DKIM_DESCRIPTION', + "Set this option to Yes if you want to sign your emails using DKIM." + ); $this->setLangContent($this->lang, $lang . '_YES', "Yes"); $this->setLangContent($this->lang, $lang . '_NO', "No"); - $this->setLangContent($this->lang, $lang . '_DKIM_DOMAIN_LABEL', "Domain"); - $this->setLangContent($this->lang, $lang . '_DKIM_DOMAIN_DESCRIPTION', "Set the domain. Eg. domain.com"); - $this->setLangContent($this->lang, $lang . '_DKIM_DOMAIN_HINT', "domain.com"); - $this->setLangContent($this->lang, $lang . '_DKIM_SELECTOR_LABEL', "Selector"); - $this->setLangContent($this->lang, $lang . '_DKIM_SELECTOR_DESCRIPTION', "Set your DKIM/DNS selector."); - $this->setLangContent($this->lang, $lang . '_DKIM_SELECTOR_HINT', "vdm"); - $this->setLangContent($this->lang, $lang . '_DKIM_PASSPHRASE_LABEL', "Passphrase"); - $this->setLangContent($this->lang, $lang . '_DKIM_PASSPHRASE_DESCRIPTION', "Enter your passphrase here."); - $this->setLangContent($this->lang, $lang . '_DKIM_IDENTITY_LABEL', "Identity"); - $this->setLangContent($this->lang, $lang . '_DKIM_IDENTITY_DESCRIPTION', "Set DKIM identity. This can be in the format of an email address 'you@yourdomain.com' typically used as the source of the email."); - $this->setLangContent($this->lang, $lang . '_DKIM_IDENTITY_HINT', "you@yourdomain.com"); - $this->setLangContent($this->lang, $lang . '_DKIM_PRIVATE_KEY_LABEL', "Private key"); - $this->setLangContent($this->lang, $lang . '_DKIM_PRIVATE_KEY_DESCRIPTION', "set private key"); - $this->setLangContent($this->lang, $lang . '_DKIM_PUBLIC_KEY_LABEL', "Public key"); - $this->setLangContent($this->lang, $lang . '_DKIM_PUBLIC_KEY_DESCRIPTION', "set public key"); - $this->setLangContent($this->lang, $lang . '_NOTE_DKIM_USE_LABEL', "Server Configuration"); - $this->setLangContent($this->lang, $lang . '_NOTE_DKIM_USE_DESCRIPTION', "

    Using the below details, you need to configure your DNS by adding a TXT record on your domain:

    + $this->setLangContent( + $this->lang, $lang . '_DKIM_DOMAIN_LABEL', "Domain" + ); + $this->setLangContent( + $this->lang, $lang . '_DKIM_DOMAIN_DESCRIPTION', + "Set the domain. Eg. domain.com" + ); + $this->setLangContent( + $this->lang, $lang . '_DKIM_DOMAIN_HINT', "domain.com" + ); + $this->setLangContent( + $this->lang, $lang . '_DKIM_SELECTOR_LABEL', "Selector" + ); + $this->setLangContent( + $this->lang, $lang . '_DKIM_SELECTOR_DESCRIPTION', + "Set your DKIM/DNS selector." + ); + $this->setLangContent( + $this->lang, $lang . '_DKIM_SELECTOR_HINT', "vdm" + ); + $this->setLangContent( + $this->lang, $lang . '_DKIM_PASSPHRASE_LABEL', "Passphrase" + ); + $this->setLangContent( + $this->lang, $lang . '_DKIM_PASSPHRASE_DESCRIPTION', + "Enter your passphrase here." + ); + $this->setLangContent( + $this->lang, $lang . '_DKIM_IDENTITY_LABEL', "Identity" + ); + $this->setLangContent( + $this->lang, $lang . '_DKIM_IDENTITY_DESCRIPTION', + "Set DKIM identity. This can be in the format of an email address 'you@yourdomain.com' typically used as the source of the email." + ); + $this->setLangContent( + $this->lang, $lang . '_DKIM_IDENTITY_HINT', + "you@yourdomain.com" + ); + $this->setLangContent( + $this->lang, $lang . '_DKIM_PRIVATE_KEY_LABEL', + "Private key" + ); + $this->setLangContent( + $this->lang, $lang . '_DKIM_PRIVATE_KEY_DESCRIPTION', + "set private key" + ); + $this->setLangContent( + $this->lang, $lang . '_DKIM_PUBLIC_KEY_LABEL', "Public key" + ); + $this->setLangContent( + $this->lang, $lang . '_DKIM_PUBLIC_KEY_DESCRIPTION', + "set public key" + ); + $this->setLangContent( + $this->lang, $lang . '_NOTE_DKIM_USE_LABEL', + "Server Configuration" + ); + $this->setLangContent( + $this->lang, $lang . '_NOTE_DKIM_USE_DESCRIPTION', "

    Using the below details, you need to configure your DNS by adding a TXT record on your domain:

    "); - $this->setLangContent($this->lang, $lang . '_DKIM_KEY_LABEL', "Key"); - $this->setLangContent($this->lang, $lang . '_DKIM_KEY_DESCRIPTION', "This is the KEY to use in the DNS record."); - $this->setLangContent($this->lang, $lang . '_DKIM_KEY_HINT', "vdm._domainkey"); - $this->setLangContent($this->lang, $lang . '_DKIM_VALUE_LABEL', "Value"); - $this->setLangContent($this->lang, $lang . '_DKIM_VALUE_DESCRIPTION', "This is the TXT value to use in the DNS. Replace the PUBLICKEY with your public key."); - $this->setLangContent($this->lang, $lang . '_DKIM_VALUE_HINT', "v=DKIM1;k=rsa;g=*;s=email;h=sha1;t=s;p=PUBLICKEY"); +" + ); + $this->setLangContent( + $this->lang, $lang . '_DKIM_KEY_LABEL', "Key" + ); + $this->setLangContent( + $this->lang, $lang . '_DKIM_KEY_DESCRIPTION', + "This is the KEY to use in the DNS record." + ); + $this->setLangContent( + $this->lang, $lang . '_DKIM_KEY_HINT', "vdm._domainkey" + ); + $this->setLangContent( + $this->lang, $lang . '_DKIM_VALUE_LABEL', "Value" + ); + $this->setLangContent( + $this->lang, $lang . '_DKIM_VALUE_DESCRIPTION', + "This is the TXT value to use in the DNS. Replace the PUBLICKEY with your public key." + ); + $this->setLangContent( + $this->lang, $lang . '_DKIM_VALUE_HINT', + "v=DKIM1;k=rsa;g=*;s=email;h=sha1;t=s;p=PUBLICKEY" + ); - $this->configFieldSets[] = PHP_EOL . $this->_t(2) . ""; + $this->configFieldSets[] = PHP_EOL . $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"radio\""; $this->configFieldSets[] = $this->_t(3) . "name=\"dkim\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_DKIM_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_DKIM_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"btn-group btn-group-yesno\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_DKIM_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" + . $lang . "_DKIM_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) + . "class=\"btn-group btn-group-yesno\""; $this->configFieldSets[] = $this->_t(3) . "default=\"0\""; $this->configFieldSets[] = $this->_t(3) . "required=\"true\">"; - $this->configFieldSets[] = $this->_t(3) . ""; - $this->configFieldSets[] = $this->_t(3) . ""; - $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) . ""; + $this->configFieldSets[] = $this->_t(3) + . ""; + $this->configFieldSets[] = $this->_t(3) + . ""; $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"dkim_domain\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_DKIM_DOMAIN_LABEL\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"dkim_domain\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_DKIM_DOMAIN_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_DKIM_DOMAIN_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" + . $lang . "_DKIM_DOMAIN_DESCRIPTION\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add DKIM Domain here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_DKIM_DOMAIN_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add DKIM Domain here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_DKIM_DOMAIN_HINT\""; $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; - $this->configFieldSets[] = $this->_t(3) . "onchange=\"vdm_dkim();\""; + $this->configFieldSets[] = $this->_t(3) + . "onchange=\"vdm_dkim();\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"dkim_selector\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_DKIM_SELECTOR_LABEL\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"dkim_selector\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_DKIM_SELECTOR_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; $this->configFieldSets[] = $this->_t(3) . "default=\"vdm\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_DKIM_SELECTOR_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" + . $lang . "_DKIM_SELECTOR_DESCRIPTION\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add DKIM/DNS selector here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_DKIM_SELECTOR_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add DKIM/DNS selector here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_DKIM_SELECTOR_HINT\""; $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; - $this->configFieldSets[] = $this->_t(3) . "onchange=\"vdm_dkim();\""; + $this->configFieldSets[] = $this->_t(3) + . "onchange=\"vdm_dkim();\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"password\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"dkim_passphrase\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_DKIM_PASSPHRASE_LABEL\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"dkim_passphrase\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_DKIM_PASSPHRASE_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_DKIM_PASSPHRASE_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" + . $lang . "_DKIM_PASSPHRASE_DESCRIPTION\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"raw\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add passphrase here.\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add passphrase here.\""; $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"dkim_identity\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_DKIM_IDENTITY_LABEL\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"dkim_identity\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_DKIM_IDENTITY_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"60\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_DKIM_IDENTITY_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" + . $lang . "_DKIM_IDENTITY_DESCRIPTION\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"raw\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add DKIM Identity here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_DKIM_IDENTITY_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add DKIM Identity here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_DKIM_IDENTITY_HINT\""; $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"textarea\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"dkim_private_key\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_DKIM_PRIVATE_KEY_LABEL\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"dkim_private_key\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_DKIM_PRIVATE_KEY_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "rows=\"15\""; $this->configFieldSets[] = $this->_t(3) . "cols=\"5\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_DKIM_PRIVATE_KEY_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"input-xxlarge span12\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" + . $lang . "_DKIM_PRIVATE_KEY_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) + . "class=\"input-xxlarge span12\""; $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"textarea\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"dkim_public_key\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_DKIM_PUBLIC_KEY_LABEL\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"dkim_public_key\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_DKIM_PUBLIC_KEY_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "rows=\"5\""; $this->configFieldSets[] = $this->_t(3) . "cols=\"5\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_DKIM_PUBLIC_KEY_DESCRIPTION\""; - $this->configFieldSets[] = $this->_t(3) . "class=\"input-xxlarge span12\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" + . $lang . "_DKIM_PUBLIC_KEY_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) + . "class=\"input-xxlarge span12\""; $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; - $this->configFieldSets[] = $this->_t(3) . "onchange=\"vdm_dkim();\""; + $this->configFieldSets[] = $this->_t(3) + . "onchange=\"vdm_dkim();\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) + . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; $this->configFieldSets[] = $this->_t(3) . "name=\"dkim_key\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_DKIM_KEY_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_DKIM_KEY_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"40\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"150\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_DKIM_KEY_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" + . $lang . "_DKIM_KEY_DESCRIPTION\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add KEY here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_DKIM_KEY_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add KEY here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_DKIM_KEY_HINT\""; $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; $this->configFieldSets[] = $this->_t(3) . "name=\"dkim_value\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_DKIM_VALUE_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_DKIM_VALUE_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"80\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"350\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_DKIM_VALUE_DESCRIPTION\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" + . $lang . "_DKIM_VALUE_DESCRIPTION\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"STRING\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add TXT record here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_DKIM_VALUE_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add TXT record here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_DKIM_VALUE_HINT\""; $this->configFieldSets[] = $this->_t(3) . "showon=\"dkim:1\""; $this->configFieldSets[] = $this->_t(2) . "/>"; } @@ -15570,286 +23813,535 @@ function vdm_dkim() { if ($this->googlechart) { $this->configFieldSets[] = PHP_EOL . $this->_t(1) . "configFieldSets[] = $this->_t(2) . "name=\"googlechart_config\""; - $this->configFieldSets[] = $this->_t(2) . "label=\"" . $lang . "_CHART_SETTINGS_LABEL\""; - $this->configFieldSets[] = $this->_t(2) . "description=\"" . $lang . "_CHART_SETTINGS_DESC\">"; + $this->configFieldSets[] = $this->_t(2) + . "name=\"googlechart_config\""; + $this->configFieldSets[] = $this->_t(2) . "label=\"" . $lang + . "_CHART_SETTINGS_LABEL\""; + $this->configFieldSets[] = $this->_t(2) . "description=\"" . $lang + . "_CHART_SETTINGS_DESC\">"; $this->configFieldSets[] = $this->_t(2); - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) + . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"admin_chartbackground\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"admin_chartbackground\""; $this->configFieldSets[] = $this->_t(3) . "default=\"#F7F7FA\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_CHARTBACKGROUND_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_CHARTBACKGROUND_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_CHARTBACKGROUND_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + . "_CHARTBACKGROUND_DESC\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"admin_mainwidth\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_MAINWIDTH_LABEL\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"admin_mainwidth\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_MAINWIDTH_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_MAINWIDTH_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + . "_MAINWIDTH_DESC\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add area width here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_MAINWIDTH_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add area width here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_MAINWIDTH_HINT\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) + . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"admin_chartareatop\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_CHARTAREATOP_LABEL\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"admin_chartareatop\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_CHARTAREATOP_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_CHARTAREATOP_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + . "_CHARTAREATOP_DESC\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add top spacing here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_CHARTAREATOP_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add top spacing here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_CHARTAREATOP_HINT\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"admin_chartarealeft\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_CHARTAREALEFT_LABEL\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"admin_chartarealeft\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_CHARTAREALEFT_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_CHARTAREALEFT_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + . "_CHARTAREALEFT_DESC\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add left spacing here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_CHARTAREALEFT_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add left spacing here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_CHARTAREALEFT_HINT\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"admin_chartareawidth\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_CHARTAREAWIDTH_LABEL\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"admin_chartareawidth\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_CHARTAREAWIDTH_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_CHARTAREAWIDTH_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + . "_CHARTAREAWIDTH_DESC\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add chart width here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_CHARTAREAWIDTH_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add chart width here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_CHARTAREAWIDTH_HINT\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) + . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"admin_legendtextstylefontcolor\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"admin_legendtextstylefontcolor\""; $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_LEGENDTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_LEGENDTEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_LEGENDTEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + . "_LEGENDTEXTSTYLEFONTCOLOR_DESC\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"admin_legendtextstylefontsize\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_LABEL\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"admin_legendtextstylefontsize\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_LEGENDTEXTSTYLEFONTSIZE_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + . "_LEGENDTEXTSTYLEFONTSIZE_DESC\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add size of the legend here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add size of the legend here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_LEGENDTEXTSTYLEFONTSIZE_HINT\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) + . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"admin_vaxistextstylefontcolor\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"admin_vaxistextstylefontcolor\""; $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_VAXISTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_VAXISTEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_VAXISTEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + . "_VAXISTEXTSTYLEFONTCOLOR_DESC\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) + . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"admin_haxistextstylefontcolor\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"admin_haxistextstylefontcolor\""; $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_HAXISTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_HAXISTEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_HAXISTEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + . "_HAXISTEXTSTYLEFONTCOLOR_DESC\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"admin_haxistitletextstylefontcolor\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"admin_haxistitletextstylefontcolor\""; $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_HAXISTITLETEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + . "_HAXISTITLETEXTSTYLEFONTCOLOR_DESC\""; $this->configFieldSets[] = $this->_t(2) . "/>"; $this->configFieldSets[] = $this->_t(2); - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) + . ""; $this->configFieldSets[] = $this->_t(2); - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"site_chartbackground\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"site_chartbackground\""; $this->configFieldSets[] = $this->_t(3) . "default=\"#F7F7FA\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_CHARTBACKGROUND_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_CHARTBACKGROUND_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_CHARTBACKGROUND_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + . "_CHARTBACKGROUND_DESC\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; $this->configFieldSets[] = $this->_t(3) . "name=\"site_mainwidth\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_MAINWIDTH_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_MAINWIDTH_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_MAINWIDTH_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + . "_MAINWIDTH_DESC\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add area width here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_MAINWIDTH_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add area width here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_MAINWIDTH_HINT\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) + . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"site_chartareatop\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_CHARTAREATOP_LABEL\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"site_chartareatop\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_CHARTAREATOP_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_CHARTAREATOP_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + . "_CHARTAREATOP_DESC\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add top spacing here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_CHARTAREATOP_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add top spacing here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_CHARTAREATOP_HINT\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"site_chartarealeft\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_CHARTAREALEFT_LABEL\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"site_chartarealeft\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_CHARTAREALEFT_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_CHARTAREALEFT_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + . "_CHARTAREALEFT_DESC\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add left spacing here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_CHARTAREALEFT_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add left spacing here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_CHARTAREALEFT_HINT\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"site_chartareawidth\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_CHARTAREAWIDTH_LABEL\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"site_chartareawidth\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_CHARTAREAWIDTH_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_CHARTAREAWIDTH_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + . "_CHARTAREAWIDTH_DESC\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add chart width here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_CHARTAREAWIDTH_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add chart width here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_CHARTAREAWIDTH_HINT\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) + . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"site_legendtextstylefontcolor\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"site_legendtextstylefontcolor\""; $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_LEGENDTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_LEGENDTEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_LEGENDTEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + . "_LEGENDTEXTSTYLEFONTCOLOR_DESC\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"text\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"site_legendtextstylefontsize\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_LABEL\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"site_legendtextstylefontsize\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_LEGENDTEXTSTYLEFONTSIZE_LABEL\""; $this->configFieldSets[] = $this->_t(3) . "size=\"20\""; $this->configFieldSets[] = $this->_t(3) . "maxlength=\"50\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + . "_LEGENDTEXTSTYLEFONTSIZE_DESC\""; $this->configFieldSets[] = $this->_t(3) . "class=\"text_area\""; $this->configFieldSets[] = $this->_t(3) . "filter=\"INT\""; - $this->configFieldSets[] = $this->_t(3) . "message=\"Error! Please add size of the legend here.\""; - $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_HINT\""; + $this->configFieldSets[] = $this->_t(3) + . "message=\"Error! Please add size of the legend here.\""; + $this->configFieldSets[] = $this->_t(3) . "hint=\"" . $lang + . "_LEGENDTEXTSTYLEFONTSIZE_HINT\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) + . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"site_vaxistextstylefontcolor\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"site_vaxistextstylefontcolor\""; $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_VAXISTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_VAXISTEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_VAXISTEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + . "_VAXISTEXTSTYLEFONTCOLOR_DESC\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) + . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"site_haxistextstylefontcolor\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"site_haxistextstylefontcolor\""; $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_HAXISTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_HAXISTEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_HAXISTEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + . "_HAXISTEXTSTYLEFONTCOLOR_DESC\""; $this->configFieldSets[] = $this->_t(2) . "/>"; - $this->configFieldSets[] = $this->_t(2) . ""; + $this->configFieldSets[] = $this->_t(2) . ""; $this->configFieldSets[] = $this->_t(2) . "configFieldSets[] = $this->_t(3) . "type=\"color\""; - $this->configFieldSets[] = $this->_t(3) . "name=\"site_haxistitletextstylefontcolor\""; + $this->configFieldSets[] = $this->_t(3) + . "name=\"site_haxistitletextstylefontcolor\""; $this->configFieldSets[] = $this->_t(3) . "default=\"#63B1F2\""; - $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_HAXISTITLETEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = $this->_t(3) . "label=\"" . $lang + . "_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = $this->_t(3) . "description=\"" . $lang + . "_HAXISTITLETEXTSTYLEFONTCOLOR_DESC\""; $this->configFieldSets[] = $this->_t(2) . "/>"; // add custom Encryption Settings fields - if (isset($this->configFieldSetsCustomField['Chart Settings']) && ComponentbuilderHelper::checkArray($this->configFieldSetsCustomField['Chart Settings'])) + if (isset($this->configFieldSetsCustomField['Chart Settings']) + && ComponentbuilderHelper::checkArray( + $this->configFieldSetsCustomField['Chart Settings'] + )) { - $this->configFieldSets[] = implode("", $this->configFieldSetsCustomField['Chart Settings']); + $this->configFieldSets[] = implode( + "", $this->configFieldSetsCustomField['Chart Settings'] + ); unset($this->configFieldSetsCustomField['Chart Settings']); } $this->configFieldSets[] = $this->_t(1) . ""; // set params defaults - $this->extensionsParams[] = '"admin_chartbackground":"#F7F7FA","admin_mainwidth":"1000","admin_chartareatop":"20","admin_chartarealeft":"20","admin_chartareawidth":"170","admin_legendtextstylefontcolor":"10","admin_legendtextstylefontsize":"20","admin_vaxistextstylefontcolor":"#63B1F2","admin_haxistextstylefontcolor":"#63B1F2","admin_haxistitletextstylefontcolor":"#63B1F2","site_chartbackground":"#F7F7FA","site_mainwidth":"1000","site_chartareatop":"20","site_chartarealeft":"20","site_chartareawidth":"170","site_legendtextstylefontcolor":"10","site_legendtextstylefontsize":"20","site_vaxistextstylefontcolor":"#63B1F2","site_haxistextstylefontcolor":"#63B1F2","site_haxistitletextstylefontcolor":"#63B1F2"'; + $this->extensionsParams[] + = '"admin_chartbackground":"#F7F7FA","admin_mainwidth":"1000","admin_chartareatop":"20","admin_chartarealeft":"20","admin_chartareawidth":"170","admin_legendtextstylefontcolor":"10","admin_legendtextstylefontsize":"20","admin_vaxistextstylefontcolor":"#63B1F2","admin_haxistextstylefontcolor":"#63B1F2","admin_haxistitletextstylefontcolor":"#63B1F2","site_chartbackground":"#F7F7FA","site_mainwidth":"1000","site_chartareatop":"20","site_chartarealeft":"20","site_chartareawidth":"170","site_legendtextstylefontcolor":"10","site_legendtextstylefontsize":"20","site_vaxistextstylefontcolor":"#63B1F2","site_haxistextstylefontcolor":"#63B1F2","site_haxistitletextstylefontcolor":"#63B1F2"'; // set field lang - $this->setLangContent($this->lang, $lang . '_CHART_SETTINGS_LABEL', "Chart Settings"); - $this->setLangContent($this->lang, $lang . '_CHART_SETTINGS_DESC', "The Google Chart Display Settings Are Made Here."); - $this->setLangContent($this->lang, $lang . '_ADMIN_CHART_NOTE_LABEL', "Admin Settings"); - $this->setLangContent($this->lang, $lang . '_ADMIN_CHART_NOTE_DESC', "The following settings are used on the back-end of the site called (admin)."); - $this->setLangContent($this->lang, $lang . '_SITE_CHART_NOTE_LABEL', "Site Settings"); - $this->setLangContent($this->lang, $lang . '_SITE_CHART_NOTE_DESC', "The following settings are used on the front-end of the site called (site)."); + $this->setLangContent( + $this->lang, $lang . '_CHART_SETTINGS_LABEL', "Chart Settings" + ); + $this->setLangContent( + $this->lang, $lang . '_CHART_SETTINGS_DESC', + "The Google Chart Display Settings Are Made Here." + ); + $this->setLangContent( + $this->lang, $lang . '_ADMIN_CHART_NOTE_LABEL', "Admin Settings" + ); + $this->setLangContent( + $this->lang, $lang . '_ADMIN_CHART_NOTE_DESC', + "The following settings are used on the back-end of the site called (admin)." + ); + $this->setLangContent( + $this->lang, $lang . '_SITE_CHART_NOTE_LABEL', "Site Settings" + ); + $this->setLangContent( + $this->lang, $lang . '_SITE_CHART_NOTE_DESC', + "The following settings are used on the front-end of the site called (site)." + ); - $this->setLangContent($this->lang, $lang . '_CHARTAREALEFT_DESC', "Set in pixels the spacing from the left of the chart area to the beginning of the chart it self. Please don't add the px sign"); - $this->setLangContent($this->lang, $lang . '_CHARTAREALEFT_HINT', "170"); - $this->setLangContent($this->lang, $lang . '_CHARTAREALEFT_LABEL', "Left Spacing"); - $this->setLangContent($this->lang, $lang . '_CHARTAREATOP_DESC', "Set in pixels the spacing from the top of the chart area to the beginning of the chart it self. Please don't add the px sign"); - $this->setLangContent($this->lang, $lang . '_CHARTAREATOP_HINT', "20"); - $this->setLangContent($this->lang, $lang . '_CHARTAREATOP_LABEL', "Top Spacing"); - $this->setLangContent($this->lang, $lang . '_CHARTAREAWIDTH_DESC', "Set in % the width of the chart it self inside the chart area. Please don't add the % sign"); - $this->setLangContent($this->lang, $lang . '_CHARTAREAWIDTH_HINT', "60"); - $this->setLangContent($this->lang, $lang . '_CHARTAREAWIDTH_LABEL', "Chart Width"); - $this->setLangContent($this->lang, $lang . '_CHARTBACKGROUND_DESC', "Select the chart background color here."); - $this->setLangContent($this->lang, $lang . '_CHARTBACKGROUND_LABEL', "Chart Background"); - $this->setLangContent($this->lang, $lang . '_HAXISTEXTSTYLEFONTCOLOR_DESC', "Select the horizontal axis font color."); - $this->setLangContent($this->lang, $lang . '_HAXISTEXTSTYLEFONTCOLOR_LABEL', "hAxis Font Color"); - $this->setLangContent($this->lang, $lang . '_HAXISTITLETEXTSTYLEFONTCOLOR_DESC', "Select the horizontal axis title's font color."); - $this->setLangContent($this->lang, $lang . '_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL', "hAxis Title Font Color"); - $this->setLangContent($this->lang, $lang . '_LEGENDTEXTSTYLEFONTCOLOR_DESC', "Select the legend font color."); - $this->setLangContent($this->lang, $lang . '_LEGENDTEXTSTYLEFONTCOLOR_LABEL', "Legend Font Color"); - $this->setLangContent($this->lang, $lang . '_LEGENDTEXTSTYLEFONTSIZE_DESC', "Set in pixels the font size of the legend"); - $this->setLangContent($this->lang, $lang . '_LEGENDTEXTSTYLEFONTSIZE_HINT', "10"); - $this->setLangContent($this->lang, $lang . '_LEGENDTEXTSTYLEFONTSIZE_LABEL', "Legend Font Size"); - $this->setLangContent($this->lang, $lang . '_MAINWIDTH_DESC', "Set the width of the entire chart area"); - $this->setLangContent($this->lang, $lang . '_MAINWIDTH_HINT', "1000"); - $this->setLangContent($this->lang, $lang . '_MAINWIDTH_LABEL', "Chart Area Width"); - $this->setLangContent($this->lang, $lang . '_VAXISTEXTSTYLEFONTCOLOR_DESC', "Select the vertical axis font color."); - $this->setLangContent($this->lang, $lang . '_VAXISTEXTSTYLEFONTCOLOR_LABEL', "vAxis Font Color"); + $this->setLangContent( + $this->lang, $lang . '_CHARTAREALEFT_DESC', + "Set in pixels the spacing from the left of the chart area to the beginning of the chart it self. Please don't add the px sign" + ); + $this->setLangContent( + $this->lang, $lang . '_CHARTAREALEFT_HINT', "170" + ); + $this->setLangContent( + $this->lang, $lang . '_CHARTAREALEFT_LABEL', "Left Spacing" + ); + $this->setLangContent( + $this->lang, $lang . '_CHARTAREATOP_DESC', + "Set in pixels the spacing from the top of the chart area to the beginning of the chart it self. Please don't add the px sign" + ); + $this->setLangContent( + $this->lang, $lang . '_CHARTAREATOP_HINT', "20" + ); + $this->setLangContent( + $this->lang, $lang . '_CHARTAREATOP_LABEL', "Top Spacing" + ); + $this->setLangContent( + $this->lang, $lang . '_CHARTAREAWIDTH_DESC', + "Set in % the width of the chart it self inside the chart area. Please don't add the % sign" + ); + $this->setLangContent( + $this->lang, $lang . '_CHARTAREAWIDTH_HINT', "60" + ); + $this->setLangContent( + $this->lang, $lang . '_CHARTAREAWIDTH_LABEL', "Chart Width" + ); + $this->setLangContent( + $this->lang, $lang . '_CHARTBACKGROUND_DESC', + "Select the chart background color here." + ); + $this->setLangContent( + $this->lang, $lang . '_CHARTBACKGROUND_LABEL', + "Chart Background" + ); + $this->setLangContent( + $this->lang, $lang . '_HAXISTEXTSTYLEFONTCOLOR_DESC', + "Select the horizontal axis font color." + ); + $this->setLangContent( + $this->lang, $lang . '_HAXISTEXTSTYLEFONTCOLOR_LABEL', + "hAxis Font Color" + ); + $this->setLangContent( + $this->lang, $lang . '_HAXISTITLETEXTSTYLEFONTCOLOR_DESC', + "Select the horizontal axis title's font color." + ); + $this->setLangContent( + $this->lang, $lang . '_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL', + "hAxis Title Font Color" + ); + $this->setLangContent( + $this->lang, $lang . '_LEGENDTEXTSTYLEFONTCOLOR_DESC', + "Select the legend font color." + ); + $this->setLangContent( + $this->lang, $lang . '_LEGENDTEXTSTYLEFONTCOLOR_LABEL', + "Legend Font Color" + ); + $this->setLangContent( + $this->lang, $lang . '_LEGENDTEXTSTYLEFONTSIZE_DESC', + "Set in pixels the font size of the legend" + ); + $this->setLangContent( + $this->lang, $lang . '_LEGENDTEXTSTYLEFONTSIZE_HINT', "10" + ); + $this->setLangContent( + $this->lang, $lang . '_LEGENDTEXTSTYLEFONTSIZE_LABEL', + "Legend Font Size" + ); + $this->setLangContent( + $this->lang, $lang . '_MAINWIDTH_DESC', + "Set the width of the entire chart area" + ); + $this->setLangContent( + $this->lang, $lang . '_MAINWIDTH_HINT', "1000" + ); + $this->setLangContent( + $this->lang, $lang . '_MAINWIDTH_LABEL', "Chart Area Width" + ); + $this->setLangContent( + $this->lang, $lang . '_VAXISTEXTSTYLEFONTCOLOR_DESC', + "Select the vertical axis font color." + ); + $this->setLangContent( + $this->lang, $lang . '_VAXISTEXTSTYLEFONTCOLOR_LABEL', + "vAxis Font Color" + ); } } @@ -15861,73 +24353,132 @@ function vdm_dkim() { // enable the loading of dynamic field sets $dynamicAddFields = array(); // Add encryption if needed - if ((isset($this->basicEncryption) && $this->basicEncryption) || - (isset($this->whmcsEncryption) && $this->whmcsEncryption) || - (isset($this->mediumEncryption) && $this->mediumEncryption) || - $this->componentData->add_license || - (isset($this->configFieldSetsCustomField['Encryption Settings']) && ComponentbuilderHelper::checkArray($this->configFieldSetsCustomField['Encryption Settings']))) + if ((isset($this->basicEncryption) && $this->basicEncryption) + || (isset($this->whmcsEncryption) && $this->whmcsEncryption) + || (isset($this->mediumEncryption) && $this->mediumEncryption) + || $this->componentData->add_license + || (isset($this->configFieldSetsCustomField['Encryption Settings']) + && ComponentbuilderHelper::checkArray( + $this->configFieldSetsCustomField['Encryption Settings'] + ))) { $dynamicAddFields[] = "Encryption Settings"; // start building field set for encryption functions $this->configFieldSets[] = $this->_t(1) . "configFieldSets[] = $this->_t(2) . 'name="encryption_config"'; - $this->configFieldSets[] = $this->_t(2) . 'label="' . $lang . '_ENCRYPTION_LABEL"'; - $this->configFieldSets[] = $this->_t(2) . 'description="' . $lang . '_ENCRYPTION_DESC">'; + $this->configFieldSets[] = $this->_t(2) + . 'name="encryption_config"'; + $this->configFieldSets[] = $this->_t(2) . 'label="' . $lang + . '_ENCRYPTION_LABEL"'; + $this->configFieldSets[] = $this->_t(2) . 'description="' . $lang + . '_ENCRYPTION_DESC">'; // set tab lang - if (((isset($this->basicEncryption) && $this->basicEncryption) || - (isset($this->mediumEncryption) && $this->mediumEncryption) || - (isset($this->whmcsEncryption) && $this->whmcsEncryption)) && - $this->componentData->add_license && $this->componentData->license_type == 3) + if (((isset($this->basicEncryption) && $this->basicEncryption) + || (isset($this->mediumEncryption) + && $this->mediumEncryption) + || (isset($this->whmcsEncryption) + && $this->whmcsEncryption)) + && $this->componentData->add_license + && $this->componentData->license_type == 3) { - $this->setLangContent($this->lang, $lang . '_ENCRYPTION_LABEL', "License & Encryption Settings"); - $this->setLangContent($this->lang, $lang . '_ENCRYPTION_DESC', "The license & encryption keys are set here."); + $this->setLangContent( + $this->lang, $lang . '_ENCRYPTION_LABEL', + "License & Encryption Settings" + ); + $this->setLangContent( + $this->lang, $lang . '_ENCRYPTION_DESC', + "The license & encryption keys are set here." + ); // add the next dynamic option $dynamicAddFields[] = "License & Encryption Settings"; } - elseif (((isset($this->basicEncryption) && $this->basicEncryption) || - (isset($this->mediumEncryption) && $this->mediumEncryption) || - (isset($this->whmcsEncryption) && $this->whmcsEncryption)) && - $this->componentData->add_license && $this->componentData->license_type == 2) + elseif (((isset($this->basicEncryption) && $this->basicEncryption) + || (isset($this->mediumEncryption) + && $this->mediumEncryption) + || (isset($this->whmcsEncryption) + && $this->whmcsEncryption)) + && $this->componentData->add_license + && $this->componentData->license_type == 2) { - $this->setLangContent($this->lang, $lang . '_ENCRYPTION_LABEL', "Update & Encryption Settings"); - $this->setLangContent($this->lang, $lang . '_ENCRYPTION_DESC', "The update & encryption keys are set here."); + $this->setLangContent( + $this->lang, $lang . '_ENCRYPTION_LABEL', + "Update & Encryption Settings" + ); + $this->setLangContent( + $this->lang, $lang . '_ENCRYPTION_DESC', + "The update & encryption keys are set here." + ); // add the next dynamic option $dynamicAddFields[] = "Update & Encryption Settings"; } - elseif ($this->componentData->add_license && $this->componentData->license_type == 3) + elseif ($this->componentData->add_license + && $this->componentData->license_type == 3) { - $this->setLangContent($this->lang, $lang . '_ENCRYPTION_LABEL', "License Settings"); - $this->setLangContent($this->lang, $lang . '_ENCRYPTION_DESC', "The license key is set here."); + $this->setLangContent( + $this->lang, $lang . '_ENCRYPTION_LABEL', "License Settings" + ); + $this->setLangContent( + $this->lang, $lang . '_ENCRYPTION_DESC', + "The license key is set here." + ); // add the next dynamic option $dynamicAddFields[] = "License Settings"; } - elseif ($this->componentData->add_license && $this->componentData->license_type == 2) + elseif ($this->componentData->add_license + && $this->componentData->license_type == 2) { - $this->setLangContent($this->lang, $lang . '_ENCRYPTION_LABEL', "Update Settings"); - $this->setLangContent($this->lang, $lang . '_ENCRYPTION_DESC', "The update key is set here."); + $this->setLangContent( + $this->lang, $lang . '_ENCRYPTION_LABEL', "Update Settings" + ); + $this->setLangContent( + $this->lang, $lang . '_ENCRYPTION_DESC', + "The update key is set here." + ); // add the next dynamic option $dynamicAddFields[] = "Update Settings"; } else { - $this->setLangContent($this->lang, $lang . '_ENCRYPTION_LABEL', "Encryption Settings"); - $this->setLangContent($this->lang, $lang . '_ENCRYPTION_DESC', "The encryption key for the field encryption is set here."); + $this->setLangContent( + $this->lang, $lang . '_ENCRYPTION_LABEL', + "Encryption Settings" + ); + $this->setLangContent( + $this->lang, $lang . '_ENCRYPTION_DESC', + "The encryption key for the field encryption is set here." + ); } if (isset($this->basicEncryption) && $this->basicEncryption) { // set field lang - $this->setLangContent($this->lang, $lang . '_BASIC_KEY_LABEL', "Basic Key"); - $this->setLangContent($this->lang, $lang . '_BASIC_KEY_DESC', "Set the basic local key here."); - $this->setLangContent($this->lang, $lang . '_BASIC_KEY_NOTE_LABEL', "Basic Encryption"); - $this->setLangContent($this->lang, $lang . '_BASIC_KEY_NOTE_DESC', "When using the basic encryption please use set a 32 character passphrase.
    Never change this passphrase once it is set! DATA WILL GET CORRUPTED IF YOU DO!"); + $this->setLangContent( + $this->lang, $lang . '_BASIC_KEY_LABEL', "Basic Key" + ); + $this->setLangContent( + $this->lang, $lang . '_BASIC_KEY_DESC', + "Set the basic local key here." + ); + $this->setLangContent( + $this->lang, $lang . '_BASIC_KEY_NOTE_LABEL', + "Basic Encryption" + ); + $this->setLangContent( + $this->lang, $lang . '_BASIC_KEY_NOTE_DESC', + "When using the basic encryption please use set a 32 character passphrase.
    Never change this passphrase once it is set! DATA WILL GET CORRUPTED IF YOU DO!" + ); // set the field - $this->configFieldSets[] = $this->_t(2) . ''; - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(2) + . ''; + $this->configFieldSets[] = $this->_t(2) + . 'configFieldSets[] = $this->_t(3) . 'type="text"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_BASIC_KEY_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_BASIC_KEY_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang + . '_BASIC_KEY_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' + . $lang . '_BASIC_KEY_DESC"'; $this->configFieldSets[] = $this->_t(3) . 'size="60"'; $this->configFieldSets[] = $this->_t(3) . 'default=""'; $this->configFieldSets[] = $this->_t(2) . "/>"; @@ -15935,77 +24486,159 @@ function vdm_dkim() { if (isset($this->mediumEncryption) && $this->mediumEncryption) { // set field lang - $this->setLangContent($this->lang, $lang . '_MEDIUM_KEY_LABEL', "Medium Key (Path)"); - $this->setLangContent($this->lang, $lang . '_MEDIUM_KEY_DESC', "Set the full path to where the key file must be stored. Make sure it is behind the root folder of your website, so that it is not public accessible."); - $this->setLangContent($this->lang, $lang . '_MEDIUM_KEY_NOTE_LABEL', "Medium Encryption"); - $this->setLangContent($this->lang, $lang . '_MEDIUM_KEY_NOTE_DESC', "When using the medium encryption option, the system generates its own key and stores it in a file at the folder/path you set here.
    Never change this key once it is set, or remove the key file! DATA WILL GET CORRUPTED IF YOU DO! Also make sure the full path to where the the key file should be stored, is behind the root folder of your website/system, so that it is not public accessible. Making a backup of this key file over a secure connection is recommended!"); + $this->setLangContent( + $this->lang, $lang . '_MEDIUM_KEY_LABEL', + "Medium Key (Path)" + ); + $this->setLangContent( + $this->lang, $lang . '_MEDIUM_KEY_DESC', + "Set the full path to where the key file must be stored. Make sure it is behind the root folder of your website, so that it is not public accessible." + ); + $this->setLangContent( + $this->lang, $lang . '_MEDIUM_KEY_NOTE_LABEL', + "Medium Encryption" + ); + $this->setLangContent( + $this->lang, $lang . '_MEDIUM_KEY_NOTE_DESC', + "When using the medium encryption option, the system generates its own key and stores it in a file at the folder/path you set here.
    Never change this key once it is set, or remove the key file! DATA WILL GET CORRUPTED IF YOU DO! Also make sure the full path to where the the key file should be stored, is behind the root folder of your website/system, so that it is not public accessible. Making a backup of this key file over a secure connection is recommended!" + ); // set the field - $this->configFieldSets[] = $this->_t(2) . ''; - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(2) + . ''; + $this->configFieldSets[] = $this->_t(2) + . 'configFieldSets[] = $this->_t(3) . 'type="text"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_MEDIUM_KEY_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_MEDIUM_KEY_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang + . '_MEDIUM_KEY_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' + . $lang . '_MEDIUM_KEY_DESC"'; $this->configFieldSets[] = $this->_t(3) . 'size="160"'; $this->configFieldSets[] = $this->_t(3) . 'filter="PATH"'; - $this->configFieldSets[] = $this->_t(3) . 'hint="/home/user/hiddenfolder123/"'; + $this->configFieldSets[] = $this->_t(3) + . 'hint="/home/user/hiddenfolder123/"'; $this->configFieldSets[] = $this->_t(3) . 'default=""'; $this->configFieldSets[] = $this->_t(2) . "/>"; // set some error message if the path does not exist - $this->setLangContent($this->lang, $lang . '_MEDIUM_KEY_PATH_ERROR', "Medium key path (for encryption of various fields) does not exist, or is not writable. Please check the path and update it in the global option of this component."); + $this->setLangContent( + $this->lang, $lang . '_MEDIUM_KEY_PATH_ERROR', + "Medium key path (for encryption of various fields) does not exist, or is not writable. Please check the path and update it in the global option of this component." + ); } - if (isset($this->whmcsEncryption) && $this->whmcsEncryption || $this->componentData->add_license) + if (isset($this->whmcsEncryption) && $this->whmcsEncryption + || $this->componentData->add_license) { // set field lang label and description - if ($this->componentData->add_license && $this->componentData->license_type == 3) + if ($this->componentData->add_license + && $this->componentData->license_type == 3) { - $this->setLangContent($this->lang, $lang . '_WHMCS_KEY_LABEL', $this->componentData->companyname . " License Key"); - $this->setLangContent($this->lang, $lang . '_WHMCS_KEY_DESC', "Add the license key you recieved from " . $this->componentData->companyname . " here."); + $this->setLangContent( + $this->lang, $lang . '_WHMCS_KEY_LABEL', + $this->componentData->companyname . " License Key" + ); + $this->setLangContent( + $this->lang, $lang . '_WHMCS_KEY_DESC', + "Add the license key you recieved from " + . $this->componentData->companyname . " here." + ); } - elseif ($this->componentData->add_license && $this->componentData->license_type == 2) + elseif ($this->componentData->add_license + && $this->componentData->license_type == 2) { - $this->setLangContent($this->lang, $lang . '_WHMCS_KEY_LABEL', $this->componentData->companyname . " Update Key"); - $this->setLangContent($this->lang, $lang . '_WHMCS_KEY_DESC', "Add the update key you recieved from " . $this->componentData->companyname . " here."); + $this->setLangContent( + $this->lang, $lang . '_WHMCS_KEY_LABEL', + $this->componentData->companyname . " Update Key" + ); + $this->setLangContent( + $this->lang, $lang . '_WHMCS_KEY_DESC', + "Add the update key you recieved from " + . $this->componentData->companyname . " here." + ); } else { - $this->setLangContent($this->lang, $lang . '_WHMCS_KEY_LABEL', $this->componentData->companyname . " Key"); - $this->setLangContent($this->lang, $lang . '_WHMCS_KEY_DESC', "Add the key you recieved from " . $this->componentData->companyname . " here."); + $this->setLangContent( + $this->lang, $lang . '_WHMCS_KEY_LABEL', + $this->componentData->companyname . " Key" + ); + $this->setLangContent( + $this->lang, $lang . '_WHMCS_KEY_DESC', + "Add the key you recieved from " + . $this->componentData->companyname . " here." + ); } // ajust the notice based on license if ($this->componentData->license_type == 3) { - $this->setLangContent($this->lang, $lang . '_WHMCS_KEY_NOTE_LABEL', "Your " . $this->componentData->companyname . " License Key"); + $this->setLangContent( + $this->lang, $lang . '_WHMCS_KEY_NOTE_LABEL', + "Your " . $this->componentData->companyname + . " License Key" + ); } elseif ($this->componentData->license_type == 2) { - $this->setLangContent($this->lang, $lang . '_WHMCS_KEY_NOTE_LABEL', "Your " . $this->componentData->companyname . " Update Key"); + $this->setLangContent( + $this->lang, $lang . '_WHMCS_KEY_NOTE_LABEL', + "Your " . $this->componentData->companyname + . " Update Key" + ); } else { if (isset($this->whmcsEncryption) && $this->whmcsEncryption) { - $this->setLangContent($this->lang, $lang . '_WHMCS_KEY_NOTE_LABEL', "Your " . $this->componentData->companyname . " Field Encryption Key"); + $this->setLangContent( + $this->lang, $lang . '_WHMCS_KEY_NOTE_LABEL', + "Your " . $this->componentData->companyname + . " Field Encryption Key" + ); } else { - $this->setLangContent($this->lang, $lang . '_WHMCS_KEY_NOTE_LABEL', "Your " . $this->componentData->companyname . " Key"); + $this->setLangContent( + $this->lang, $lang . '_WHMCS_KEY_NOTE_LABEL', + "Your " . $this->componentData->companyname . " Key" + ); } } // add the description based on global settings if (isset($this->whmcsEncryption) && $this->whmcsEncryption) { - $this->setLangContent($this->lang, $lang . '_WHMCS_KEY_NOTE_DESC', "You need to get this key from
    " . $this->componentData->companyname . ".
    When using the " . $this->componentData->companyname . " field encryption you can never change this key once it is set! DATA WILL GET CORRUPTED IF YOU DO!"); + $this->setLangContent( + $this->lang, $lang . '_WHMCS_KEY_NOTE_DESC', + "You need to get this key from " + . $this->componentData->companyname + . ".
    When using the " + . $this->componentData->companyname + . " field encryption you can never change this key once it is set! DATA WILL GET CORRUPTED IF YOU DO!" + ); } else { - $this->setLangContent($this->lang, $lang . '_WHMCS_KEY_NOTE_DESC', "You need to get this key from " . $this->componentData->companyname . "."); + $this->setLangContent( + $this->lang, $lang . '_WHMCS_KEY_NOTE_DESC', + "You need to get this key from " + . $this->componentData->companyname . "." + ); } // set the fields - $this->configFieldSets[] = $this->_t(2) . ''; - $this->configFieldSets[] = $this->_t(2) . 'configFieldSets[] = $this->_t(2) + . ''; + $this->configFieldSets[] = $this->_t(2) + . 'configFieldSets[] = $this->_t(3) . 'type="text"'; - $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang . '_WHMCS_KEY_LABEL"'; - $this->configFieldSets[] = $this->_t(3) . 'description="' . $lang . '_WHMCS_KEY_DESC"'; + $this->configFieldSets[] = $this->_t(3) . 'label="' . $lang + . '_WHMCS_KEY_LABEL"'; + $this->configFieldSets[] = $this->_t(3) . 'description="' + . $lang . '_WHMCS_KEY_DESC"'; $this->configFieldSets[] = $this->_t(3) . 'size="60"'; $this->configFieldSets[] = $this->_t(3) . 'default=""'; $this->configFieldSets[] = $this->_t(2) . "/>"; @@ -16014,9 +24647,14 @@ function vdm_dkim() { foreach ($dynamicAddFields as $dynamicAddField) { // add custom Encryption Settings fields - if (isset($this->configFieldSetsCustomField[$dynamicAddField]) && ComponentbuilderHelper::checkArray($this->configFieldSetsCustomField[$dynamicAddField])) + if (isset($this->configFieldSetsCustomField[$dynamicAddField]) + && ComponentbuilderHelper::checkArray( + $this->configFieldSetsCustomField[$dynamicAddField] + )) { - $this->configFieldSets[] = implode("", $this->configFieldSetsCustomField[$dynamicAddField]); + $this->configFieldSets[] = implode( + "", $this->configFieldSetsCustomField[$dynamicAddField] + ); unset($this->configFieldSetsCustomField[$dynamicAddField]); } } @@ -16034,15 +24672,22 @@ function vdm_dkim() { $otherViews = $this->catCodeBuilder[$viewName_single]['views']; if ($otherViews == $viewName_list) { - $component .= PHP_EOL . $this->_t(1) . '
    '; - $component .= PHP_EOL . $this->_t(2) . ''; - $component .= PHP_EOL . $this->_t(2) . ''; - $component .= PHP_EOL . $this->_t(2) . ''; - $component .= PHP_EOL . $this->_t(2) . ''; - $component .= PHP_EOL . $this->_t(2) . ''; + $component .= PHP_EOL . $this->_t(1) + . '
    '; + $component .= PHP_EOL . $this->_t(2) + . ''; + $component .= PHP_EOL . $this->_t(2) + . ''; + $component .= PHP_EOL . $this->_t(2) + . ''; + $component .= PHP_EOL . $this->_t(2) + . ''; + $component .= PHP_EOL . $this->_t(2) + . ''; $component .= PHP_EOL . $this->_t(1) . "
    "; } } + return $component; } @@ -16051,110 +24696,208 @@ function vdm_dkim() { $component = ''; // set all the core field permissions $component .= PHP_EOL . $this->_t(1) . '
    '; - $component .= PHP_EOL . $this->_t(2) . ''; - $component .= PHP_EOL . $this->_t(2) . ''; - $component .= PHP_EOL . $this->_t(2) . ''; - $component .= PHP_EOL . $this->_t(2) . ''; - $component .= PHP_EOL . $this->_t(2) . ''; - $component .= PHP_EOL . $this->_t(2) . ''; + $component .= PHP_EOL . $this->_t(2) + . ''; + $component .= PHP_EOL . $this->_t(2) + . ''; + $component .= PHP_EOL . $this->_t(2) + . ''; + $component .= PHP_EOL . $this->_t(2) + . ''; + $component .= PHP_EOL . $this->_t(2) + . ''; + $component .= PHP_EOL . $this->_t(2) + . ''; $component .= PHP_EOL . $this->_t(1) . '
    '; $component .= PHP_EOL . $this->_t(1) . '
    '; - $component .= PHP_EOL . $this->_t(2) . ''; - $component .= PHP_EOL . $this->_t(2) . ''; - $component .= PHP_EOL . $this->_t(2) . ''; - $component .= PHP_EOL . $this->_t(2) . ''; + $component .= PHP_EOL . $this->_t(2) + . ''; + $component .= PHP_EOL . $this->_t(2) + . ''; + $component .= PHP_EOL . $this->_t(2) + . ''; + $component .= PHP_EOL . $this->_t(2) + . ''; $component .= PHP_EOL . $this->_t(1) . '
    '; + return $component; } public function setAccessSections() { // set the default component access values - $this->componentHead = array(); + $this->componentHead = array(); $this->componentGlobal = array(); $this->permissionViews = array(); // Trigger Event: jcb_ce_onBeforeBuildAccessSections - $this->triggerEvent('jcb_ce_onBeforeBuildAccessSections', array(&$this->componentContext, $this)); + $this->triggerEvent( + 'jcb_ce_onBeforeBuildAccessSections', + array(&$this->componentContext, $this) + ); $this->componentHead[] = '
    '; - $this->componentHead[] = $this->_t(2) . ''; - $this->componentHead[] = $this->_t(2) . ''; - $this->componentHead[] = $this->_t(2) . ''; + $this->componentHead[] = $this->_t(2) + . ''; + $this->componentHead[] = $this->_t(2) + . ''; + $this->componentHead[] = $this->_t(2) + . ''; if ($this->addEximport) { - $exportTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Export Data', 'U'); - $exportDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Export Data', 'U') . '_DESC'; + $exportTitle = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString('Export Data', 'U'); + $exportDesc = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString('Export Data', 'U') + . '_DESC'; $this->setLangContent('bothadmin', $exportTitle, 'Export Data'); - $this->setLangContent('bothadmin', $exportDesc, ' Allows users in this group to export data.'); - $this->componentHead[] = $this->_t(2) . ''; + $this->setLangContent( + 'bothadmin', $exportDesc, + ' Allows users in this group to export data.' + ); + $this->componentHead[] = $this->_t(2) + . ''; - $importTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Import Data', 'U'); - $importDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Import Data', 'U') . '_DESC'; + $importTitle = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString('Import Data', 'U'); + $importDesc = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString('Import Data', 'U') + . '_DESC'; $this->setLangContent('bothadmin', $importTitle, 'Import Data'); - $this->setLangContent('bothadmin', $importDesc, ' Allows users in this group to import data.'); - $this->componentHead[] = $this->_t(2) . ''; + $this->setLangContent( + 'bothadmin', $importDesc, + ' Allows users in this group to import data.' + ); + $this->componentHead[] = $this->_t(2) + . ''; } // version permission - $batchTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Use Batch', 'U'); - $batchDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Use Batch', 'U') . '_DESC'; + $batchTitle = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString('Use Batch', 'U'); + $batchDesc = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString('Use Batch', 'U') . '_DESC'; $this->setLangContent('bothadmin', $batchTitle, 'Use Batch'); - $this->setLangContent('bothadmin', $batchDesc, ' Allows users in this group to use batch copy/update method.'); - $this->componentHead[] = $this->_t(2) . ''; + $this->setLangContent( + 'bothadmin', $batchDesc, + ' Allows users in this group to use batch copy/update method.' + ); + $this->componentHead[] = $this->_t(2) + . ''; // version permission - $importTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Edit Versions', 'U'); - $importDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Edit Versions', 'U') . '_DESC'; + $importTitle = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString('Edit Versions', 'U'); + $importDesc = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString('Edit Versions', 'U') + . '_DESC'; $this->setLangContent('bothadmin', $importTitle, 'Edit Version'); - $this->setLangContent('bothadmin', $importDesc, ' Allows users in this group to edit versions.'); - $this->componentHead[] = $this->_t(2) . ''; + $this->setLangContent( + 'bothadmin', $importDesc, + ' Allows users in this group to edit versions.' + ); + $this->componentHead[] = $this->_t(2) + . ''; // set the defaults - $this->componentHead[] = $this->_t(2) . ''; - $this->componentHead[] = $this->_t(2) . ''; - $this->componentHead[] = $this->_t(2) . ''; - $this->componentHead[] = $this->_t(2) . ''; - $this->componentHead[] = $this->_t(2) . ''; + $this->componentHead[] = $this->_t(2) + . ''; + $this->componentHead[] = $this->_t(2) + . ''; + $this->componentHead[] = $this->_t(2) + . ''; + $this->componentHead[] = $this->_t(2) + . ''; + $this->componentHead[] = $this->_t(2) + . ''; // set the Joomla fields if ($this->setJoomlaFields) { - $this->componentHead[] = $this->_t(2) . ' '; + $this->componentHead[] = $this->_t(2) + . ' '; } // new custom created by permissions - $created_byTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Edit Created By', 'U'); - $created_byDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Edit Created By', 'U') . '_DESC'; + $created_byTitle = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString('Edit Created By', 'U'); + $created_byDesc = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString('Edit Created By', 'U') + . '_DESC'; $this->setLangContent('bothadmin', $created_byTitle, 'Edit Created By'); - $this->setLangContent('bothadmin', $created_byDesc, ' Allows users in this group to edit created by.'); - $this->componentHead[] = $this->_t(2) . ''; + $this->setLangContent( + 'bothadmin', $created_byDesc, + ' Allows users in this group to edit created by.' + ); + $this->componentHead[] = $this->_t(2) + . ''; // new custom created date permissions - $createdTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Edit Created Date', 'U'); - $createdDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Edit Created Date', 'U') . '_DESC'; + $createdTitle = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString('Edit Created Date', 'U'); + $createdDesc = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString('Edit Created Date', 'U') + . '_DESC'; $this->setLangContent('bothadmin', $createdTitle, 'Edit Created Date'); - $this->setLangContent('bothadmin', $createdDesc, ' Allows users in this group to edit created date.'); - $this->componentHead[] = $this->_t(2) . ''; + $this->setLangContent( + 'bothadmin', $createdDesc, + ' Allows users in this group to edit created date.' + ); + $this->componentHead[] = $this->_t(2) + . ''; // set the menu controller lookup - $menuControllers = array('access', 'submenu', 'dashboard_list', 'dashboard_add'); + $menuControllers = array('access', 'submenu', 'dashboard_list', + 'dashboard_add'); // set the custom admin views permissions - if (isset($this->componentData->custom_admin_views) && ComponentbuilderHelper::checkArray($this->componentData->custom_admin_views)) + if (isset($this->componentData->custom_admin_views) + && ComponentbuilderHelper::checkArray( + $this->componentData->custom_admin_views + )) { - foreach ($this->componentData->custom_admin_views as $custom_admin_view) + foreach ( + $this->componentData->custom_admin_views as $custom_admin_view + ) { // new custom permissions to access this view - $customAdminName = $custom_admin_view['settings']->name; - $customAdminCode = $custom_admin_view['settings']->code; - $customAdminTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($customAdminName . ' Access', 'U'); - $customAdminDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($customAdminName . ' Access', 'U') . '_DESC'; - $sortKey = ComponentbuilderHelper::safeString($customAdminName . ' Access'); - $this->setLangContent('bothadmin', $customAdminTitle, $customAdminName . ' Access'); - $this->setLangContent('bothadmin', $customAdminDesc, ' Allows the users in this group to access ' . ComponentbuilderHelper::safeString($customAdminName, 'w') . '.'); - $this->componentGlobal[$sortKey] = $this->_t(2) . ''; + $customAdminName = $custom_admin_view['settings']->name; + $customAdminCode = $custom_admin_view['settings']->code; + $customAdminTitle = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString( + $customAdminName . ' Access', 'U' + ); + $customAdminDesc = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString( + $customAdminName . ' Access', 'U' + ) . '_DESC'; + $sortKey = ComponentbuilderHelper::safeString( + $customAdminName . ' Access' + ); + $this->setLangContent( + 'bothadmin', $customAdminTitle, $customAdminName . ' Access' + ); + $this->setLangContent( + 'bothadmin', $customAdminDesc, + ' Allows the users in this group to access ' + . ComponentbuilderHelper::safeString($customAdminName, 'w') + . '.' + ); + $this->componentGlobal[$sortKey] = $this->_t(2) + . ''; // add the custom permissions to use the buttons of this view - $this->addCustomButtonPermissions($custom_admin_view['settings'], $customAdminName, $customAdminCode); + $this->addCustomButtonPermissions( + $custom_admin_view['settings'], $customAdminName, + $customAdminCode + ); // add menu controll view that has menus options foreach ($menuControllers as $menuController) { // add menu controll view that has menus options - if (isset($custom_admin_view[$menuController]) && $custom_admin_view[$menuController]) + if (isset($custom_admin_view[$menuController]) + && $custom_admin_view[$menuController]) { $targetView_ = 'views.'; if ($menuController === 'dashboard_add') @@ -16162,78 +24905,134 @@ function vdm_dkim() { $targetView_ = 'view.'; } // menucontroller - $menucontrollerView['action'] = $targetView_ . $menuController; + $menucontrollerView['action'] = $targetView_ + . $menuController; $menucontrollerView['implementation'] = '2'; - if (isset($custom_admin_view['settings']->permissions) && ComponentbuilderHelper::checkArray($custom_admin_view['settings']->permissions)) + if (isset($custom_admin_view['settings']->permissions) + && ComponentbuilderHelper::checkArray( + $custom_admin_view['settings']->permissions + )) { - array_push($custom_admin_view['settings']->permissions, $menucontrollerView); + array_push( + $custom_admin_view['settings']->permissions, + $menucontrollerView + ); } else { - $custom_admin_view['settings']->permissions = array(); - $custom_admin_view['settings']->permissions[] = $menucontrollerView; + $custom_admin_view['settings']->permissions + = array(); + $custom_admin_view['settings']->permissions[] + = $menucontrollerView; } unset($menucontrollerView); } } - $this->buildPermissions($custom_admin_view, $customAdminCode, $customAdminCode, $menuControllers, 'customAdmin'); + $this->buildPermissions( + $custom_admin_view, $customAdminCode, $customAdminCode, + $menuControllers, 'customAdmin' + ); } } // set the site views permissions - if (isset($this->componentData->site_views) && ComponentbuilderHelper::checkArray($this->componentData->site_views)) + if (isset($this->componentData->site_views) + && ComponentbuilderHelper::checkArray( + $this->componentData->site_views + )) { foreach ($this->componentData->site_views as $site_view) { // new custom permissions to access this view - $siteName = $site_view['settings']->name; - $siteCode = $site_view['settings']->code; - $siteTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($siteName . ' Access Site', 'U'); - $siteDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($siteName . ' Access Site', 'U') . '_DESC'; - $sortKey = ComponentbuilderHelper::safeString($siteName . ' Access Site'); + $siteName = $site_view['settings']->name; + $siteCode = $site_view['settings']->code; + $siteTitle = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString( + $siteName . ' Access Site', 'U' + ); + $siteDesc = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString( + $siteName . ' Access Site', 'U' + ) . '_DESC'; + $sortKey = ComponentbuilderHelper::safeString( + $siteName . ' Access Site' + ); if (isset($site_view['access']) && $site_view['access'] == 1) { - $this->setLangContent('bothadmin', $siteTitle, $siteName . ' (Site) Access'); - $this->setLangContent('bothadmin', $siteDesc, ' Allows the users in this group to access site ' . ComponentbuilderHelper::safeString($siteName, 'w') . '.'); - $this->componentGlobal[$sortKey] = $this->_t(2) . ''; + $this->setLangContent( + 'bothadmin', $siteTitle, $siteName . ' (Site) Access' + ); + $this->setLangContent( + 'bothadmin', $siteDesc, + ' Allows the users in this group to access site ' + . ComponentbuilderHelper::safeString($siteName, 'w') + . '.' + ); + $this->componentGlobal[$sortKey] = $this->_t(2) + . ''; // check if this site view requires access rule to default to public - if (isset($site_view['public_access']) && $site_view['public_access'] == 1) + if (isset($site_view['public_access']) + && $site_view['public_access'] == 1) { // we use one as public group (TODO we see if we run into any issues) - $this->assetsRules[] = '"site.' . $siteCode . '.access":{"1":1}'; + $this->assetsRules[] = '"site.' . $siteCode + . '.access":{"1":1}'; } } // add the custom permissions to use the buttons of this view - $this->addCustomButtonPermissions($site_view['settings'], $siteName, $siteCode); + $this->addCustomButtonPermissions( + $site_view['settings'], $siteName, $siteCode + ); } } - if (isset($this->componentData->admin_views) && ComponentbuilderHelper::checkArray($this->componentData->admin_views)) + if (isset($this->componentData->admin_views) + && ComponentbuilderHelper::checkArray( + $this->componentData->admin_views + )) { foreach ($this->componentData->admin_views as $view) { // set view name - $nameView = ComponentbuilderHelper::safeString($view['settings']->name_single); - $nameViews = ComponentbuilderHelper::safeString($view['settings']->name_list); + $nameView = ComponentbuilderHelper::safeString( + $view['settings']->name_single + ); + $nameViews = ComponentbuilderHelper::safeString( + $view['settings']->name_list + ); // add custom tab permissions if found - if (isset($this->customTabs[$nameView]) && ComponentbuilderHelper::checkArray($this->customTabs[$nameView])) + if (isset($this->customTabs[$nameView]) + && ComponentbuilderHelper::checkArray( + $this->customTabs[$nameView] + )) { foreach ($this->customTabs[$nameView] as $_customTab) { - if (isset($_customTab['permission']) && $_customTab['permission'] == 1) + if (isset($_customTab['permission']) + && $_customTab['permission'] == 1) { - $this->componentGlobal[$_customTab['sortKey']] = $this->_t(2) . ''; + $this->componentGlobal[$_customTab['sortKey']] + = $this->_t(2) . ''; } } } // add the custom permissions to use the buttons of this view - $this->addCustomButtonPermissions($view['settings'], $view['settings']->name_single, $nameView); + $this->addCustomButtonPermissions( + $view['settings'], $view['settings']->name_single, $nameView + ); if ($nameView != 'component') { // add menu controll view that has menus options foreach ($menuControllers as $menuController) { // add menu controll view that has menus options - if (isset($view[$menuController]) && $view[$menuController]) + if (isset($view[$menuController]) + && $view[$menuController]) { $targetView_ = 'views.'; if ($menuController === 'dashboard_add') @@ -16241,88 +25040,136 @@ function vdm_dkim() { $targetView_ = 'view.'; } // menucontroller - $menucontrollerView['action'] = $targetView_ . $menuController; + $menucontrollerView['action'] = $targetView_ + . $menuController; $menucontrollerView['implementation'] = '2'; - if (isset($view['settings']->permissions) && ComponentbuilderHelper::checkArray($view['settings']->permissions)) + if (isset($view['settings']->permissions) + && ComponentbuilderHelper::checkArray( + $view['settings']->permissions + )) { - array_push($view['settings']->permissions, $menucontrollerView); + array_push( + $view['settings']->permissions, + $menucontrollerView + ); } else { $view['settings']->permissions = array(); - $view['settings']->permissions[] = $menucontrollerView; + $view['settings']->permissions[] + = $menucontrollerView; } unset($menucontrollerView); } } // check if there are fields - if (ComponentbuilderHelper::checkArray($view['settings']->fields)) + if (ComponentbuilderHelper::checkArray( + $view['settings']->fields + )) { // field permission options - $permission_options = array(1 => 'edit', 2 => 'access', 3 => 'view'); + $permission_options = array(1 => 'edit', 2 => 'access', + 3 => 'view'); // check the fields for their permission settings foreach ($view['settings']->fields as $field) { // see if field require permissions to be set - if (isset($field['permission']) && ComponentbuilderHelper::checkArray($field['permission'])) + if (isset($field['permission']) + && ComponentbuilderHelper::checkArray( + $field['permission'] + )) { - if (ComponentbuilderHelper::checkArray($field['settings']->properties)) + if (ComponentbuilderHelper::checkArray( + $field['settings']->properties + )) { $fieldType = $this->getFieldType($field); - $fieldName = $this->getFieldName($field, $nameViews); + $fieldName = $this->getFieldName( + $field, $nameViews + ); // loop the permission options - foreach ($field['permission'] as $permission_id) + foreach ( + $field['permission'] as $permission_id + ) { // set the permission key word - $permission_option = $permission_options[ (int) $permission_id]; + $permission_option + = $permission_options[(int) $permission_id]; // reset the bucket $fieldView = array(); // set the permission for this field - $fieldView['action'] = 'view.' . $permission_option . '.' . $fieldName; + $fieldView['action'] = 'view.' + . $permission_option . '.' + . $fieldName; $fieldView['implementation'] = '3'; // check if persmissions was already set - if (isset($view['settings']->permissions) && ComponentbuilderHelper::checkArray($view['settings']->permissions)) + if (isset($view['settings']->permissions) + && ComponentbuilderHelper::checkArray( + $view['settings']->permissions + )) { - array_push($view['settings']->permissions, $fieldView); + array_push( + $view['settings']->permissions, + $fieldView + ); } else { - $view['settings']->permissions = array(); - $view['settings']->permissions[] = $fieldView; + $view['settings']->permissions + = array(); + $view['settings']->permissions[] + = $fieldView; } // insure that no default field get loaded - if (!in_array($fieldName, $this->defaultFields)) + if (!in_array( + $fieldName, $this->defaultFields + )) { // make sure the array is set - if (!isset($this->permissionFields[$nameView]) || !ComponentbuilderHelper::checkArray($this->permissionFields[$nameView])) + if (!isset($this->permissionFields[$nameView]) + || !ComponentbuilderHelper::checkArray( + $this->permissionFields[$nameView] + )) { - $this->permissionFields[$nameView] = array(); + $this->permissionFields[$nameView] + = array(); } - if (!isset($this->permissionFields[$nameView][$fieldName]) || !ComponentbuilderHelper::checkArray($this->permissionFields[$nameView][$fieldName])) + if (!isset($this->permissionFields[$nameView][$fieldName]) + || !ComponentbuilderHelper::checkArray( + $this->permissionFields[$nameView][$fieldName] + )) { - $this->permissionFields[$nameView][$fieldName] = array(); + $this->permissionFields[$nameView][$fieldName] + = array(); } // load to global field permission set - $this->permissionFields[$nameView][$fieldName][$permission_option] = $fieldType; + $this->permissionFields[$nameView][$fieldName][$permission_option] + = $fieldType; } } } } } } - $this->buildPermissions($view, $nameView, $nameViews, $menuControllers); + $this->buildPermissions( + $view, $nameView, $nameViews, $menuControllers + ); } } // Trigger Event: jcb_ce_onAfterBuildAccessSections - $this->triggerEvent('jcb_ce_onAfterBuildAccessSections', array(&$this->componentContext, $this)); + $this->triggerEvent( + 'jcb_ce_onAfterBuildAccessSections', + array(&$this->componentContext, $this) + ); // set the views permissions now if (ComponentbuilderHelper::checkArray($this->permissionViews)) { foreach ($this->permissionViews as $viewName => $actions) { - $componentViews[] = $this->_t(1) . '
    '; + $componentViews[] = $this->_t(1) . '
    '; foreach ($actions as $action) { $componentViews[] = $this->_t(2) . $action; @@ -16335,67 +25182,104 @@ function vdm_dkim() { // sort the array to insure easy search ksort($this->componentGlobal, SORT_STRING); // add global to the compnent section - $component .= PHP_EOL . implode(PHP_EOL, $this->componentGlobal) . PHP_EOL . $this->_t(1) . "
    "; + $component .= PHP_EOL . implode(PHP_EOL, $this->componentGlobal) + . PHP_EOL . $this->_t(1) . "
    "; // add views to the compnent section $component .= PHP_EOL . implode(PHP_EOL, $componentViews); // be sure to reset again. (memory) - $this->componentHead = null; + $this->componentHead = null; $this->componentGlobal = null; $this->permissionViews = null; + // return the build return $component; } + return false; } protected function addCustomButtonPermissions($settings, $nameView, $code) { // add the custom permissions to use the buttons of this view - if (isset($settings->custom_buttons) && ComponentbuilderHelper::checkArray($settings->custom_buttons)) + if (isset($settings->custom_buttons) + && ComponentbuilderHelper::checkArray($settings->custom_buttons)) { foreach ($settings->custom_buttons as $custom_buttons) { - $customButtonName = $custom_buttons['name']; - $customButtonCode = ComponentbuilderHelper::safeString($customButtonName); - $customButtonTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($nameView . ' ' . $customButtonName . ' Button Access', 'U'); - $customButtonDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($nameView . ' ' . $customButtonName . ' Button Access', 'U') . '_DESC'; - $sortButtonKey = ComponentbuilderHelper::safeString($nameView . ' ' . $customButtonName . ' Button Access'); - $this->setLangContent('bothadmin', $customButtonTitle, $nameView . ' ' . $customButtonName . ' Button Access'); - $this->setLangContent('bothadmin', $customButtonDesc, ' Allows the users in this group to access the ' . ComponentbuilderHelper::safeString($customButtonName, 'w') . ' button.'); - $this->componentGlobal[$sortButtonKey] = $this->_t(2) . ''; + $customButtonName = $custom_buttons['name']; + $customButtonCode = ComponentbuilderHelper::safeString( + $customButtonName + ); + $customButtonTitle = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString( + $nameView . ' ' . $customButtonName . ' Button Access', + 'U' + ); + $customButtonDesc = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString( + $nameView . ' ' . $customButtonName . ' Button Access', + 'U' + ) . '_DESC'; + $sortButtonKey = ComponentbuilderHelper::safeString( + $nameView . ' ' . $customButtonName . ' Button Access' + ); + $this->setLangContent( + 'bothadmin', $customButtonTitle, + $nameView . ' ' . $customButtonName . ' Button Access' + ); + $this->setLangContent( + 'bothadmin', $customButtonDesc, + ' Allows the users in this group to access the ' + . ComponentbuilderHelper::safeString($customButtonName, 'w') + . ' button.' + ); + $this->componentGlobal[$sortButtonKey] = $this->_t(2) + . ''; } } } - public function buildPermissions(&$view, $nameView, $nameViews, $menuControllers, $type = 'admin') - { - if (isset($view['settings']->permissions) && ComponentbuilderHelper::checkArray($view['settings']->permissions) || (isset($view['port']) && $view['port']) || (isset($view['history']) && $view['history'])) + public function buildPermissions(&$view, $nameView, $nameViews, + $menuControllers, $type = 'admin' + ) { + if (isset($view['settings']->permissions) + && ComponentbuilderHelper::checkArray( + $view['settings']->permissions + ) + || (isset($view['port']) && $view['port']) + || (isset($view['history']) && $view['history'])) { // add export/import permissions to each view that has export/import options if (isset($view['port']) && $view['port']) { // export - $exportView['action'] = 'view.export'; + $exportView['action'] = 'view.export'; $exportView['implementation'] = '2'; - if (ComponentbuilderHelper::checkArray($view['settings']->permissions)) + if (ComponentbuilderHelper::checkArray( + $view['settings']->permissions + )) { array_push($view['settings']->permissions, $exportView); } else { - $view['settings']->permissions = array(); + $view['settings']->permissions = array(); $view['settings']->permissions[] = $exportView; } // import - $importView['action'] = 'view.import'; + $importView['action'] = 'view.import'; $importView['implementation'] = '2'; - if (ComponentbuilderHelper::checkArray($view['settings']->permissions)) + if (ComponentbuilderHelper::checkArray( + $view['settings']->permissions + )) { array_push($view['settings']->permissions, $importView); } else { - $view['settings']->permissions = array(); + $view['settings']->permissions = array(); $view['settings']->permissions[] = $importView; } } @@ -16403,15 +25287,17 @@ function vdm_dkim() { if (isset($view['history']) && $view['history']) { // set version control - $versionView['action'] = 'view.version'; + $versionView['action'] = 'view.version'; $versionView['implementation'] = '3'; - if (ComponentbuilderHelper::checkArray($view['settings']->permissions)) + if (ComponentbuilderHelper::checkArray( + $view['settings']->permissions + )) { array_push($view['settings']->permissions, $versionView); } else { - $view['settings']->permissions = array(); + $view['settings']->permissions = array(); $view['settings']->permissions[] = $versionView; } } @@ -16419,15 +25305,17 @@ function vdm_dkim() { if ($type === 'admin') { // set batch control - $batchView['action'] = 'view.batch'; + $batchView['action'] = 'view.batch'; $batchView['implementation'] = '2'; - if (ComponentbuilderHelper::checkArray($view['settings']->permissions)) + if (ComponentbuilderHelper::checkArray( + $view['settings']->permissions + )) { array_push($view['settings']->permissions, $batchView); } else { - $view['settings']->permissions = array(); + $view['settings']->permissions = array(); $view['settings']->permissions[] = $batchView; } } @@ -16440,7 +25328,7 @@ function vdm_dkim() { { array_shift($arr); $actionMain = implode('.', $arr); - $action = $nameView . '.' . $actionMain; + $action = $nameView . '.' . $actionMain; } else { @@ -16455,27 +25343,39 @@ function vdm_dkim() { $actionNameBuilder = explode('.', trim($permission['action'])); array_shift($actionNameBuilder); $nameBuilder = trim(implode('___', $actionNameBuilder)); - $customName = trim(implode(' ', $actionNameBuilder)); + $customName = trim(implode(' ', $actionNameBuilder)); // check if we have access set for this view (if not skip) - if ($nameBuilder === 'edit___access' && $type === 'admin' && (!isset($view['access']) || $view['access'] != 1)) + if ($nameBuilder === 'edit___access' && $type === 'admin' + && (!isset($view['access']) || $view['access'] != 1)) { continue; } // build the names if ($type === 'admin') { - $W_NameList = ComponentbuilderHelper::safeString($view['settings']->name_list, 'W'); - $w_NameList = ComponentbuilderHelper::safeString($customName . ' ' . $view['settings']->name_list, 'w'); - $w_NameSingle = ComponentbuilderHelper::safeString($view['settings']->name_single, 'w'); + $W_NameList = ComponentbuilderHelper::safeString( + $view['settings']->name_list, 'W' + ); + $w_NameList = ComponentbuilderHelper::safeString( + $customName . ' ' . $view['settings']->name_list, 'w' + ); + $w_NameSingle = ComponentbuilderHelper::safeString( + $view['settings']->name_single, 'w' + ); } elseif ($type === 'customAdmin') { - $W_NameList = ComponentbuilderHelper::safeString($view['settings']->name, 'W'); - $w_NameList = $view['settings']->name; + $W_NameList = ComponentbuilderHelper::safeString( + $view['settings']->name, 'W' + ); + $w_NameList = $view['settings']->name; $w_NameSingle = $view['settings']->name; } // set title (only if not set already) - if (!isset($permission['title']) || !ComponentbuilderHelper::checkString($permission['title'])) + if (!isset($permission['title']) + || !ComponentbuilderHelper::checkString( + $permission['title'] + )) { // set the title based on the name builder switch ($nameBuilder) @@ -16498,11 +25398,13 @@ function vdm_dkim() { break; case 'edit___created_by': // set edit title - $permission['title'] = $W_NameList . ' Edit Created By'; + $permission['title'] = $W_NameList + . ' Edit Created By'; break; case 'edit___created': // set edit title - $permission['title'] = $W_NameList . ' Edit Created Date'; + $permission['title'] = $W_NameList + . ' Edit Created Date'; break; case 'create': // set edit title @@ -16526,7 +25428,8 @@ function vdm_dkim() { break; case 'version': // set edit title - $permission['title'] = $W_NameList . ' Edit Version'; + $permission['title'] = $W_NameList + . ' Edit Version'; break; case 'batch': // set edit title @@ -16534,106 +25437,159 @@ function vdm_dkim() { break; default: // set edit title - $permission['title'] = $W_NameList . ' ' . ComponentbuilderHelper::safeString($customName, 'W'); + $permission['title'] = $W_NameList . ' ' + . ComponentbuilderHelper::safeString( + $customName, 'W' + ); break; } } // set description (only if not set already) - if (!isset($permission['description']) || !ComponentbuilderHelper::checkString($permission['description'])) + if (!isset($permission['description']) + || !ComponentbuilderHelper::checkString( + $permission['description'] + )) { // set the title based on the name builder switch ($nameBuilder) { case 'edit': // set edit description - $permission['description'] = ' Allows the users in this group to edit the ' . $w_NameSingle; + $permission['description'] + = ' Allows the users in this group to edit the ' + . $w_NameSingle; break; case 'edit___own': // set edit description - $permission['description'] = ' Allows the users in this group to edit ' . $w_NameList . ' created by them'; + $permission['description'] + = ' Allows the users in this group to edit ' + . $w_NameList . ' created by them'; break; case 'edit___access': // set edit description - $permission['description'] = ' Allows the users in this group to change the access of the ' . $w_NameList; + $permission['description'] + = ' Allows the users in this group to change the access of the ' + . $w_NameList; break; case 'edit___state': // set edit description - $permission['description'] = ' Allows the users in this group to update the state of the ' . $w_NameSingle; + $permission['description'] + = ' Allows the users in this group to update the state of the ' + . $w_NameSingle; break; case 'edit___created_by': // set edit description - $permission['description'] = ' Allows the users in this group to update the created by of the ' . $w_NameList; + $permission['description'] + = ' Allows the users in this group to update the created by of the ' + . $w_NameList; break; case 'edit___created': // set edit description - $permission['description'] = ' Allows the users in this group to update the created date of the ' . $w_NameList; + $permission['description'] + = ' Allows the users in this group to update the created date of the ' + . $w_NameList; break; case 'create': // set edit description - $permission['description'] = ' Allows the users in this group to create ' . $w_NameList; + $permission['description'] + = ' Allows the users in this group to create ' + . $w_NameList; break; case 'delete': // set edit description - $permission['description'] = ' Allows the users in this group to delete ' . $w_NameList; + $permission['description'] + = ' Allows the users in this group to delete ' + . $w_NameList; break; case 'access': // set edit description - $permission['description'] = ' Allows the users in this group to access ' . $w_NameList; + $permission['description'] + = ' Allows the users in this group to access ' + . $w_NameList; break; case 'export': // set edit description - $permission['description'] = ' Allows the users in this group to export ' . $w_NameList; + $permission['description'] + = ' Allows the users in this group to export ' + . $w_NameList; break; case 'import': // set edit description - $permission['description'] = ' Allows the users in this group to import ' . $w_NameList; + $permission['description'] + = ' Allows the users in this group to import ' + . $w_NameList; break; case 'version': // set edit description - $permission['description'] = ' Allows users in this group to edit versions of ' . $w_NameList; + $permission['description'] + = ' Allows users in this group to edit versions of ' + . $w_NameList; break; case 'batch': // set edit description - $permission['description'] = ' Allows users in this group to use batch copy/update method of ' . $w_NameList; + $permission['description'] + = ' Allows users in this group to use batch copy/update method of ' + . $w_NameList; break; default: // set edit description - $permission['description'] = ' Allows the users in this group to ' . ComponentbuilderHelper::safeString($customName, 'w') . ' of ' . $w_NameSingle; + $permission['description'] + = ' Allows the users in this group to ' + . ComponentbuilderHelper::safeString( + $customName, 'w' + ) . ' of ' . $w_NameSingle; break; } } // if core is not used update all core strings - $coreCheck = explode('.', $action); - $coreCheck[0] = 'core'; - $coreTarget = implode('.', $coreCheck); + $coreCheck = explode( + '.', $action + ); + $coreCheck[0] = 'core'; + $coreTarget = implode( + '.', $coreCheck + ); $this->permissionCore[$nameView][$coreTarget] = $action; // set array sort name - $sortKey = ComponentbuilderHelper::safeString($permission['title']); + $sortKey = ComponentbuilderHelper::safeString( + $permission['title'] + ); // set title - $title = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($permission['title'], 'U'); + $title = $this->langPrefix . '_' + . ComponentbuilderHelper::safeString( + $permission['title'], 'U' + ); // load the actions if ($permission['implementation'] == 1) { // only related to view - $this->permissionViews[$nameView][] = ''; + $this->permissionViews[$nameView][] = ''; // load permission to action $this->permissionBuilder[$action][$nameView] = $nameView; } elseif ($permission['implementation'] == 2) { // relation to whole component - $this->componentGlobal[$sortKey] = $this->_t(2) . ''; + $this->componentGlobal[$sortKey] = $this->_t(2) + . ''; // build permission switch - $this->permissionBuilder['global'][$action][$nameView] = $nameView; + $this->permissionBuilder['global'][$action][$nameView] + = $nameView; // dashboard icon checker if ($coreTarget === 'core.access') { - $this->permissionDashboard[] = "'" . $nameViews . ".access' => '" . $action . "'"; - $this->permissionDashboard[] = "'" . $nameView . ".access' => '" . $action . "'"; + $this->permissionDashboard[] = "'" . $nameViews + . ".access' => '" . $action . "'"; + $this->permissionDashboard[] = "'" . $nameView + . ".access' => '" . $action . "'"; } if ($coreTarget === 'core.create') { - $this->permissionDashboard[] = "'" . $nameView . ".create' => '" . $action . "'"; + $this->permissionDashboard[] = "'" . $nameView + . ".create' => '" . $action . "'"; } // add menu controll view that has menus options foreach ($menuControllers as $menuController) @@ -16642,11 +25598,15 @@ function vdm_dkim() { { if ($menuController === 'dashboard_add') { - $this->permissionDashboard[] = "'" . $nameView . "." . $menuController . "' => '" . $action . "'"; + $this->permissionDashboard[] = "'" . $nameView + . "." . $menuController . "' => '" . $action + . "'"; } else { - $this->permissionDashboard[] = "'" . $nameViews . "." . $menuController . "' => '" . $action . "'"; + $this->permissionDashboard[] = "'" . $nameViews + . "." . $menuController . "' => '" . $action + . "'"; } } } @@ -16654,22 +25614,30 @@ function vdm_dkim() { elseif ($permission['implementation'] == 3) { // only related to view - $this->permissionViews[$nameView][] = ''; + $this->permissionViews[$nameView][] = ''; // load permission to action $this->permissionBuilder[$action][$nameView] = $nameView; // relation to whole component - $this->componentGlobal[$sortKey] = $this->_t(2) . ''; + $this->componentGlobal[$sortKey] = $this->_t(2) + . ''; // build permission switch - $this->permissionBuilder['global'][$action][$nameView] = $nameView; + $this->permissionBuilder['global'][$action][$nameView] + = $nameView; // dashboard icon checker if ($coreTarget === 'core.access') { - $this->permissionDashboard[] = "'" . $nameViews . ".access' => '" . $action . "'"; - $this->permissionDashboard[] = "'" . $nameView . ".access' => '" . $action . "'"; + $this->permissionDashboard[] = "'" . $nameViews + . ".access' => '" . $action . "'"; + $this->permissionDashboard[] = "'" . $nameView + . ".access' => '" . $action . "'"; } if ($coreTarget === 'core.create') { - $this->permissionDashboard[] = "'" . $nameView . ".create' => '" . $action . "'"; + $this->permissionDashboard[] = "'" . $nameView + . ".create' => '" . $action . "'"; } // add menu controll view that has menus options foreach ($menuControllers as $menuController) @@ -16678,58 +25646,82 @@ function vdm_dkim() { { if ($menuController === 'dashboard_add') { - $this->permissionDashboard[] = "'" . $nameView . "." . $menuController . "' => '" . $action . "'"; + $this->permissionDashboard[] = "'" . $nameView + . "." . $menuController . "' => '" . $action + . "'"; } else { - $this->permissionDashboard[] = "'" . $nameViews . "." . $menuController . "' => '" . $action . "'"; + $this->permissionDashboard[] = "'" . $nameViews + . "." . $menuController . "' => '" . $action + . "'"; } } } } // set to language file - $this->setLangContent('bothadmin', $title, $permission['title']); - $this->setLangContent('bothadmin', $title . '_DESC', $permission['description']); + $this->setLangContent( + 'bothadmin', $title, $permission['title'] + ); + $this->setLangContent( + 'bothadmin', $title . '_DESC', $permission['description'] + ); } } } - public function getInbetweenStrings($str, $start = '#' . '#' . '#', $end = '#' . '#' . '#') - { + public function getInbetweenStrings($str, $start = '#' . '#' . '#', + $end = '#' . '#' . '#' + ) { $matches = array(); - $regex = "/$start([a-zA-Z0-9_]*)$end/"; + $regex = "/$start([a-zA-Z0-9_]*)$end/"; preg_match_all($regex, $str, $matches); + return $matches[1]; } public function getModCode(&$module) { // get component helper string - $Helper = $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper'; - $component = $this->fileContentStatic[$this->hhh . 'component' . $this->hhh]; - $_helper = ''; + $Helper = $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] . 'Helper'; + $component = $this->fileContentStatic[$this->hhh . 'component' + . $this->hhh]; + $_helper = ''; // get libraries code - $libraries = array($this->bbb . 'MOD_LIBRARIES' . $this->ddd => $this->getModLibCode($module)); - $code = $this->setPlaceholders($module->mod_code, $libraries); + $libraries = array($this->bbb . 'MOD_LIBRARIES' + . $this->ddd => $this->getModLibCode($module)); + $code = $this->setPlaceholders($module->mod_code, $libraries); // check if component helper class should be added - if (strpos($code, $Helper . '::') !== false && strpos($code, "/components/com_" . $component . "/helpers/" . $component . ".php") === false) + if (strpos($code, $Helper . '::') !== false + && strpos( + $code, + "/components/com_" . $component . "/helpers/" . $component + . ".php" + ) === false) { - $_helper = '//' . $this->setLine(__LINE__) . ' Include the component helper functions only once'; - $_helper .= PHP_EOL . "JLoader::register('". $Helper . "', JPATH_ADMINISTRATOR . '/components/com_" . $component . "/helpers/" . $component . ".php');"; + $_helper = '//' . $this->setLine(__LINE__) + . ' Include the component helper functions only once'; + $_helper .= PHP_EOL . "JLoader::register('" . $Helper + . "', JPATH_ADMINISTRATOR . '/components/com_" . $component + . "/helpers/" . $component . ".php');"; } + return $_helper . PHP_EOL . $code . PHP_EOL; } public function getModDefault(&$module) { - return PHP_EOL . $module->default_header . PHP_EOL . '?>' . PHP_EOL . $module->default . PHP_EOL; + return PHP_EOL . $module->default_header . PHP_EOL . '?>' . PHP_EOL + . $module->default . PHP_EOL; } public function getModHelperCode(&$module) { return $module->class_helper_header . PHP_EOL . - $module->class_helper_type . $module->class_helper_name . PHP_EOL . '{' . PHP_EOL . + $module->class_helper_type . $module->class_helper_name . PHP_EOL + . '{' . PHP_EOL . $module->class_helper_code . PHP_EOL . "}" . PHP_EOL; } @@ -16737,17 +25729,35 @@ function vdm_dkim() { public function getModLibCode(&$module) { $setter = ''; - if (isset($this->libManager[$module->key][$module->code_name]) && ComponentbuilderHelper::checkArray($this->libManager[$module->key][$module->code_name])) + if (isset($this->libManager[$module->key][$module->code_name]) + && ComponentbuilderHelper::checkArray( + $this->libManager[$module->key][$module->code_name] + )) { - $setter .= '//' . $this->setLine(__LINE__) . 'get the document object'; + $setter .= '//' . $this->setLine(__LINE__) + . 'get the document object'; $setter .= PHP_EOL . '$document = JFactory::getDocument();'; - foreach ($this->libManager[$module->key][$module->code_name] as $id => $true) + foreach ( + $this->libManager[$module->key][$module->code_name] as $id => + $true + ) { - if (isset($this->libraries[$id]) && ComponentbuilderHelper::checkObject($this->libraries[$id]) && isset($this->libraries[$id]->document) && ComponentbuilderHelper::checkString($this->libraries[$id]->document)) + if (isset($this->libraries[$id]) + && ComponentbuilderHelper::checkObject( + $this->libraries[$id] + ) + && isset($this->libraries[$id]->document) + && ComponentbuilderHelper::checkString( + $this->libraries[$id]->document + )) { $setter .= PHP_EOL . $this->libraries[$id]->document; } - elseif (isset($this->libraries[$id]) && ComponentbuilderHelper::checkObject($this->libraries[$id]) && isset($this->libraries[$id]->how)) + elseif (isset($this->libraries[$id]) + && ComponentbuilderHelper::checkObject( + $this->libraries[$id] + ) + && isset($this->libraries[$id]->how)) { $setter .= $this->setLibraryDocument($id); } @@ -16757,15 +25767,20 @@ function vdm_dkim() { if (ComponentbuilderHelper::checkString($setter)) { return $this->setPlaceholders( - str_replace('$this->document->', '$document->', - implode(PHP_EOL, - array_map(trim, + str_replace( + '$this->document->', '$document->', + implode( + PHP_EOL, + array_map( + trim, (array) explode(PHP_EOL, $setter) ) ) ), - $this->placeholders); + $this->placeholders + ); } + return ''; } @@ -16779,89 +25794,193 @@ function vdm_dkim() { $add_component_path = false; // build the config fields $config_fields = array(); - if (isset($module->config_fields) && ComponentbuilderHelper::checkArray($module->config_fields)) + if (isset($module->config_fields) + && ComponentbuilderHelper::checkArray( + $module->config_fields + )) { foreach ($module->config_fields as $field_name => $fieldsets) { foreach ($fieldsets as $fieldset => $fields) { // get the field set - $xmlFields = $this->getExtensionFieldsetXML($module, $fields, $dbkey); + $xmlFields = $this->getExtensionFieldsetXML( + $module, $fields, $dbkey + ); // make sure the xml is set and a string - if (isset($xmlFields) && ComponentbuilderHelper::checkString($xmlFields)) + if (isset($xmlFields) + && ComponentbuilderHelper::checkString($xmlFields)) { $config_fields[$field_name . $fieldset] = $xmlFields; } $dbkey++; // check if the fieldset path requiers component paths - if (!$add_component_path && isset($module->fieldsets_paths[$field_name . $fieldset]) && $module->fieldsets_paths[$field_name . $fieldset] == 1) + if (!$add_component_path + && isset( + $module->fieldsets_paths[$field_name . $fieldset] + ) + && $module->fieldsets_paths[$field_name . $fieldset] + == 1) { $add_component_path = true; } } } } - // switch to add the xml - $addLang = false; + // switch to add the language xml + $addLang = array(); // now build the language files if (isset($this->langContent[$module->key])) { - $lang = array_map(function ($langstring, $placeholder){ - return $placeholder . '="' . $langstring . '"'; - }, $this->langContent[$module->key], array_keys($this->langContent[$module->key])); - // add to language file - $this->writeFile($module->folder_path . '/language/' . $this->langTag . '/' . $this->langTag . '.' . $module->file_name . '.ini', implode(PHP_EOL, $lang)); - $this->writeFile($module->folder_path . '/language/' . $this->langTag . '/' . $this->langTag . '.' . $module->file_name . '.sys.ini', implode(PHP_EOL, $lang)); - // set the line counter - $this->lineCount = $this->lineCount + count((array) $lang); - unset($lang); - // trigger the xml - $addLang = true; + // Trigger Event: jcb_ce_onBeforeBuildModuleLang + $this->triggerEvent( + 'jcb_ce_onBeforeBuildModuleLang', + array(&$module->context, &$this->langContent[$module->key], + &$module->lang_prefix, &$module->official_name) + ); + // get other languages + $values = array_unique($this->langContent[$module->key]); + // get the other lang strings if there is any + $this->multiLangString = $this->getMultiLangStrings($values); + // start the modules language bucket + $this->languages['modules'][$this->langTag]['all'] + = $this->langContent[$module->key]; + unset($this->langContent[$module->key]); + // update insert the current lang in to DB + $this->setLangPlaceholders($values, $module->id, 'modules'); + // remove old unused language strings + $this->purgeLanuageStrings($values, $module->id, 'modules'); + $total = count($values); + unset($values); + // Trigger Event: jcb_ce_onBeforeBuildModuleLangFiles + $this->triggerEvent( + 'jcb_ce_onBeforeBuildModuleLangFiles', + array(&$module->context, &$this->languages['modules'], + &$this->langTag) + ); + // now we insert the values into the files + if (ComponentbuilderHelper::checkArray($this->languages['modules'])) + { + foreach ($this->languages['modules'] as $tag => $areas) + { + // trim the tag + $tag = trim($tag); + foreach ($areas as $area => $languageStrings) + { + // check if language should be added + if (!$this->shouldLanguageBeAdded( + $tag, $languageStrings, $total + )) + { + continue; + } + $lang = array_map( + function ($langstring, $placeholder) { + return $placeholder . '="' . $langstring . '"'; + }, array_values($languageStrings), + array_keys($languageStrings) + ); + // set path + $path = $module->folder_path . '/language/' . $tag; + // create path if not exist + if (!JFolder::exists($path)) + { + JFolder::create($path); + // count the folder created + $this->folderCount++; + } + // add to language files (for now we add all to both TODO) + $this->writeFile( + $path . '/' . $tag . '.' . $module->file_name + . '.ini', + implode(PHP_EOL, $lang) + ); + $this->writeFile( + $path . '/' . $tag . '.' . $module->file_name + . '.sys.ini', + implode(PHP_EOL, $lang) + ); + // set the line counter + $this->lineCount = $this->lineCount + count( + (array) $lang + ); + unset($lang); + // trigger to add language + $addLang[$tag] = $tag; + } + } + } } // get all files and folders in module folder - $files = JFolder::files($module->folder_path); + $files = JFolder::files($module->folder_path); $folders = JFolder::folders($module->folder_path); // the files/folders to ignore - $ignore = array('sql', 'language', 'script.php', $module->file_name . '.xml', $module->file_name . '.php'); + $ignore = array('sql', 'language', 'script.php', + $module->file_name . '.xml', + $module->file_name . '.php'); // should the scriptfile be added if ($module->add_install_script) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . 'script.php'; + $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . $this->_t(1) + . 'script.php'; } // should the sql install be added if ($module->add_sql) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; $xml .= PHP_EOL . $this->_t(1) . ''; $xml .= PHP_EOL . $this->_t(2) . ''; - $xml .= PHP_EOL . $this->_t(3) . 'sql/mysql/install.sql'; + $xml .= PHP_EOL . $this->_t(3) + . 'sql/mysql/install.sql'; $xml .= PHP_EOL . $this->_t(2) . ''; $xml .= PHP_EOL . $this->_t(1) . ''; } // should the sql uninstall be added if ($module->add_sql_uninstall) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; $xml .= PHP_EOL . $this->_t(1) . ''; $xml .= PHP_EOL . $this->_t(2) . ''; - $xml .= PHP_EOL . $this->_t(3) . 'sql/mysql/uninstall.sql'; + $xml .= PHP_EOL . $this->_t(3) + . 'sql/mysql/uninstall.sql'; $xml .= PHP_EOL . $this->_t(2) . ''; $xml .= PHP_EOL . $this->_t(1) . ''; } // should the language xml be added - if ($addLang) + if (ComponentbuilderHelper::checkArray($addLang)) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(2) . '' . $this->langTag . '/' . $this->langTag . '.' . $module->file_name . '.ini'; - $xml .= PHP_EOL . $this->_t(2) . '' . $this->langTag . '/' . $this->langTag . '.' . $module->file_name . '.sys.ini'; + $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . $this->_t(1) + . ''; + // load all the language files to xml + foreach ($addLang as $addTag) + { + $xml .= PHP_EOL . $this->_t(2) . '' . $addTag . '/' . $addTag . '.' + . $module->file_name . '.ini'; + $xml .= PHP_EOL . $this->_t(2) . '' . $addTag . '/' . $addTag . '.' + . $module->file_name . '.sys.ini'; + } $xml .= PHP_EOL . $this->_t(1) . ''; } // add the module files - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(2) . '' . $module->file_name . '.php'; + $xml .= PHP_EOL . $this->_t(2) . '' . $module->file_name + . '.php'; // add other files found if (ComponentbuilderHelper::checkArray($files)) { @@ -16870,7 +25989,8 @@ function vdm_dkim() { // only add what is not ignored if (!in_array($file, $ignore)) { - $xml .= PHP_EOL . $this->_t(2) . '' . $file . ''; + $xml .= PHP_EOL . $this->_t(2) . '' . $file + . ''; } } } @@ -16892,7 +26012,8 @@ function vdm_dkim() { // only add what is not ignored if (!in_array($folder, $ignore)) { - $xml .= PHP_EOL . $this->_t(2) . '' . $folder . ''; + $xml .= PHP_EOL . $this->_t(2) . '' . $folder + . ''; } } } @@ -16900,14 +26021,20 @@ function vdm_dkim() { // now add the Config Params if needed if (ComponentbuilderHelper::checkArray($config_fields)) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; // only add if part of the component field types path is required if ($add_component_path) { // add path to module rules and custom fields $xml .= PHP_EOL . $this->_t(1) . '_t(2) . 'addrulepath="/administrator/components/com_' . $this->componentCodeName . '/modules/rules"'; - $xml .= PHP_EOL . $this->_t(2) . 'addfieldpath="/administrator/components/com_' . $this->componentCodeName . '/modules/fields"'; + $xml .= PHP_EOL . $this->_t(2) + . 'addrulepath="/administrator/components/com_' + . $this->componentCodeName . '/modules/rules"'; + $xml .= PHP_EOL . $this->_t(2) + . 'addfieldpath="/administrator/components/com_' + . $this->componentCodeName . '/modules/fields"'; $xml .= PHP_EOL . $this->_t(1) . '>'; } else @@ -16917,33 +26044,47 @@ function vdm_dkim() { // add the fields foreach ($module->config_fields as $field_name => $fieldsets) { - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . $this->_t(1) . ''; foreach ($fieldsets as $fieldset => $fields) { // default to the field set name $label = $fieldset; - if (isset($module->fieldsets_label[$field_name.$fieldset])) + if (isset( + $module->fieldsets_label[$field_name . $fieldset] + )) { - $label = $module->fieldsets_label[$field_name.$fieldset]; + $label = $module->fieldsets_label[$field_name + . $fieldset]; } // add path to module rules and custom fields - if (isset($module->fieldsets_paths[$field_name . $fieldset]) && $module->fieldsets_paths[$field_name . $fieldset] == 2) + if (isset($module->fieldsets_paths[$field_name . $fieldset]) + && $module->fieldsets_paths[$field_name . $fieldset] + == 2) { - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . '
    _t(2) . 'addrulepath="/modules/' . $module->file_name . '/rules"'; - $xml .= PHP_EOL . $this->_t(2) . 'addfieldpath="/modules/' . $module->file_name . '/fields"'; + $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . $this->_t(1) . '
    _t(2) + . 'addrulepath="/modules/' . $module->file_name + . '/rules"'; + $xml .= PHP_EOL . $this->_t(2) + . 'addfieldpath="/modules/' . $module->file_name + . '/fields"'; $xml .= PHP_EOL . $this->_t(1) . '>'; } else { - $xml .= PHP_EOL . $this->_t(1) . '
    '; + $xml .= PHP_EOL . $this->_t(1) . '
    '; } // load the fields - if (isset($config_fields[$field_name.$fieldset])) + if (isset($config_fields[$field_name . $fieldset])) { - $xml .= $config_fields[$field_name.$fieldset]; - unset($config_fields[$field_name.$fieldset]); + $xml .= $config_fields[$field_name . $fieldset]; + unset($config_fields[$field_name . $fieldset]); } $xml .= PHP_EOL . $this->_t(1) . '
    '; } @@ -16954,9 +26095,14 @@ function vdm_dkim() { // set update server if found if ($module->add_update_server) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(2) . '' . $module->update_server_url . ''; + $xml .= PHP_EOL . $this->_t(2) + . '' . $module->update_server_url + . ''; $xml .= PHP_EOL . $this->_t(1) . ''; } @@ -16977,7 +26123,7 @@ function vdm_dkim() { public function getPluginMainXML(&$plugin) { // set some defaults - $view = ''; + $view = ''; $viewType = 0; // set the custom table key $dbkey = 'yy'; @@ -16987,90 +26133,197 @@ function vdm_dkim() { $add_component_path = false; // build the config fields $config_fields = array(); - if (isset($plugin->config_fields) && ComponentbuilderHelper::checkArray($plugin->config_fields)) + if (isset($plugin->config_fields) + && ComponentbuilderHelper::checkArray( + $plugin->config_fields + )) { foreach ($plugin->config_fields as $field_name => $fieldsets) { foreach ($fieldsets as $fieldset => $fields) { // get the field set - $xmlFields = $this->getExtensionFieldsetXML($plugin, $fields, $dbkey); + $xmlFields = $this->getExtensionFieldsetXML( + $plugin, $fields, $dbkey + ); // make sure the xml is set and a string - if (isset($xmlFields) && ComponentbuilderHelper::checkString($xmlFields)) + if (isset($xmlFields) + && ComponentbuilderHelper::checkString($xmlFields)) { $config_fields[$field_name . $fieldset] = $xmlFields; } $dbkey++; // check if the fieldset path requiers component paths - if (!$add_component_path && isset($plugin->fieldsets_paths[$field_name . $fieldset]) && $plugin->fieldsets_paths[$field_name . $fieldset] == 1) + if (!$add_component_path + && isset( + $plugin->fieldsets_paths[$field_name . $fieldset] + ) + && $plugin->fieldsets_paths[$field_name . $fieldset] + == 1) { $add_component_path = true; } } } } - // switch to add the xml - $addLang = false; + // switch to add the language xml + $addLang = array(); // now build the language files if (isset($this->langContent[$plugin->key])) { - $lang = array_map(function ($langstring, $placeholder) + // Trigger Event: jcb_ce_onBeforeBuildPluginLang + $this->triggerEvent( + 'jcb_ce_onBeforeBuildPluginLang', + array(&$plugin->context, &$this->langContent[$plugin->key], + &$plugin->lang_prefix, &$plugin->official_name) + ); + // get other languages + $values = array_unique($this->langContent[$plugin->key]); + // get the other lang strings if there is any + $this->multiLangString = $this->getMultiLangStrings($values); + // start the plugins language bucket + $this->languages['plugins'][$this->langTag]['all'] + = $this->langContent[$plugin->key]; + unset($this->langContent[$plugin->key]); + // update insert the current lang in to DB + $this->setLangPlaceholders($values, $plugin->id, 'plugins'); + // remove old unused language strings + $this->purgeLanuageStrings($values, $plugin->id, 'plugins'); + $total = count($values); + unset($values); + // Trigger Event: jcb_ce_onBeforeBuildPluginLangFiles + $this->triggerEvent( + 'jcb_ce_onBeforeBuildPluginLangFiles', + array(&$plugin->context, &$this->languages['plugins'], + &$this->langTag) + ); + // now we insert the values into the files + if (ComponentbuilderHelper::checkArray($this->languages['plugins'])) { - return $placeholder . '="' . $langstring . '"'; - }, $this->langContent[$plugin->key], array_keys($this->langContent[$plugin->key])); - // add to language file - $this->writeFile($plugin->folder_path . '/language/' . $this->langTag . '/' . $this->langTag . '.plg_' . strtolower($plugin->group) . '_' . strtolower($plugin->code_name) . '.ini', implode(PHP_EOL, $lang)); - $this->writeFile($plugin->folder_path . '/language/' . $this->langTag . '/' . $this->langTag . '.plg_' . strtolower($plugin->group) . '_' . strtolower($plugin->code_name) . '.sys.ini', implode(PHP_EOL, $lang)); - // set the line counter - $this->lineCount = $this->lineCount + count((array) $lang); - unset($lang); - // trigger the xml - $addLang = true; + foreach ($this->languages['plugins'] as $tag => $areas) + { + // trim the tag + $tag = trim($tag); + foreach ($areas as $area => $languageStrings) + { + // check if language should be added + if (!$this->shouldLanguageBeAdded( + $tag, $languageStrings, $total + )) + { + continue; + } + $lang = array_map( + function ($langstring, $placeholder) { + return $placeholder . '="' . $langstring . '"'; + }, array_values($languageStrings), + array_keys($languageStrings) + ); + // set path + $path = $plugin->folder_path . '/language/' . $tag . '/' + . $tag; + // create path if not exist + if (!JFolder::exists($path)) + { + JFolder::create($path); + // count the folder created + $this->folderCount++; + } + // add to language file + $this->writeFile( + $path . '.plg_' . strtolower($plugin->group) . '_' + . strtolower($plugin->code_name) . '.ini', + implode(PHP_EOL, $lang) + ); + $this->writeFile( + $path . '.plg_' . strtolower($plugin->group) . '_' + . strtolower($plugin->code_name) . '.sys.ini', + implode(PHP_EOL, $lang) + ); + // set the line counter + $this->lineCount = $this->lineCount + count( + (array) $lang + ); + unset($lang); + // trigger to add language + $addLang[$tag] = $tag; + } + } + } } // get all files and folders in plugin folder - $files = JFolder::files($plugin->folder_path); + $files = JFolder::files($plugin->folder_path); $folders = JFolder::folders($plugin->folder_path); // the files/folders to ignore - $ignore = array('sql', 'language', 'script.php', $plugin->file_name . '.xml', $plugin->file_name . '.php'); + $ignore = array('sql', 'language', 'script.php', + $plugin->file_name . '.xml', + $plugin->file_name . '.php'); // should the scriptfile be added if ($plugin->add_install_script) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . 'script.php'; + $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . $this->_t(1) + . 'script.php'; } // should the sql install be added if ($plugin->add_sql) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; $xml .= PHP_EOL . $this->_t(1) . ''; $xml .= PHP_EOL . $this->_t(2) . ''; - $xml .= PHP_EOL . $this->_t(3) . 'sql/mysql/install.sql'; + $xml .= PHP_EOL . $this->_t(3) + . 'sql/mysql/install.sql'; $xml .= PHP_EOL . $this->_t(2) . ''; $xml .= PHP_EOL . $this->_t(1) . ''; } // should the sql uninstall be added if ($plugin->add_sql_uninstall) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; $xml .= PHP_EOL . $this->_t(1) . ''; $xml .= PHP_EOL . $this->_t(2) . ''; - $xml .= PHP_EOL . $this->_t(3) . 'sql/mysql/uninstall.sql'; + $xml .= PHP_EOL . $this->_t(3) + . 'sql/mysql/uninstall.sql'; $xml .= PHP_EOL . $this->_t(2) . ''; $xml .= PHP_EOL . $this->_t(1) . ''; } // should the language xml be added - if ($addLang) + if (ComponentbuilderHelper::checkArray($addLang)) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(2) . '' . $this->langTag . '/' . $this->langTag . '.plg_' . strtolower($plugin->group) . '_' . strtolower($plugin->code_name) . '.ini'; - $xml .= PHP_EOL . $this->_t(2) . '' . $this->langTag . '/' . $this->langTag . '.plg_' . strtolower($plugin->group) . '_' . strtolower($plugin->code_name) . '.sys.ini'; + // load all the language files to xml + foreach ($addLang as $addTag) + { + $xml .= PHP_EOL . $this->_t(2) . '' . $addTag . '/' . $addTag . '.plg_' + . strtolower($plugin->group) . '_' . strtolower( + $plugin->code_name + ) . '.ini'; + $xml .= PHP_EOL . $this->_t(2) . '' . $addTag . '/' . $addTag . '.plg_' + . strtolower($plugin->group) . '_' . strtolower( + $plugin->code_name + ) . '.sys.ini'; + } $xml .= PHP_EOL . $this->_t(1) . ''; } // add the plugin files - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(2) . '' . $plugin->file_name . '.php'; + $xml .= PHP_EOL . $this->_t(2) . '' . $plugin->file_name + . '.php'; // add other files found if (ComponentbuilderHelper::checkArray($files)) { @@ -17079,7 +26332,8 @@ function vdm_dkim() { // only add what is not ignored if (!in_array($file, $ignore)) { - $xml .= PHP_EOL . $this->_t(2) . '' . $file . ''; + $xml .= PHP_EOL . $this->_t(2) . '' . $file + . ''; } } } @@ -17101,7 +26355,8 @@ function vdm_dkim() { // only add what is not ignored if (!in_array($folder, $ignore)) { - $xml .= PHP_EOL . $this->_t(2) . '' . $folder . ''; + $xml .= PHP_EOL . $this->_t(2) . '' . $folder + . ''; } } } @@ -17109,14 +26364,20 @@ function vdm_dkim() { // now add the Config Params if needed if (ComponentbuilderHelper::checkArray($config_fields)) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; // only add if part of the component field types path is required if ($add_component_path) { // add path to plugin rules and custom fields $xml .= PHP_EOL . $this->_t(1) . '_t(2) . 'addrulepath="/administrator/components/com_' . $this->componentCodeName . '/models/rules"'; - $xml .= PHP_EOL . $this->_t(2) . 'addfieldpath="/administrator/components/com_' . $this->componentCodeName . '/models/fields"'; + $xml .= PHP_EOL . $this->_t(2) + . 'addrulepath="/administrator/components/com_' + . $this->componentCodeName . '/models/rules"'; + $xml .= PHP_EOL . $this->_t(2) + . 'addfieldpath="/administrator/components/com_' + . $this->componentCodeName . '/models/fields"'; $xml .= PHP_EOL . $this->_t(1) . '>'; } else @@ -17126,33 +26387,51 @@ function vdm_dkim() { // add the fields foreach ($plugin->config_fields as $field_name => $fieldsets) { - $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . $this->_t(1) . ''; foreach ($fieldsets as $fieldset => $fields) { // default to the field set name $label = $fieldset; - if (isset($plugin->fieldsets_label[$field_name.$fieldset])) + if (isset( + $plugin->fieldsets_label[$field_name . $fieldset] + )) { - $label = $plugin->fieldsets_label[$field_name.$fieldset]; + $label = $plugin->fieldsets_label[$field_name + . $fieldset]; } // add path to plugin rules and custom fields - if (isset($plugin->fieldsets_paths[$field_name . $fieldset]) && $plugin->fieldsets_paths[$field_name . $fieldset] == 2) + if (isset($plugin->fieldsets_paths[$field_name . $fieldset]) + && $plugin->fieldsets_paths[$field_name . $fieldset] + == 2) { - $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(1) . '
    _t(2) . 'addrulepath="/plugins/' . strtolower($plugin->group) . '/' . strtolower($plugin->code_name) . '/rules"'; - $xml .= PHP_EOL . $this->_t(2) . 'addfieldpath="/plugins/' . strtolower($plugin->group) . '/' . strtolower($plugin->code_name) . '/fields"'; + $xml .= PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . $this->_t(1) . '
    _t(2) + . 'addrulepath="/plugins/' . strtolower( + $plugin->group + ) . '/' . strtolower($plugin->code_name) + . '/rules"'; + $xml .= PHP_EOL . $this->_t(2) + . 'addfieldpath="/plugins/' . strtolower( + $plugin->group + ) . '/' . strtolower($plugin->code_name) + . '/fields"'; $xml .= PHP_EOL . $this->_t(1) . '>'; } else { - $xml .= PHP_EOL . $this->_t(1) . '
    '; + $xml .= PHP_EOL . $this->_t(1) . '
    '; } // load the fields - if (isset($config_fields[$field_name.$fieldset])) + if (isset($config_fields[$field_name . $fieldset])) { - $xml .= $config_fields[$field_name.$fieldset]; - unset($config_fields[$field_name.$fieldset]); + $xml .= $config_fields[$field_name . $fieldset]; + unset($config_fields[$field_name . $fieldset]); } $xml .= PHP_EOL . $this->_t(1) . '
    '; } @@ -17163,19 +26442,24 @@ function vdm_dkim() { // set update server if found if ($plugin->add_update_server) { - $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; + $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(2) . '' . $plugin->update_server_url . ''; + $xml .= PHP_EOL . $this->_t(2) + . '' . $plugin->update_server_url + . ''; $xml .= PHP_EOL . $this->_t(1) . ''; } return $xml; } - public function getExtensionFieldsetXML(&$extension, &$fields, $dbkey = 'zz') - { + public function getExtensionFieldsetXML(&$extension, &$fields, $dbkey = 'zz' + ) { // set some defaults - $view = ''; + $view = ''; $viewType = 0; // build the fieldset $fieldset = ''; @@ -17188,25 +26472,44 @@ function vdm_dkim() { if ($this->fieldBuilderType == 1) { // string manipulation - $xmlField = $this->setDynamicField($field, $view, $viewType, $extension->lang_prefix, $extension->key, $extension->key, $this->globalPlaceholders, $dbkey, false); + $xmlField = $this->setDynamicField( + $field, $view, $viewType, $extension->lang_prefix, + $extension->key, $extension->key, + $this->globalPlaceholders, $dbkey, false + ); } else { // simpleXMLElement class - $newxmlField = $this->setDynamicField($field, $view, $viewType, $extension->lang_prefix, $extension->key, $extension->key, $this->globalPlaceholders, $dbkey, false); + $newxmlField = $this->setDynamicField( + $field, $view, $viewType, $extension->lang_prefix, + $extension->key, $extension->key, + $this->globalPlaceholders, $dbkey, false + ); if (isset($newxmlField->fieldXML)) { - $xmlField = dom_import_simplexml($newxmlField->fieldXML); - $xmlField = PHP_EOL . $this->_t(2) . "' . PHP_EOL . $this->_t(1) . $this->xmlPrettyPrint($xmlField, 'field'); + $xmlField = dom_import_simplexml( + $newxmlField->fieldXML + ); + $xmlField = PHP_EOL . $this->_t(2) . "' . PHP_EOL + . $this->_t(1) . $this->xmlPrettyPrint( + $xmlField, 'field' + ); } } // make sure the xml is set and a string - if (isset($xmlField) && ComponentbuilderHelper::checkString($xmlField)) + if (isset($xmlField) + && ComponentbuilderHelper::checkString( + $xmlField + )) { $fieldset .= $xmlField; } } } + return $fieldset; } @@ -17214,7 +26517,8 @@ function vdm_dkim() { { // yes we are adding it $script = PHP_EOL . '/**'; - $script .= PHP_EOL . ' * ' . $extension->official_name . ' script file.'; + $script .= PHP_EOL . ' * ' . $extension->official_name + . ' script file.'; $script .= PHP_EOL . ' *'; $script .= PHP_EOL . ' * @package ' . $extension->class_name; $script .= PHP_EOL . ' */'; @@ -17223,38 +26527,58 @@ function vdm_dkim() { // set constructor if (isset($extension->add_php_script_construct) && $extension->add_php_script_construct == 1 - && ComponentbuilderHelper::checkString($extension->php_script_construct)) + && ComponentbuilderHelper::checkString( + $extension->php_script_construct + )) { - $script .= $this->setInstallMethodScript('construct', $extension->php_script_construct); + $script .= $this->setInstallMethodScript( + 'construct', $extension->php_script_construct + ); } // add PHP in extension install - $addScriptMethods = array('php_preflight', 'php_postflight', 'php_method'); - $addScriptTypes = array('install', 'update', 'uninstall', 'discover_install'); + $addScriptMethods = array('php_preflight', 'php_postflight', + 'php_method'); + $addScriptTypes = array('install', 'update', 'uninstall', + 'discover_install'); // set some buckets for sorting - $function_install = array(); - $function_update = array(); - $function_uninstall = array(); - $has_php_preflight = false; - $function_php_preflight = array('install' => array(), 'uninstall' => array(), 'discover_install' => array(), 'update' => array()); - $has_php_postflight = false; - $function_php_postflight = array('install' => array(), 'uninstall' => array(), 'discover_install' => array(), 'update' => array()); + $function_install = array(); + $function_update = array(); + $function_uninstall = array(); + $has_php_preflight = false; + $function_php_preflight = array('install' => array(), + 'uninstall' => array(), + 'discover_install' => array(), + 'update' => array()); + $has_php_postflight = false; + $function_php_postflight = array('install' => array(), + 'uninstall' => array(), + 'discover_install' => array(), + 'update' => array()); // the function sorter foreach ($addScriptMethods as $scriptMethod) { foreach ($addScriptTypes as $scriptType) { - if (isset($extension->{'add_' . $scriptMethod . '_' . $scriptType}) - && $extension->{'add_' . $scriptMethod . '_' . $scriptType} == 1 - && ComponentbuilderHelper::checkString($extension->{$scriptMethod . '_' . $scriptType})) + if (isset( + $extension->{'add_' . $scriptMethod . '_' . $scriptType} + ) + && $extension->{'add_' . $scriptMethod . '_' . $scriptType} + == 1 + && ComponentbuilderHelper::checkString( + $extension->{$scriptMethod . '_' . $scriptType} + )) { // add to the main methods if ('php_method' === $scriptMethod) { - ${'function_' . $scriptType}[] = $extension->{$scriptMethod . '_' . $scriptType}; + ${'function_' . $scriptType}[] + = $extension->{$scriptMethod . '_' . $scriptType}; } else { - ${'function_' . $scriptMethod}[$scriptType][] = $extension->{$scriptMethod . '_' . $scriptType}; + ${'function_' . $scriptMethod}[$scriptType][] + = $extension->{$scriptMethod + . '_' . $scriptType}; ${'has_' . $scriptMethod} = true; } } @@ -17263,27 +26587,37 @@ function vdm_dkim() { // now add the install script. if (ComponentbuilderHelper::checkArray($function_install)) { - $script .= $this->setInstallMethodScript('install', $function_install); + $script .= $this->setInstallMethodScript( + 'install', $function_install + ); } // now add the update script. if (ComponentbuilderHelper::checkArray($function_update)) { - $script .= $this->setInstallMethodScript('update', $function_update); + $script .= $this->setInstallMethodScript( + 'update', $function_update + ); } // now add the uninstall script. if (ComponentbuilderHelper::checkArray($function_uninstall)) { - $script .= $this->setInstallMethodScript('uninstall', $function_uninstall); + $script .= $this->setInstallMethodScript( + 'uninstall', $function_uninstall + ); } // now add the preflight script. if ($has_php_preflight) { - $script .= $this->setInstallMethodScript('preflight', $function_php_preflight); + $script .= $this->setInstallMethodScript( + 'preflight', $function_php_preflight + ); } // now add the postflight script. if ($has_php_postflight) { - $script .= $this->setInstallMethodScript('postflight', $function_php_postflight); + $script .= $this->setInstallMethodScript( + 'postflight', $function_php_postflight + ); } $script .= PHP_EOL . '}' . PHP_EOL; @@ -17294,21 +26628,25 @@ function vdm_dkim() { { $script = ''; // build function - switch($function_name) + switch ($function_name) { case 'install': case 'update': case 'uninstall': // the main function types - $script = PHP_EOL . PHP_EOL . $this->_t(1) .'/**'; - $script .= PHP_EOL . $this->_t(1) .' * Called on ' . $function_name; - $script .= PHP_EOL . $this->_t(1) .' *'; - $script .= PHP_EOL . $this->_t(1) .' * @param JAdapterInstance $adapter The object responsible for running this script'; - $script .= PHP_EOL . $this->_t(1) .' *'; - $script .= PHP_EOL . $this->_t(1) .' * @return boolean True on success'; - $script .= PHP_EOL . $this->_t(1) .' */'; - $script .= PHP_EOL . $this->_t(1) .'public function ' . $function_name . '(JAdapterInstance $adapter)'; - $script .= PHP_EOL . $this->_t(1) .'{'; + $script = PHP_EOL . PHP_EOL . $this->_t(1) . '/**'; + $script .= PHP_EOL . $this->_t(1) . ' * Called on ' + . $function_name; + $script .= PHP_EOL . $this->_t(1) . ' *'; + $script .= PHP_EOL . $this->_t(1) + . ' * @param JAdapterInstance $adapter The object responsible for running this script'; + $script .= PHP_EOL . $this->_t(1) . ' *'; + $script .= PHP_EOL . $this->_t(1) + . ' * @return boolean True on success'; + $script .= PHP_EOL . $this->_t(1) . ' */'; + $script .= PHP_EOL . $this->_t(1) . 'public function ' + . $function_name . '(JAdapterInstance $adapter)'; + $script .= PHP_EOL . $this->_t(1) . '{'; $script .= PHP_EOL . implode(PHP_EOL . PHP_EOL, $scripts); // return true if ('uninstall' !== $function_name) @@ -17319,26 +26657,39 @@ function vdm_dkim() { case 'preflight': case 'postflight': // the pre/post function types - $script = PHP_EOL . PHP_EOL . $this->_t(1) .'/**'; - $script .= PHP_EOL . $this->_t(1) .' * Called before any type of action'; - $script .= PHP_EOL . $this->_t(1) .' *'; - $script .= PHP_EOL . $this->_t(1) .' * @param string $route Which action is happening (install|uninstall|discover_install|update)'; - $script .= PHP_EOL . $this->_t(1) .' * @param JAdapterInstance $adapter The object responsible for running this script'; - $script .= PHP_EOL . $this->_t(1) .' *'; - $script .= PHP_EOL . $this->_t(1) .' * @return boolean True on success'; - $script .= PHP_EOL . $this->_t(1) .' */'; - $script .= PHP_EOL . $this->_t(1) .'public function ' . $function_name . '($route, JAdapterInstance $adapter)'; - $script .= PHP_EOL . $this->_t(1) .'{'; - $script .= PHP_EOL . $this->_t(2) . '//' . $this->setLine(__LINE__) . ' get application'; - $script .= PHP_EOL . $this->_t(2) . '$app = JFactory::getApplication();' . PHP_EOL; + $script = PHP_EOL . PHP_EOL . $this->_t(1) . '/**'; + $script .= PHP_EOL . $this->_t(1) + . ' * Called before any type of action'; + $script .= PHP_EOL . $this->_t(1) . ' *'; + $script .= PHP_EOL . $this->_t(1) + . ' * @param string $route Which action is happening (install|uninstall|discover_install|update)'; + $script .= PHP_EOL . $this->_t(1) + . ' * @param JAdapterInstance $adapter The object responsible for running this script'; + $script .= PHP_EOL . $this->_t(1) . ' *'; + $script .= PHP_EOL . $this->_t(1) + . ' * @return boolean True on success'; + $script .= PHP_EOL . $this->_t(1) . ' */'; + $script .= PHP_EOL . $this->_t(1) . 'public function ' + . $function_name . '($route, JAdapterInstance $adapter)'; + $script .= PHP_EOL . $this->_t(1) . '{'; + $script .= PHP_EOL . $this->_t(2) . '//' . $this->setLine( + __LINE__ + ) . ' get application'; + $script .= PHP_EOL . $this->_t(2) + . '$app = JFactory::getApplication();' . PHP_EOL; // add the default version check (TODO) must make this dynamic if ('preflight' === $function_name) { - $script .= PHP_EOL . $this->_t(2) . '//' . $this->setLine(__LINE__) . ' the default for both install and update'; - $script .= PHP_EOL . $this->_t(2) . '$jversion = new JVersion();'; - $script .= PHP_EOL . $this->_t(2) . "if (!\$jversion->isCompatible('3.8.0'))"; + $script .= PHP_EOL . $this->_t(2) . '//' . $this->setLine( + __LINE__ + ) . ' the default for both install and update'; + $script .= PHP_EOL . $this->_t(2) + . '$jversion = new JVersion();'; + $script .= PHP_EOL . $this->_t(2) + . "if (!\$jversion->isCompatible('3.8.0'))"; $script .= PHP_EOL . $this->_t(2) . '{'; - $script .= PHP_EOL . $this->_t(3) . "\$app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error');"; + $script .= PHP_EOL . $this->_t(3) + . "\$app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error');"; $script .= PHP_EOL . $this->_t(3) . 'return false;'; $script .= PHP_EOL . $this->_t(2) . '}' . PHP_EOL; } @@ -17348,9 +26699,12 @@ function vdm_dkim() { if (ComponentbuilderHelper::checkArray($_script)) { // set the if and script - $script .= PHP_EOL . $this->_t(2) . "if ('" . $route . "' === \$route)"; + $script .= PHP_EOL . $this->_t(2) . "if ('" . $route + . "' === \$route)"; $script .= PHP_EOL . $this->_t(2) . '{'; - $script .= PHP_EOL . implode(PHP_EOL . PHP_EOL, $_script); + $script .= PHP_EOL . implode( + PHP_EOL . PHP_EOL, $_script + ); $script .= PHP_EOL . $this->_t(2) . '}' . PHP_EOL; } } @@ -17359,13 +26713,15 @@ function vdm_dkim() { break; case 'construct': // the __construct script - $script = PHP_EOL . PHP_EOL . $this->_t(1) .'/**'; - $script .= PHP_EOL . $this->_t(1) .' * Constructor'; - $script .= PHP_EOL . $this->_t(1) .' *'; - $script .= PHP_EOL . $this->_t(1) .' * @param JAdapterInstance $adapter The object responsible for running this script'; - $script .= PHP_EOL . $this->_t(1) .' */'; - $script .= PHP_EOL . $this->_t(1) .'public function __construct(JAdapterInstance $adapter)'; - $script .= PHP_EOL . $this->_t(1) .'{'; + $script = PHP_EOL . PHP_EOL . $this->_t(1) . '/**'; + $script .= PHP_EOL . $this->_t(1) . ' * Constructor'; + $script .= PHP_EOL . $this->_t(1) . ' *'; + $script .= PHP_EOL . $this->_t(1) + . ' * @param JAdapterInstance $adapter The object responsible for running this script'; + $script .= PHP_EOL . $this->_t(1) . ' */'; + $script .= PHP_EOL . $this->_t(1) + . 'public function __construct(JAdapterInstance $adapter)'; + $script .= PHP_EOL . $this->_t(1) . '{'; $script .= PHP_EOL . $scripts; break; default: @@ -17378,4 +26734,46 @@ function vdm_dkim() { return $script; } + public function shouldLanguageBeAdded(&$tag, &$languageStrings, &$total) + { + // only log messages for none $this->langTag translations + if ($this->langTag !== $tag) + { + $langStringNr = count($languageStrings); + $langStringSum = ComponentbuilderHelper::bcmath( + 'mul', $langStringNr, 100 + ); + $percentage = ComponentbuilderHelper::bcmath( + 'div', $langStringSum, $total + ); + $stringNAme = ($langStringNr == 1) ? '(string ' + . $tag . ' translated)' + : '(strings ' . $tag . ' translated)'; + // force load if debug lines are added + if (!$this->debugLinenr) + { + // check if we should install this translation + if ($percentage < $this->percentageLanguageAdd) + { + // dont add + $this->langNot[$area . ' ' . $tag] = '' + . $total . '(total ' + . $this->langTag . ' strings) only ' + . $langStringNr . '' . $stringNAme + . ' = ' . $percentage; + + return false; + } + } + // show if it was added as well + $this->langSet[$area . ' ' . $tag] = '' + . $total . '(total ' + . $this->langTag . ' strings) and ' + . $langStringNr . '' . $stringNAme . ' = ' + . $percentage; + } + + return true; + } + } diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index d819967a6..9c895d8ca 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -5,7 +5,7 @@ * @created 30th April, 2015 * @author Llewellyn van der Merwe * @github Joomla Component Builder - * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @copyright Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -23,8 +23,6 @@ class Infusion extends Interpretation public $langFiles = array(); public $removeSiteFolder = false; public $removeSiteEditFolder = true; - public $langNot = array(); - public $langSet = array(); /** * Constructor @@ -37,16 +35,17 @@ class Infusion extends Interpretation // infuse the data into the structure return $this->buildFileContent(); } + return false; } /** * Set the line number in comments - * - * @param int $nr The line number - * + * + * @param int $nr The line number + * * @return void - * + * */ private function setLine($nr) { @@ -54,209 +53,354 @@ class Infusion extends Interpretation { return ' [Infusion ' . $nr . ']'; } + return ''; } /** * Build the content for the structure - * + * * * @return boolean on success - * + * */ protected function buildFileContent() { - if (isset($this->componentData->admin_views) && ComponentbuilderHelper::checkArray($this->componentData->admin_views)) + if (isset($this->componentData->admin_views) + && ComponentbuilderHelper::checkArray( + $this->componentData->admin_views + )) { // Trigger Event: jcb_ce_onBeforeBuildFilesContent - $this->triggerEvent('jcb_ce_onBeforeBuildFilesContent', array(&$this->componentContext, &$this->componentData, &$this->fileContentStatic, &$this->fileContentDynamic, &$this->placeholders, &$this->hhh)); + $this->triggerEvent( + 'jcb_ce_onBeforeBuildFilesContent', + array(&$this->componentContext, &$this->componentData, + &$this->fileContentStatic, &$this->fileContentDynamic, + &$this->placeholders, &$this->hhh) + ); // COMPONENT - $this->fileContentStatic[$this->hhh . 'COMPONENT' . $this->hhh] = $this->placeholders[$this->hhh . 'COMPONENT' . $this->hhh]; + $this->fileContentStatic[$this->hhh . 'COMPONENT' . $this->hhh] + = $this->placeholders[$this->hhh . 'COMPONENT' . $this->hhh]; // Component - $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] = $this->placeholders[$this->hhh . 'Component' . $this->hhh]; + $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] + = $this->placeholders[$this->hhh . 'Component' . $this->hhh]; // component - $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] = $this->placeholders[$this->hhh . 'component' . $this->hhh]; + $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] + = $this->placeholders[$this->hhh . 'component' . $this->hhh]; // COMPANYNAME - $this->fileContentStatic[$this->hhh . 'COMPANYNAME' . $this->hhh] = trim(JFilterOutput::cleanText($this->componentData->companyname)); + $this->fileContentStatic[$this->hhh . 'COMPANYNAME' . $this->hhh] + = trim( + JFilterOutput::cleanText($this->componentData->companyname) + ); // CREATIONDATE - $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh] = JFactory::getDate($this->componentData->created)->format('jS F, Y'); - $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh . 'GLOBAL'] = $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh]; + $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh] + = JFactory::getDate($this->componentData->created)->format( + 'jS F, Y' + ); + $this->fileContentStatic[$this->hhh . 'CREATIONDATE' . $this->hhh + . 'GLOBAL'] + = $this->fileContentStatic[$this->hhh . 'CREATIONDATE' + . $this->hhh]; // BUILDDATE - $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh] = JFactory::getDate()->format('jS F, Y'); - $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh . 'GLOBAL'] = $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh]; + $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh] + = JFactory::getDate()->format('jS F, Y'); + $this->fileContentStatic[$this->hhh . 'BUILDDATE' . $this->hhh + . 'GLOBAL'] + = $this->fileContentStatic[$this->hhh . 'BUILDDATE' + . $this->hhh]; // AUTHOR - $this->fileContentStatic[$this->hhh . 'AUTHOR' . $this->hhh] = trim(JFilterOutput::cleanText($this->componentData->author)); + $this->fileContentStatic[$this->hhh . 'AUTHOR' . $this->hhh] = trim( + JFilterOutput::cleanText($this->componentData->author) + ); // AUTHOREMAIL - $this->fileContentStatic[$this->hhh . 'AUTHOREMAIL' . $this->hhh] = trim($this->componentData->email); + $this->fileContentStatic[$this->hhh . 'AUTHOREMAIL' . $this->hhh] + = trim($this->componentData->email); // AUTHORWEBSITE - $this->fileContentStatic[$this->hhh . 'AUTHORWEBSITE' . $this->hhh] = trim($this->componentData->website); + $this->fileContentStatic[$this->hhh . 'AUTHORWEBSITE' . $this->hhh] + = trim($this->componentData->website); // COPYRIGHT - $this->fileContentStatic[$this->hhh . 'COPYRIGHT' . $this->hhh] = trim($this->componentData->copyright); + $this->fileContentStatic[$this->hhh . 'COPYRIGHT' . $this->hhh] + = trim($this->componentData->copyright); // LICENSE - $this->fileContentStatic[$this->hhh . 'LICENSE' . $this->hhh] = trim($this->componentData->license); + $this->fileContentStatic[$this->hhh . 'LICENSE' . $this->hhh] + = trim($this->componentData->license); // VERSION - $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh] = trim($this->componentData->component_version); + $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh] + = trim($this->componentData->component_version); // set the actual global version - $this->fileContentStatic[$this->hhh . 'ACTUALVERSION' . $this->hhh] = $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh]; + $this->fileContentStatic[$this->hhh . 'ACTUALVERSION' . $this->hhh] + = $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh]; // do some Tweaks to the version based on selected options - if (strpos($this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh], '.') !== false) + if (strpos( + $this->fileContentStatic[$this->hhh . 'VERSION' + . $this->hhh], '.' + ) !== false) { - $versionArray = explode('.', $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh]); + $versionArray = explode( + '.', $this->fileContentStatic[$this->hhh . 'VERSION' + . $this->hhh] + ); } // load only first two values - if (isset($versionArray) && ComponentbuilderHelper::checkArray($versionArray) && $this->componentData->mvc_versiondate == 2) + if (isset($versionArray) + && ComponentbuilderHelper::checkArray( + $versionArray + ) + && $this->componentData->mvc_versiondate == 2) { - $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh] = $versionArray[0] . '.' . $versionArray[1] . '.x'; + $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh] + = $versionArray[0] . '.' . $versionArray[1] . '.x'; } // load only the first value - elseif (isset($versionArray) && ComponentbuilderHelper::checkArray($versionArray) && $this->componentData->mvc_versiondate == 3) + elseif (isset($versionArray) + && ComponentbuilderHelper::checkArray( + $versionArray + ) + && $this->componentData->mvc_versiondate == 3) { - $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh] = $versionArray[0] . '.x.x'; + $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh] + = $versionArray[0] . '.x.x'; } unset($versionArray); // set the global version in case - $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh . 'GLOBAL'] = $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh]; + $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh + . 'GLOBAL'] + = $this->fileContentStatic[$this->hhh . 'VERSION' . $this->hhh]; // Component_name - $this->fileContentStatic[$this->hhh . 'Component_name' . $this->hhh] = JFilterOutput::cleanText($this->componentData->name); + $this->fileContentStatic[$this->hhh . 'Component_name' . $this->hhh] + = JFilterOutput::cleanText($this->componentData->name); // SHORT_DISCRIPTION - $this->fileContentStatic[$this->hhh . 'SHORT_DESCRIPTION' . $this->hhh] = trim(JFilterOutput::cleanText($this->componentData->short_description)); + $this->fileContentStatic[$this->hhh . 'SHORT_DESCRIPTION' + . $this->hhh] + = trim( + JFilterOutput::cleanText( + $this->componentData->short_description + ) + ); // DESCRIPTION - $this->fileContentStatic[$this->hhh . 'DESCRIPTION' . $this->hhh] = trim($this->componentData->description); + $this->fileContentStatic[$this->hhh . 'DESCRIPTION' . $this->hhh] + = trim($this->componentData->description); // COMP_IMAGE_TYPE - $this->fileContentStatic[$this->hhh . 'COMP_IMAGE_TYPE' . $this->hhh] = $this->setComponentImageType($this->componentData->image); + $this->fileContentStatic[$this->hhh . 'COMP_IMAGE_TYPE' + . $this->hhh] + = $this->setComponentImageType($this->componentData->image); // ACCESS_SECTIONS - $this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' . $this->hhh] = $this->setAccessSections(); + $this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' + . $this->hhh] + = $this->setAccessSections(); // CONFIG_FIELDSETS - $keepLang = $this->lang; + $keepLang = $this->lang; $this->lang = 'admin'; // start loading the category tree scripts - $this->fileContentStatic[$this->hhh . 'CATEGORY_CLASS_TREES' . $this->hhh] = ''; + $this->fileContentStatic[$this->hhh . 'CATEGORY_CLASS_TREES' + . $this->hhh] + = ''; // run the field sets for first time $this->setConfigFieldsets(1); $this->lang = $keepLang; // ADMINJS - $this->fileContentStatic[$this->hhh . 'ADMINJS' . $this->hhh] = $this->setPlaceholders($this->customScriptBuilder['component_js'], $this->placeholders); + $this->fileContentStatic[$this->hhh . 'ADMINJS' . $this->hhh] + = $this->setPlaceholders( + $this->customScriptBuilder['component_js'], $this->placeholders + ); // SITEJS - $this->fileContentStatic[$this->hhh . 'SITEJS' . $this->hhh] = $this->setPlaceholders($this->customScriptBuilder['component_js'], $this->placeholders); + $this->fileContentStatic[$this->hhh . 'SITEJS' . $this->hhh] + = $this->setPlaceholders( + $this->customScriptBuilder['component_js'], $this->placeholders + ); // ADMINCSS - $this->fileContentStatic[$this->hhh . 'ADMINCSS' . $this->hhh] = $this->setPlaceholders($this->customScriptBuilder['component_css_admin'], $this->placeholders); + $this->fileContentStatic[$this->hhh . 'ADMINCSS' . $this->hhh] + = $this->setPlaceholders( + $this->customScriptBuilder['component_css_admin'], + $this->placeholders + ); // SITECSS - $this->fileContentStatic[$this->hhh . 'SITECSS' . $this->hhh] = $this->setPlaceholders($this->customScriptBuilder['component_css_site'], $this->placeholders); + $this->fileContentStatic[$this->hhh . 'SITECSS' . $this->hhh] + = $this->setPlaceholders( + $this->customScriptBuilder['component_css_site'], + $this->placeholders + ); // CUSTOM_HELPER_SCRIPT - $this->fileContentStatic[$this->hhh . 'CUSTOM_HELPER_SCRIPT' . $this->hhh] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_admin'], $this->placeholders); + $this->fileContentStatic[$this->hhh . 'CUSTOM_HELPER_SCRIPT' + . $this->hhh] + = $this->setPlaceholders( + $this->customScriptBuilder['component_php_helper_admin'], + $this->placeholders + ); // BOTH_CUSTOM_HELPER_SCRIPT - $this->fileContentStatic[$this->hhh . 'BOTH_CUSTOM_HELPER_SCRIPT' . $this->hhh] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_both'], $this->placeholders); + $this->fileContentStatic[$this->hhh . 'BOTH_CUSTOM_HELPER_SCRIPT' + . $this->hhh] + = $this->setPlaceholders( + $this->customScriptBuilder['component_php_helper_both'], + $this->placeholders + ); // ADMIN_GLOBAL_EVENT_HELPER - $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] = ''; + $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' + . $this->hhh] + = ''; // ADMIN_GLOBAL_EVENT - $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT' . $this->hhh] = ''; + $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT' + . $this->hhh] + = ''; // now load the data for the global event if needed if ($this->componentData->add_admin_event == 1) { // ADMIN_GLOBAL_EVENT - $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT' . $this->hhh] = PHP_EOL . PHP_EOL . '// Triger the Global Admin Event'; - $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT' . $this->hhh] .= PHP_EOL . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper::globalEvent($document);'; + $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT' + . $this->hhh] + = PHP_EOL . PHP_EOL . '// Triger the Global Admin Event'; + $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT' + . $this->hhh] + .= PHP_EOL . $this->fileContentStatic[$this->hhh + . 'Component' . $this->hhh] + . 'Helper::globalEvent($document);'; // ADMIN_GLOBAL_EVENT_HELPER - $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] = PHP_EOL . PHP_EOL . $this->_t(1) . '/**'; - $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '* The Global Admin Event Method.'; - $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '**/'; - $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . 'public static function globalEvent($document)'; - $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '{'; - $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->setPlaceholders($this->customScriptBuilder['component_php_admin_event'], $this->placeholders); - $this->fileContentStatic[$this->hhh . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '}'; + $this->fileContentStatic[$this->hhh + . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] + = PHP_EOL . PHP_EOL . $this->_t(1) . '/**'; + $this->fileContentStatic[$this->hhh + . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] + .= PHP_EOL . $this->_t(1) + . '* The Global Admin Event Method.'; + $this->fileContentStatic[$this->hhh + . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] + .= PHP_EOL . $this->_t(1) . '**/'; + $this->fileContentStatic[$this->hhh + . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] + .= PHP_EOL . $this->_t(1) + . 'public static function globalEvent($document)'; + $this->fileContentStatic[$this->hhh + . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] + .= PHP_EOL . $this->_t(1) . '{'; + $this->fileContentStatic[$this->hhh + . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] + .= PHP_EOL . $this->setPlaceholders( + $this->customScriptBuilder['component_php_admin_event'], + $this->placeholders + ); + $this->fileContentStatic[$this->hhh + . 'ADMIN_GLOBAL_EVENT_HELPER' . $this->hhh] + .= PHP_EOL . $this->_t(1) . '}'; } // now load the readme file if needed if ($this->componentData->addreadme == 1) { - $this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FILES' . $this->hhh] .= PHP_EOL . $this->_t(3) . "README.txt"; + $this->fileContentStatic[$this->hhh . 'EXSTRA_ADMIN_FILES' + . $this->hhh] + .= PHP_EOL . $this->_t(3) + . "README.txt"; } // HELPER_CREATEUSER - $this->fileContentStatic[$this->hhh . 'HELPER_CREATEUSER' . $this->hhh] = $this->setCreateUserHelperMethod($this->componentData->creatuserhelper); + $this->fileContentStatic[$this->hhh . 'HELPER_CREATEUSER' + . $this->hhh] + = $this->setCreateUserHelperMethod( + $this->componentData->creatuserhelper + ); // HELP - $this->fileContentStatic[$this->hhh . 'HELP' . $this->hhh] = $this->noHelp(); + $this->fileContentStatic[$this->hhh . 'HELP' . $this->hhh] + = $this->noHelp(); // HELP_SITE - $this->fileContentStatic[$this->hhh . 'HELP_SITE' . $this->hhh] = $this->noHelp(); + $this->fileContentStatic[$this->hhh . 'HELP_SITE' . $this->hhh] + = $this->noHelp(); // build route parse switch - $this->fileContentStatic[$this->hhh . 'ROUTER_PARSE_SWITCH' . $this->hhh] = ''; + $this->fileContentStatic[$this->hhh . 'ROUTER_PARSE_SWITCH' + . $this->hhh] + = ''; // build route views - $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh] = ''; + $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' + . $this->hhh] + = ''; // add the helper emailer if set - $this->fileContentStatic[$this->hhh . 'HELPER_EMAIL' . $this->hhh] = $this->addEmailHelper(); + $this->fileContentStatic[$this->hhh . 'HELPER_EMAIL' . $this->hhh] + = $this->addEmailHelper(); // load the global placeholders if (ComponentbuilderHelper::checkArray($this->globalPlaceholders)) { - foreach ($this->globalPlaceholders as $globalPlaceholder => $gloabalValue) + foreach ( + $this->globalPlaceholders as $globalPlaceholder => + $gloabalValue + ) { - $this->fileContentStatic[$globalPlaceholder] = $gloabalValue; + $this->fileContentStatic[$globalPlaceholder] + = $gloabalValue; } } // reset view array - $viewarray = array(); + $viewarray = array(); $site_edit_view_array = array(); // start dynamic build foreach ($this->componentData->admin_views as $view) { // set the target $this->target = 'admin'; - $this->lang = 'admin'; + $this->lang = 'admin'; // reset $viewName_single = ''; - $viewName_list = ''; + $viewName_list = ''; // set single view if (isset($view['settings']->name_single)) { - $viewName_single = ComponentbuilderHelper::safeString($view['settings']->name_single); + $viewName_single = ComponentbuilderHelper::safeString( + $view['settings']->name_single + ); } // set list view if (isset($view['settings']->name_list)) { - $viewName_list = ComponentbuilderHelper::safeString($view['settings']->name_list); + $viewName_list = ComponentbuilderHelper::safeString( + $view['settings']->name_list + ); } // set the view placeholders $this->setViewPlaceholders($view['settings']); // set site edit view array - if (isset($view['edit_create_site_view']) && is_numeric($view['edit_create_site_view']) && $view['edit_create_site_view'] > 0) + if (isset($view['edit_create_site_view']) + && is_numeric( + $view['edit_create_site_view'] + ) + && $view['edit_create_site_view'] > 0) { - $site_edit_view_array[] = $this->_t(4) . "'" . $viewName_single . "'"; - $this->lang = 'both'; + $site_edit_view_array[] = $this->_t(4) . "'" + . $viewName_single . "'"; + $this->lang = 'both'; // insure site view does not get removed $this->removeSiteEditFolder = false; } @@ -266,134 +410,254 @@ class Infusion extends Interpretation $this->setCustomAdminViewListLink($view, $viewName_list); // set view array - $viewarray[] = $this->_t(4) . "'" . $viewName_single . "' => '" . $viewName_list . "'"; + $viewarray[] = $this->_t(4) . "'" . $viewName_single . "' => '" + . $viewName_list . "'"; // set the view names - if (isset($view['settings']->name_single) && $view['settings']->name_single != 'null') + if (isset($view['settings']->name_single) + && $view['settings']->name_single != 'null') { // set license per view if needed $this->setLockLicensePer($viewName_single, $this->target); $this->setLockLicensePer($viewName_list, $this->target); // Trigger Event: jcb_ce_onBeforeBuildAdminEditViewContent - $this->triggerEvent('jcb_ce_onBeforeBuildAdminEditViewContent', array(&$this->componentContext, &$view, &$viewName_single, &$viewName_list, &$this->fileContentStatic, &$this->fileContentDynamic[$viewName_single], &$this->placeholders, &$this->hhh)); + $this->triggerEvent( + 'jcb_ce_onBeforeBuildAdminEditViewContent', + array(&$this->componentContext, &$view, + &$viewName_single, &$viewName_list, + &$this->fileContentStatic, + &$this->fileContentDynamic[$viewName_single], + &$this->placeholders, &$this->hhh) + ); // FIELDSETS <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'FIELDSETS' . $this->hhh] = $this->setFieldSet($view, $this->componentCodeName, $viewName_single, $viewName_list); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'FIELDSETS' . $this->hhh] + = $this->setFieldSet( + $view, $this->componentCodeName, $viewName_single, + $viewName_list + ); // ACCESSCONTROL <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'ACCESSCONTROL' . $this->hhh] = $this->setFieldSetAccessControl($viewName_single); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'ACCESSCONTROL' . $this->hhh] + = $this->setFieldSetAccessControl($viewName_single); // LINKEDVIEWITEMS <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'LINKEDVIEWITEMS' . $this->hhh] = ''; + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'LINKEDVIEWITEMS' . $this->hhh] + = ''; // ADDTOOLBAR <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'ADDTOOLBAR' . $this->hhh] = $this->setAddToolBar($view); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'ADDTOOLBAR' . $this->hhh] + = $this->setAddToolBar($view); // set the script for this view $this->buildTheViewScript($view); // VIEW_SCRIPT - $this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEW_SCRIPT' . $this->hhh] = $this->setViewScript($viewName_single, 'fileScript'); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'VIEW_SCRIPT' . $this->hhh] + = $this->setViewScript($viewName_single, 'fileScript'); // EDITBODYSCRIPT - $this->fileContentDynamic[$viewName_single][$this->hhh . 'EDITBODYSCRIPT' . $this->hhh] = $this->setViewScript($viewName_single, 'footerScript'); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'EDITBODYSCRIPT' . $this->hhh] + = $this->setViewScript( + $viewName_single, 'footerScript' + ); // AJAXTOKE <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'AJAXTOKE' . $this->hhh] = $this->setAjaxToke($viewName_single); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'AJAXTOKE' . $this->hhh] + = $this->setAjaxToke($viewName_single); // DOCUMENT_CUSTOM_PHP <<>> - if ($phpDocument = $this->getCustomScriptBuilder('php_document', $viewName_single, PHP_EOL, null, true, false)) + if ($phpDocument = $this->getCustomScriptBuilder( + 'php_document', $viewName_single, PHP_EOL, null, true, + false + )) { - $this->fileContentDynamic[$viewName_single][$this->hhh . 'DOCUMENT_CUSTOM_PHP' . $this->hhh] = str_replace('$document->', '$this->document->', $phpDocument); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'DOCUMENT_CUSTOM_PHP' . $this->hhh] + = str_replace( + '$document->', '$this->document->', $phpDocument + ); // clear some memory unset($phpDocument); } else { - $this->fileContentDynamic[$viewName_single][$this->hhh . 'DOCUMENT_CUSTOM_PHP' . $this->hhh] = ''; + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'DOCUMENT_CUSTOM_PHP' . $this->hhh] + = ''; } // LINKEDVIEWTABLESCRIPTS <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'LINKEDVIEWTABLESCRIPTS' . $this->hhh] = ''; + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'LINKEDVIEWTABLESCRIPTS' . $this->hhh] + = ''; // VALIDATEFIX <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'VALIDATIONFIX' . $this->hhh] = $this->setValidationFix($viewName_single, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'VALIDATIONFIX' . $this->hhh] + = $this->setValidationFix( + $viewName_single, + $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + ); // EDITBODY <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'EDITBODY' . $this->hhh] = $this->setEditBody($view); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'EDITBODY' . $this->hhh] + = $this->setEditBody($view); // EDITBODY <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'EDITBODYFADEIN' . $this->hhh] = $this->setFadeInEfect($view); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'EDITBODYFADEIN' . $this->hhh] + = $this->setFadeInEfect($view); // JTABLECONSTRUCTOR <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'JTABLECONSTRUCTOR' . $this->hhh] = $this->setJtableConstructor($viewName_single); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'JTABLECONSTRUCTOR' . $this->hhh] + = $this->setJtableConstructor($viewName_single); // JTABLEALIASCATEGORY <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'JTABLEALIASCATEGORY' . $this->hhh] = $this->setJtableAliasCategory($viewName_single); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'JTABLEALIASCATEGORY' . $this->hhh] + = $this->setJtableAliasCategory($viewName_single); // METHOD_GET_ITEM <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'METHOD_GET_ITEM' . $this->hhh] = $this->setMethodGetItem($viewName_single); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'METHOD_GET_ITEM' . $this->hhh] + = $this->setMethodGetItem($viewName_single); // LINKEDVIEWGLOBAL <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'LINKEDVIEWGLOBAL' . $this->hhh] = ''; + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'LINKEDVIEWGLOBAL' . $this->hhh] + = ''; // LINKEDVIEWMETHODS <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'LINKEDVIEWMETHODS' . $this->hhh] = ''; + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'LINKEDVIEWMETHODS' . $this->hhh] + = ''; // JMODELADMIN_BEFORE_DELETE <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_BEFORE_DELETE' . $this->hhh] = $this->getCustomScriptBuilder('php_before_delete', $viewName_single, PHP_EOL); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'JMODELADMIN_BEFORE_DELETE' . $this->hhh] + = $this->getCustomScriptBuilder( + 'php_before_delete', $viewName_single, PHP_EOL + ); // JMODELADMIN_AFTER_DELETE <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_AFTER_DELETE' . $this->hhh] = $this->getCustomScriptBuilder('php_after_delete', $viewName_single, PHP_EOL . PHP_EOL); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'JMODELADMIN_AFTER_DELETE' . $this->hhh] + = $this->getCustomScriptBuilder( + 'php_after_delete', $viewName_single, PHP_EOL . PHP_EOL + ); // JMODELADMIN_BEFORE_DELETE <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_BEFORE_PUBLISH' . $this->hhh] = $this->getCustomScriptBuilder('php_before_publish', $viewName_single, PHP_EOL); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'JMODELADMIN_BEFORE_PUBLISH' . $this->hhh] + = $this->getCustomScriptBuilder( + 'php_before_publish', $viewName_single, PHP_EOL + ); // JMODELADMIN_AFTER_DELETE <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_AFTER_PUBLISH' . $this->hhh] = $this->getCustomScriptBuilder('php_after_publish', $viewName_single, PHP_EOL . PHP_EOL); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'JMODELADMIN_AFTER_PUBLISH' . $this->hhh] + = $this->getCustomScriptBuilder( + 'php_after_publish', $viewName_single, PHP_EOL . PHP_EOL + ); // CHECKBOX_SAVE <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'CHECKBOX_SAVE' . $this->hhh] = $this->setCheckboxSave($viewName_single); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'CHECKBOX_SAVE' . $this->hhh] + = $this->setCheckboxSave($viewName_single); // METHOD_ITEM_SAVE <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'METHOD_ITEM_SAVE' . $this->hhh] = $this->setMethodItemSave($viewName_single); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'METHOD_ITEM_SAVE' . $this->hhh] + = $this->setMethodItemSave($viewName_single); // POSTSAVEHOOK <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'POSTSAVEHOOK' . $this->hhh] = $this->getCustomScriptBuilder('php_postsavehook', $viewName_single, PHP_EOL, null, true, PHP_EOL . $this->_t(2) . "return;", PHP_EOL . PHP_EOL . $this->_t(2) . "return;"); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'POSTSAVEHOOK' . $this->hhh] + = $this->getCustomScriptBuilder( + 'php_postsavehook', $viewName_single, PHP_EOL, null, + true, PHP_EOL . $this->_t(2) . "return;", + PHP_EOL . PHP_EOL . $this->_t(2) . "return;" + ); // VIEWCSS <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEWCSS' . $this->hhh] = $this->getCustomScriptBuilder('css_view', $viewName_single, '', null, true); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'VIEWCSS' . $this->hhh] + = $this->getCustomScriptBuilder( + 'css_view', $viewName_single, '', null, true + ); // add css to front end - if (isset($view['edit_create_site_view']) && is_numeric($view['edit_create_site_view']) && $view['edit_create_site_view'] > 0) + if (isset($view['edit_create_site_view']) + && is_numeric( + $view['edit_create_site_view'] + ) + && $view['edit_create_site_view'] > 0) { - $this->fileContentDynamic[$viewName_single][$this->hhh . 'SITE_VIEWCSS' . $this->hhh] = $this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEWCSS' . $this->hhh]; + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'SITE_VIEWCSS' . $this->hhh] + = $this->fileContentDynamic[$viewName_single][$this->hhh + . 'VIEWCSS' . $this->hhh]; // check if we should add a create menu if ($view['edit_create_site_view'] == 2) { // SITE_MENU_XML <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'SITE_MENU_XML' . $this->hhh] = $this->setAdminViewMenu($viewName_single, $view); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'SITE_MENU_XML' . $this->hhh] + = $this->setAdminViewMenu( + $viewName_single, $view + ); } } // TABLAYOUTFIELDSARRAY <<>> add the tab layout fields array to the model - $this->fileContentDynamic[$viewName_single][$this->hhh . 'TABLAYOUTFIELDSARRAY' . $this->hhh] = $this->getTabLayoutFieldsArray($viewName_single); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'TABLAYOUTFIELDSARRAY' . $this->hhh] + = $this->getTabLayoutFieldsArray($viewName_single); // Trigger Event: jcb_ce_onAfterBuildAdminEditViewContent - $this->triggerEvent('jcb_ce_onAfterBuildAdminEditViewContent', array(&$this->componentContext, &$view, &$viewName_single, &$viewName_list, &$this->fileContentStatic, &$this->fileContentDynamic[$viewName_single], &$this->placeholders, &$this->hhh)); + $this->triggerEvent( + 'jcb_ce_onAfterBuildAdminEditViewContent', + array(&$this->componentContext, &$view, + &$viewName_single, &$viewName_list, + &$this->fileContentStatic, + &$this->fileContentDynamic[$viewName_single], + &$this->placeholders, &$this->hhh) + ); } // set the views names - if (isset($view['settings']->name_list) && $view['settings']->name_list != 'null') + if (isset($view['settings']->name_list) + && $view['settings']->name_list != 'null') { $this->lang = 'admin'; // ICOMOON <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'ICOMOON' . $this->hhh] = $view['icomoon']; + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'ICOMOON' . $this->hhh] + = $view['icomoon']; // Trigger Event: jcb_ce_onBeforeBuildAdminListViewContent - $this->triggerEvent('jcb_ce_onBeforeBuildAdminListViewContent', array(&$this->componentContext, &$view, &$viewName_single, &$viewName_list, &$this->fileContentStatic, &$this->fileContentDynamic[$viewName_list], &$this->placeholders, &$this->hhh)); + $this->triggerEvent( + 'jcb_ce_onBeforeBuildAdminListViewContent', + array(&$this->componentContext, &$view, + &$viewName_single, &$viewName_list, + &$this->fileContentStatic, + &$this->fileContentDynamic[$viewName_list], + &$this->placeholders, &$this->hhh) + ); // set the export/import option - if (isset($view['port']) && $view['port'] || 1 == $view['settings']->add_custom_import) + if (isset($view['port']) && $view['port'] + || 1 == $view['settings']->add_custom_import) { $this->eximportView[$viewName_list] = true; if (1 == $view['settings']->add_custom_import) @@ -412,99 +676,201 @@ class Infusion extends Interpretation if (isset($view['checkin']) && $view['checkin'] == 1) { // AUTOCHECKIN <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'AUTOCHECKIN' . $this->hhh] = $this->setAutoCheckin($viewName_single, $this->componentCodeName); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'AUTOCHECKIN' . $this->hhh] + = $this->setAutoCheckin( + $viewName_single, $this->componentCodeName + ); // CHECKINCALL <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'CHECKINCALL' . $this->hhh] = $this->setCheckinCall(); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'CHECKINCALL' . $this->hhh] + = $this->setCheckinCall(); } else { // AUTOCHECKIN <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'AUTOCHECKIN' . $this->hhh] = ''; + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'AUTOCHECKIN' . $this->hhh] + = ''; // CHECKINCALL <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'CHECKINCALL' . $this->hhh] = ''; + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'CHECKINCALL' . $this->hhh] + = ''; } // admin list file contnet - $this->fileContentDynamic[$viewName_list][$this->hhh . 'ADMIN_JAVASCRIPT_FILE' . $this->hhh] = $this->setViewScript($viewName_list, 'list_fileScript'); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'ADMIN_JAVASCRIPT_FILE' . $this->hhh] + = $this->setViewScript( + $viewName_list, 'list_fileScript' + ); // ADMIN_CUSTOM_BUTTONS_LIST - $this->fileContentDynamic[$viewName_list][$this->hhh . 'ADMIN_CUSTOM_BUTTONS_LIST' . $this->hhh] = $this->setCustomButtons($view, 3, $this->_t(1)); - $this->fileContentDynamic[$viewName_list][$this->hhh . 'ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST' . $this->hhh] = $this->setFunctionOnlyButtons($viewName_list); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'ADMIN_CUSTOM_BUTTONS_LIST' . $this->hhh] + = $this->setCustomButtons($view, 3, $this->_t(1)); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST' . $this->hhh] + = $this->setFunctionOnlyButtons($viewName_list); // GET_ITEMS_METHOD_STRING_FIX <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'GET_ITEMS_METHOD_STRING_FIX' . $this->hhh] = $this->setGetItemsMethodStringFix($viewName_single, $viewName_list, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'GET_ITEMS_METHOD_STRING_FIX' . $this->hhh] + = $this->setGetItemsMethodStringFix( + $viewName_single, $viewName_list, + $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + ); // GET_ITEMS_METHOD_AFTER_ALL <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'GET_ITEMS_METHOD_AFTER_ALL' . $this->hhh] = $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'GET_ITEMS_METHOD_AFTER_ALL' . $this->hhh] + = $this->getCustomScriptBuilder( + 'php_getitems_after_all', $viewName_single, PHP_EOL + ); // SELECTIONTRANSLATIONFIX <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'SELECTIONTRANSLATIONFIX' . $this->hhh] = $this->setSelectionTranslationFix($viewName_list, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'SELECTIONTRANSLATIONFIX' . $this->hhh] + = $this->setSelectionTranslationFix( + $viewName_list, + $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + ); // SELECTIONTRANSLATIONFIXFUNC <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'SELECTIONTRANSLATIONFIXFUNC' . $this->hhh] = $this->setSelectionTranslationFixFunc($viewName_list, $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh]); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'SELECTIONTRANSLATIONFIXFUNC' . $this->hhh] + = $this->setSelectionTranslationFixFunc( + $viewName_list, + $this->fileContentStatic[$this->hhh . 'Component' + . $this->hhh] + ); // FILTER_FIELDS <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'FILTER_FIELDS' . $this->hhh] = $this->setFilterFields($viewName_list); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'FILTER_FIELDS' . $this->hhh] + = $this->setFilterFields($viewName_list); // STOREDID <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'STOREDID' . $this->hhh] = $this->setStoredId($viewName_list); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'STOREDID' . $this->hhh] + = $this->setStoredId($viewName_list); // POPULATESTATE <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'POPULATESTATE' . $this->hhh] = $this->setPopulateState($viewName_list); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'POPULATESTATE' . $this->hhh] + = $this->setPopulateState($viewName_list); // SORTFIELDS <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'SORTFIELDS' . $this->hhh] = $this->setSortFields($viewName_list); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'SORTFIELDS' . $this->hhh] + = $this->setSortFields($viewName_list); // CATEGORYFILTER <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'CATEGORYFILTER' . $this->hhh] = $this->setCategoryFilter($viewName_list); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'CATEGORYFILTER' . $this->hhh] + = $this->setCategoryFilter($viewName_list); // CATEGORY_VIEWS - if (!isset($this->fileContentStatic[$this->hhh . 'ROUTER_CATEGORY_VIEWS' . $this->hhh])) + if (!isset( + $this->fileContentStatic[$this->hhh + . 'ROUTER_CATEGORY_VIEWS' . $this->hhh] + )) { - $this->fileContentStatic[$this->hhh . 'ROUTER_CATEGORY_VIEWS' . $this->hhh] = ''; + $this->fileContentStatic[$this->hhh + . 'ROUTER_CATEGORY_VIEWS' . $this->hhh] + = ''; } - $this->fileContentStatic[$this->hhh . 'ROUTER_CATEGORY_VIEWS' . $this->hhh] .= $this->setRouterCategoryViews($viewName_single, $viewName_list); + $this->fileContentStatic[$this->hhh + . 'ROUTER_CATEGORY_VIEWS' . $this->hhh] + .= $this->setRouterCategoryViews( + $viewName_single, $viewName_list + ); // OTHERFILTERS <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'OTHERFILTERS' . $this->hhh] = $this->setOtherFilter($viewName_list); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'OTHERFILTERS' . $this->hhh] + = $this->setOtherFilter($viewName_list); // FILTERFUNCTIONS <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'FILTERFUNCTIONS' . $this->hhh] = $this->setFilterFunctions($viewName_single, $viewName_list); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'FILTERFUNCTIONS' . $this->hhh] + = $this->setFilterFunctions( + $viewName_single, $viewName_list + ); // LISTQUERY <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'LISTQUERY' . $this->hhh] = $this->setListQuery($viewName_single, $viewName_list); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'LISTQUERY' . $this->hhh] + = $this->setListQuery($viewName_single, $viewName_list); // MODELEXPORTMETHOD <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'MODELEXPORTMETHOD' . $this->hhh] = $this->setGetItemsModelMethod($viewName_single, $viewName_list); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'MODELEXPORTMETHOD' . $this->hhh] + = $this->setGetItemsModelMethod( + $viewName_single, $viewName_list + ); // MODELEXIMPORTMETHOD <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'CONTROLLEREXIMPORTMETHOD' . $this->hhh] = $this->setControllerEximportMethod($viewName_single, $viewName_list); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'CONTROLLEREXIMPORTMETHOD' . $this->hhh] + = $this->setControllerEximportMethod( + $viewName_single, $viewName_list + ); // EXPORTBUTTON <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'EXPORTBUTTON' . $this->hhh] = $this->setExportButton($viewName_single, $viewName_list); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'EXPORTBUTTON' . $this->hhh] + = $this->setExportButton( + $viewName_single, $viewName_list + ); // IMPORTBUTTON <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'IMPORTBUTTON' . $this->hhh] = $this->setImportButton($viewName_single, $viewName_list); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'IMPORTBUTTON' . $this->hhh] + = $this->setImportButton( + $viewName_single, $viewName_list + ); // LISTHEAD <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'LISTHEAD' . $this->hhh] = $this->setListHead($viewName_single, $viewName_list); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'LISTHEAD' . $this->hhh] + = $this->setListHead($viewName_single, $viewName_list); // LISTBODY <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'LISTBODY' . $this->hhh] = $this->setListBody($viewName_single, $viewName_list); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'LISTBODY' . $this->hhh] + = $this->setListBody($viewName_single, $viewName_list); // LISTCOLNR <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'LISTCOLNR' . $this->hhh] = $this->setListColnr($viewName_list); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'LISTCOLNR' . $this->hhh] + = $this->setListColnr($viewName_list); // JVIEWLISTCANDO <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'JVIEWLISTCANDO' . $this->hhh] = $this->setJviewListCanDo($viewName_single, $viewName_list); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'JVIEWLISTCANDO' . $this->hhh] + = $this->setJviewListCanDo( + $viewName_single, $viewName_list + ); // VIEWSCSS <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'VIEWSCSS' . $this->hhh] = $this->getCustomScriptBuilder('css_views', $viewName_single, '', null, true); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'VIEWSCSS' . $this->hhh] + = $this->getCustomScriptBuilder( + 'css_views', $viewName_single, '', null, true + ); // VIEWS_FOOTER_SCRIPT <<>> - $scriptNote = PHP_EOL . '//' . $this->setLine(__LINE__) . ' ' . $viewName_list . ' footer script'; - if ($footerScript = $this->getCustomScriptBuilder('views_footer', $viewName_single, '', $scriptNote, true, false, PHP_EOL)) + $scriptNote = PHP_EOL . '//' . $this->setLine(__LINE__) + . ' ' . $viewName_list . ' footer script'; + if ($footerScript = $this->getCustomScriptBuilder( + 'views_footer', $viewName_single, '', $scriptNote, true, + false, PHP_EOL + )) { // only minfy if no php is added to the footer script - if ($this->minify && strpos($footerScript, 'minify + && strpos($footerScript, 'fileContentDynamic[$viewName_list][$this->hhh . 'VIEWS_FOOTER_SCRIPT' . $this->hhh] = PHP_EOL . '"; + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'VIEWS_FOOTER_SCRIPT' . $this->hhh] + = PHP_EOL . '"; // clear some memory unset($footerScript); } else { - $this->fileContentDynamic[$viewName_list][$this->hhh . 'VIEWS_FOOTER_SCRIPT' . $this->hhh] = ''; + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'VIEWS_FOOTER_SCRIPT' . $this->hhh] + = ''; } // Trigger Event: jcb_ce_onAfterBuildAdminListViewContent - $this->triggerEvent('jcb_ce_onAfterBuildAdminListViewContent', array(&$this->componentContext, &$view, &$viewName_single, &$viewName_list, &$this->fileContentStatic, &$this->fileContentDynamic[$viewName_list], &$this->placeholders, &$this->hhh)); + $this->triggerEvent( + 'jcb_ce_onAfterBuildAdminListViewContent', + array(&$this->componentContext, &$view, + &$viewName_single, &$viewName_list, + &$this->fileContentStatic, + &$this->fileContentDynamic[$viewName_list], + &$this->placeholders, &$this->hhh) + ); } // set u fields used in batch - $this->fileContentDynamic[$viewName_single][$this->hhh . 'UNIQUEFIELDS' . $this->hhh] = $this->setUniqueFields($viewName_single); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'UNIQUEFIELDS' . $this->hhh] + = $this->setUniqueFields($viewName_single); // TITLEALIASFIX <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'TITLEALIASFIX' . $this->hhh] = $this->setAliasTitleFix($viewName_single); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'TITLEALIASFIX' . $this->hhh] + = $this->setAliasTitleFix($viewName_single); // GENERATENEWTITLE <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'GENERATENEWTITLE' . $this->hhh] = $this->setGenerateNewTitle($viewName_single); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'GENERATENEWTITLE' . $this->hhh] + = $this->setGenerateNewTitle($viewName_single); // GENERATENEWALIAS <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'GENERATENEWALIAS' . $this->hhh] = $this->setGenerateNewAlias($viewName_single); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'GENERATENEWALIAS' . $this->hhh] + = $this->setGenerateNewAlias($viewName_single); // MODEL_BATCH_COPY <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'MODEL_BATCH_COPY' . $this->hhh] = $this->setBatchCopy($viewName_single); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'MODEL_BATCH_COPY' . $this->hhh] + = $this->setBatchCopy($viewName_single); // MODEL_BATCH_MOVE <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'MODEL_BATCH_MOVE' . $this->hhh] = $this->setBatchMove($viewName_single); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'MODEL_BATCH_MOVE' . $this->hhh] + = $this->setBatchMove($viewName_single); // BATCH_ONCLICK_CANCEL_SCRIPT <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'BATCH_ONCLICK_CANCEL_SCRIPT' . $this->hhh] = ''; // TODO <-- must still be build + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'BATCH_ONCLICK_CANCEL_SCRIPT' . $this->hhh] + = ''; // TODO <-- must still be build // JCONTROLLERFORM_ALLOWADD <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'JCONTROLLERFORM_ALLOWADD' . $this->hhh] = $this->setJcontrollerAllowAdd($viewName_single, $viewName_list); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'JCONTROLLERFORM_ALLOWADD' . $this->hhh] + = $this->setJcontrollerAllowAdd( + $viewName_single, $viewName_list + ); // JCONTROLLERFORM_BEFORECANCEL <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'JCONTROLLERFORM_BEFORECANCEL' . $this->hhh] = $this->getCustomScriptBuilder('php_before_cancel', $viewName_single, PHP_EOL, null, null, ''); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'JCONTROLLERFORM_BEFORECANCEL' . $this->hhh] + = $this->getCustomScriptBuilder( + 'php_before_cancel', $viewName_single, PHP_EOL, null, null, + '' + ); // JCONTROLLERFORM_AFTERCANCEL <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'JCONTROLLERFORM_AFTERCANCEL' . $this->hhh] = $this->getCustomScriptBuilder('php_after_cancel', $viewName_single, PHP_EOL, null, null, ''); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'JCONTROLLERFORM_AFTERCANCEL' . $this->hhh] + = $this->getCustomScriptBuilder( + 'php_after_cancel', $viewName_single, PHP_EOL, null, null, + '' + ); // JCONTROLLERFORM_ALLOWEDIT <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'JCONTROLLERFORM_ALLOWEDIT' . $this->hhh] = $this->setJcontrollerAllowEdit($viewName_single, $viewName_list); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'JCONTROLLERFORM_ALLOWEDIT' . $this->hhh] + = $this->setJcontrollerAllowEdit( + $viewName_single, $viewName_list + ); // JMODELADMIN_GETFORM <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_GETFORM' . $this->hhh] = $this->setJmodelAdminGetForm($viewName_single, $viewName_list); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'JMODELADMIN_GETFORM' . $this->hhh] + = $this->setJmodelAdminGetForm( + $viewName_single, $viewName_list + ); // JMODELADMIN_ALLOWEDIT <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_ALLOWEDIT' . $this->hhh] = $this->setJmodelAdminAllowEdit($viewName_single, $viewName_list); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'JMODELADMIN_ALLOWEDIT' . $this->hhh] + = $this->setJmodelAdminAllowEdit( + $viewName_single, $viewName_list + ); // JMODELADMIN_CANDELETE <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_CANDELETE' . $this->hhh] = $this->setJmodelAdminCanDelete($viewName_single, $viewName_list); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'JMODELADMIN_CANDELETE' . $this->hhh] + = $this->setJmodelAdminCanDelete( + $viewName_single, $viewName_list + ); // JMODELADMIN_CANEDITSTATE <<>> - $this->fileContentDynamic[$viewName_single][$this->hhh . 'JMODELADMIN_CANEDITSTATE' . $this->hhh] = $this->setJmodelAdminCanEditState($viewName_single, $viewName_list); + $this->fileContentDynamic[$viewName_single][$this->hhh + . 'JMODELADMIN_CANEDITSTATE' . $this->hhh] + = $this->setJmodelAdminCanEditState( + $viewName_single, $viewName_list + ); // set custom admin view Toolbare buttons // CUSTOM_ADMIN_DYNAMIC_BUTTONS <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'CUSTOM_ADMIN_DYNAMIC_BUTTONS' . $this->hhh] = $this->setCustomAdminDynamicButton($viewName_list); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'CUSTOM_ADMIN_DYNAMIC_BUTTONS' . $this->hhh] + = $this->setCustomAdminDynamicButton($viewName_list); // CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER <<>> - $this->fileContentDynamic[$viewName_list][$this->hhh . 'CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER' . $this->hhh] = $this->setCustomAdminDynamicButtonController($viewName_list); + $this->fileContentDynamic[$viewName_list][$this->hhh + . 'CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER' . $this->hhh] + = $this->setCustomAdminDynamicButtonController( + $viewName_list + ); // set helper router - if (!isset($this->fileContentStatic[$this->hhh . 'ROUTEHELPER' . $this->hhh])) + if (!isset( + $this->fileContentStatic[$this->hhh . 'ROUTEHELPER' + . $this->hhh] + )) { - $this->fileContentStatic[$this->hhh . 'ROUTEHELPER' . $this->hhh] = ''; + $this->fileContentStatic[$this->hhh . 'ROUTEHELPER' + . $this->hhh] + = ''; } - $this->fileContentStatic[$this->hhh . 'ROUTEHELPER' . $this->hhh] .= $this->setRouterHelp($viewName_single, $viewName_list); + $this->fileContentStatic[$this->hhh . 'ROUTEHELPER' + . $this->hhh] + .= $this->setRouterHelp($viewName_single, $viewName_list); - if (isset($view['edit_create_site_view']) && is_numeric($view['edit_create_site_view']) && $view['edit_create_site_view'] > 0) + if (isset($view['edit_create_site_view']) + && is_numeric( + $view['edit_create_site_view'] + ) + && $view['edit_create_site_view'] > 0) { // add needed router stuff for front edit views - $this->fileContentStatic[$this->hhh . 'ROUTER_PARSE_SWITCH' . $this->hhh] .= $this->routerParseSwitch($viewName_single, null, false); - $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh] .= $this->routerBuildViews($viewName_single); + $this->fileContentStatic[$this->hhh . 'ROUTER_PARSE_SWITCH' + . $this->hhh] + .= $this->routerParseSwitch( + $viewName_single, null, false + ); + $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' + . $this->hhh] + .= $this->routerBuildViews($viewName_single); } // ACCESS_SECTIONS - if (!isset($this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' . $this->hhh])) + if (!isset( + $this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' + . $this->hhh] + )) { - $this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' . $this->hhh] = ''; + $this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' + . $this->hhh] + = ''; } - $this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' . $this->hhh] .= $this->setAccessSectionsCategory($viewName_single, $viewName_list); + $this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' + . $this->hhh] + .= $this->setAccessSectionsCategory( + $viewName_single, $viewName_list + ); // set the Joomla Fields ACCESS section if needed - if (isset($view['joomla_fields']) && $view['joomla_fields'] == 1) + if (isset($view['joomla_fields']) + && $view['joomla_fields'] == 1) { - $this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' . $this->hhh] .= $this->setAccessSectionsJoomlaFields(); + $this->fileContentStatic[$this->hhh . 'ACCESS_SECTIONS' + . $this->hhh] + .= $this->setAccessSectionsJoomlaFields(); } // HELPER_EXEL - $this->fileContentStatic[$this->hhh . 'HELPER_EXEL' . $this->hhh] = $this->setExelHelperMethods(); + $this->fileContentStatic[$this->hhh . 'HELPER_EXEL' + . $this->hhh] + = $this->setExelHelperMethods(); // Trigger Event: jcb_ce_onAfterBuildAdminViewContent - $this->triggerEvent('jcb_ce_onAfterBuildAdminViewContent', array(&$this->componentContext, &$view, &$viewName_single, &$viewName_list, &$this->fileContentStatic, &$this->fileContentDynamic, &$this->placeholders, &$this->hhh)); + $this->triggerEvent( + 'jcb_ce_onAfterBuildAdminViewContent', + array(&$this->componentContext, &$view, &$viewName_single, + &$viewName_list, &$this->fileContentStatic, + &$this->fileContentDynamic, &$this->placeholders, + &$this->hhh) + ); } // setup custom_admin_views and all needed stuff for the site - if (isset($this->componentData->custom_admin_views) && ComponentbuilderHelper::checkArray($this->componentData->custom_admin_views)) + if (isset($this->componentData->custom_admin_views) + && ComponentbuilderHelper::checkArray( + $this->componentData->custom_admin_views + )) { $this->target = 'custom_admin'; - $this->lang = 'admin'; + $this->lang = 'admin'; // start dynamic build foreach ($this->componentData->custom_admin_views as $view) { // for single views - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SView' . $this->hhh] = $view['settings']->Code; - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'sview' . $this->hhh] = $view['settings']->code; - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SVIEW' . $this->hhh] = $view['settings']->CODE; + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SView' . $this->hhh] + = $view['settings']->Code; + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'sview' . $this->hhh] + = $view['settings']->code; + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SVIEW' . $this->hhh] + = $view['settings']->CODE; // for list views - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SViews' . $this->hhh] = $view['settings']->Code; - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'sviews' . $this->hhh] = $view['settings']->code; - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SVIEWS' . $this->hhh] = $view['settings']->CODE; + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SViews' . $this->hhh] + = $view['settings']->Code; + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'sviews' . $this->hhh] + = $view['settings']->code; + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SVIEWS' . $this->hhh] + = $view['settings']->CODE; // add to lang array - $this->setLangContent($this->lang, $this->langPrefix . '_' . $view['settings']->CODE, $view['settings']->name); - $this->setLangContent($this->lang, $this->langPrefix . '_' . $view['settings']->CODE . '_DESC', $view['settings']->description); + $this->setLangContent( + $this->lang, + $this->langPrefix . '_' . $view['settings']->CODE, + $view['settings']->name + ); + $this->setLangContent( + $this->lang, + $this->langPrefix . '_' . $view['settings']->CODE + . '_DESC', $view['settings']->description + ); // ICOMOON <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'ICOMOON' . $this->hhh] = $view['icomoon']; + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'ICOMOON' . $this->hhh] + = $view['icomoon']; // set placeholders - $this->placeholders[$this->hhh . 'SView' . $this->hhh] = $view['settings']->Code; - $this->placeholders[$this->hhh . 'sview' . $this->hhh] = $view['settings']->code; - $this->placeholders[$this->hhh . 'SVIEW' . $this->hhh] = $view['settings']->CODE; - $this->placeholders[$this->bbb . 'SView' . $this->ddd] = $view['settings']->Code; - $this->placeholders[$this->bbb . 'sview' . $this->ddd] = $view['settings']->code; - $this->placeholders[$this->bbb . 'SVIEW' . $this->ddd] = $view['settings']->CODE; - $this->placeholders[$this->hhh . 'SViews' . $this->hhh] = $view['settings']->Code; - $this->placeholders[$this->hhh . 'sviews' . $this->hhh] = $view['settings']->code; - $this->placeholders[$this->hhh . 'SVIEWS' . $this->hhh] = $view['settings']->CODE; - $this->placeholders[$this->bbb . 'SViews' . $this->ddd] = $view['settings']->Code; - $this->placeholders[$this->bbb . 'sviews' . $this->ddd] = $view['settings']->code; - $this->placeholders[$this->bbb . 'SVIEWS' . $this->ddd] = $view['settings']->CODE; + $this->placeholders[$this->hhh . 'SView' . $this->hhh] + = $view['settings']->Code; + $this->placeholders[$this->hhh . 'sview' . $this->hhh] + = $view['settings']->code; + $this->placeholders[$this->hhh . 'SVIEW' . $this->hhh] + = $view['settings']->CODE; + $this->placeholders[$this->bbb . 'SView' . $this->ddd] + = $view['settings']->Code; + $this->placeholders[$this->bbb . 'sview' . $this->ddd] + = $view['settings']->code; + $this->placeholders[$this->bbb . 'SVIEW' . $this->ddd] + = $view['settings']->CODE; + $this->placeholders[$this->hhh . 'SViews' . $this->hhh] + = $view['settings']->Code; + $this->placeholders[$this->hhh . 'sviews' . $this->hhh] + = $view['settings']->code; + $this->placeholders[$this->hhh . 'SVIEWS' . $this->hhh] + = $view['settings']->CODE; + $this->placeholders[$this->bbb . 'SViews' . $this->ddd] + = $view['settings']->Code; + $this->placeholders[$this->bbb . 'sviews' . $this->ddd] + = $view['settings']->code; + $this->placeholders[$this->bbb . 'SVIEWS' . $this->ddd] + = $view['settings']->CODE; // Trigger Event: jcb_ce_onBeforeBuildCustomAdminViewContent - $this->triggerEvent('jcb_ce_onBeforeBuildCustomAdminViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, &$this->fileContentStatic, &$this->fileContentDynamic[$view['settings']->code], &$this->placeholders, &$this->hhh)); + $this->triggerEvent( + 'jcb_ce_onBeforeBuildCustomAdminViewContent', + array(&$this->componentContext, &$view, + &$view['settings']->code, + &$this->fileContentStatic, + &$this->fileContentDynamic[$view['settings']->code], + &$this->placeholders, &$this->hhh) + ); // set license per view if needed - $this->setLockLicensePer($view['settings']->code, $this->target); + $this->setLockLicensePer( + $view['settings']->code, $this->target + ); if ($view['settings']->main_get->gettype == 1) { // CUSTOM_ADMIN_BEFORE_GET_ITEM <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_BEFORE_GET_ITEM' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_before_getitem', $view['settings']->code, '', null, true); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'CUSTOM_ADMIN_BEFORE_GET_ITEM' . $this->hhh] + = $this->getCustomScriptBuilder( + $this->target . '_php_before_getitem', + $view['settings']->code, '', null, true + ); // CUSTOM_ADMIN_GET_ITEM <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_GET_ITEM' . $this->hhh] = $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code, $this->_t(2)); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'CUSTOM_ADMIN_GET_ITEM' . $this->hhh] + = $this->setCustomViewGetItem( + $view['settings']->main_get, + $view['settings']->code, $this->_t(2) + ); // CUSTOM_ADMIN_AFTER_GET_ITEM <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_AFTER_GET_ITEM' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_after_getitem', $view['settings']->code, '', null, true); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'CUSTOM_ADMIN_AFTER_GET_ITEM' . $this->hhh] + = $this->getCustomScriptBuilder( + $this->target . '_php_after_getitem', + $view['settings']->code, '', null, true + ); } elseif ($view['settings']->main_get->gettype == 2) { // CUSTOM_ADMIN_GET_LIST_QUERY <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_GET_LIST_QUERY' . $this->hhh] = $this->setCustomViewListQuery($view['settings']->main_get, $view['settings']->code); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'CUSTOM_ADMIN_GET_LIST_QUERY' . $this->hhh] + = $this->setCustomViewListQuery( + $view['settings']->main_get, $view['settings']->code + ); // CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_getlistquery', $view['settings']->code, PHP_EOL, null, true); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY' . $this->hhh] + = $this->getCustomScriptBuilder( + $this->target . '_php_getlistquery', + $view['settings']->code, PHP_EOL, null, true + ); // CUSTOM_ADMIN_BEFORE_GET_ITEMS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_BEFORE_GET_ITEMS' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_before_getitems', $view['settings']->code, PHP_EOL, null, true); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'CUSTOM_ADMIN_BEFORE_GET_ITEMS' . $this->hhh] + = $this->getCustomScriptBuilder( + $this->target . '_php_before_getitems', + $view['settings']->code, PHP_EOL, null, true + ); // CUSTOM_ADMIN_GET_ITEMS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_GET_ITEMS' . $this->hhh] = $this->setCustomViewGetItems($view['settings']->main_get, $view['settings']->code); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'CUSTOM_ADMIN_GET_ITEMS' . $this->hhh] + = $this->setCustomViewGetItems( + $view['settings']->main_get, $view['settings']->code + ); // CUSTOM_ADMIN_AFTER_GET_ITEMS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_AFTER_GET_ITEMS' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_after_getitems', $view['settings']->code, PHP_EOL, null, true); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'CUSTOM_ADMIN_AFTER_GET_ITEMS' . $this->hhh] + = $this->getCustomScriptBuilder( + $this->target . '_php_after_getitems', + $view['settings']->code, PHP_EOL, null, true + ); } // CUSTOM_ADMIN_CUSTOM_METHODS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_CUSTOM_METHODS' . $this->hhh] = $this->setCustomViewCustomItemMethods($view['settings']->main_get, $view['settings']->code); - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_CUSTOM_METHODS' . $this->hhh] .= $this->setCustomViewCustomMethods($view, $view['settings']->code); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'CUSTOM_ADMIN_CUSTOM_METHODS' . $this->hhh] + = $this->setCustomViewCustomItemMethods( + $view['settings']->main_get, $view['settings']->code + ); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'CUSTOM_ADMIN_CUSTOM_METHODS' . $this->hhh] + .= $this->setCustomViewCustomMethods( + $view, $view['settings']->code + ); // CUSTOM_ADMIN_DIPLAY_METHOD <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_DIPLAY_METHOD' . $this->hhh] = $this->setCustomViewDisplayMethod($view); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'CUSTOM_ADMIN_DIPLAY_METHOD' . $this->hhh] + = $this->setCustomViewDisplayMethod($view); // set document details $this->setPrepareDocument($view); // CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS' . $this->hhh] = $this->setCustomViewExtraDisplayMethods($view); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS' . $this->hhh] + = $this->setCustomViewExtraDisplayMethods($view); // CUSTOM_ADMIN_CODE_BODY <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_CODE_BODY' . $this->hhh] = $this->setCustomViewCodeBody($view); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'CUSTOM_ADMIN_CODE_BODY' . $this->hhh] + = $this->setCustomViewCodeBody($view); // CUSTOM_ADMIN_BODY <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_BODY' . $this->hhh] = $this->setCustomViewBody($view); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'CUSTOM_ADMIN_BODY' . $this->hhh] + = $this->setCustomViewBody($view); // CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT' . $this->hhh] = $this->setCustomViewSubmitButtonScript($view); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT' . $this->hhh] + = $this->setCustomViewSubmitButtonScript($view); // setup the templates $this->setCustomViewTemplateBody($view); // set the site form if needed - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_TOP_FORM' . $this->hhh] = $this->setCustomViewForm($view['settings']->code, $view['settings']->main_get->gettype, 1); - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_BOTTOM_FORM' . $this->hhh] = $this->setCustomViewForm($view['settings']->code, $view['settings']->main_get->gettype, 2); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'CUSTOM_ADMIN_TOP_FORM' . $this->hhh] + = $this->setCustomViewForm( + $view['settings']->code, + $view['settings']->main_get->gettype, 1 + ); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'CUSTOM_ADMIN_BOTTOM_FORM' . $this->hhh] + = $this->setCustomViewForm( + $view['settings']->code, + $view['settings']->main_get->gettype, 2 + ); // Trigger Event: jcb_ce_onAfterBuildCustomAdminViewContent - $this->triggerEvent('jcb_ce_onAfterBuildCustomAdminViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, &$this->fileContentStatic, &$this->fileContentDynamic[$view['settings']->code], &$this->placeholders, &$this->hhh)); + $this->triggerEvent( + 'jcb_ce_onAfterBuildCustomAdminViewContent', + array(&$this->componentContext, &$view, + &$view['settings']->code, + &$this->fileContentStatic, + &$this->fileContentDynamic[$view['settings']->code], + &$this->placeholders, &$this->hhh) + ); } // setup the layouts @@ -712,31 +1300,40 @@ class Infusion extends Interpretation } // VIEWARRAY - $this->fileContentStatic[$this->hhh . 'VIEWARRAY' . $this->hhh] = PHP_EOL . implode("," . PHP_EOL, $viewarray); + $this->fileContentStatic[$this->hhh . 'VIEWARRAY' . $this->hhh] + = PHP_EOL . implode("," . PHP_EOL, $viewarray); // CUSTOM_ADMIN_EDIT_VIEW_ARRAY - $this->fileContentStatic[$this->hhh . 'SITE_EDIT_VIEW_ARRAY' . $this->hhh] = PHP_EOL . implode("," . PHP_EOL, $site_edit_view_array); + $this->fileContentStatic[$this->hhh . 'SITE_EDIT_VIEW_ARRAY' + . $this->hhh] + = PHP_EOL . implode("," . PHP_EOL, $site_edit_view_array); // MAINMENUS - $this->fileContentStatic[$this->hhh . 'MAINMENUS' . $this->hhh] = $this->setMainMenus(); + $this->fileContentStatic[$this->hhh . 'MAINMENUS' . $this->hhh] + = $this->setMainMenus(); // SUBMENU - $this->fileContentStatic[$this->hhh . 'SUBMENU' . $this->hhh] = $this->setSubMenus(); + $this->fileContentStatic[$this->hhh . 'SUBMENU' . $this->hhh] + = $this->setSubMenus(); // GET_CRYPT_KEY - $this->fileContentStatic[$this->hhh . 'GET_CRYPT_KEY' . $this->hhh] = $this->setGetCryptKey(); + $this->fileContentStatic[$this->hhh . 'GET_CRYPT_KEY' . $this->hhh] + = $this->setGetCryptKey(); // set the license locker $this->setLockLicense(); // CONTRIBUTORS - $this->fileContentStatic[$this->hhh . 'CONTRIBUTORS' . $this->hhh] = $this->theContributors; + $this->fileContentStatic[$this->hhh . 'CONTRIBUTORS' . $this->hhh] + = $this->theContributors; // INSTALL - $this->fileContentStatic[$this->hhh . 'INSTALL' . $this->hhh] = $this->setInstall(); + $this->fileContentStatic[$this->hhh . 'INSTALL' . $this->hhh] + = $this->setInstall(); // UNINSTALL - $this->fileContentStatic[$this->hhh . 'UNINSTALL' . $this->hhh] = $this->setUninstall(); + $this->fileContentStatic[$this->hhh . 'UNINSTALL' . $this->hhh] + = $this->setUninstall(); // UPDATE_VERSION_MYSQL $this->setVersionController(); @@ -745,27 +1342,41 @@ class Infusion extends Interpretation if (!ComponentbuilderHelper::checkString($this->dynamicDashboard)) { // DASHBOARDVIEW - $this->fileContentStatic[$this->hhh . 'DASHBOARDVIEW' . $this->hhh] = $this->componentCodeName; + $this->fileContentStatic[$this->hhh . 'DASHBOARDVIEW' + . $this->hhh] + = $this->componentCodeName; // DASHBOARDICONS - $this->fileContentDynamic[$this->componentCodeName][$this->hhh . 'DASHBOARDICONS' . $this->hhh] = $this->setDashboardIcons(); + $this->fileContentDynamic[$this->componentCodeName][$this->hhh + . 'DASHBOARDICONS' . $this->hhh] + = $this->setDashboardIcons(); // DASHBOARDICONACCESS - $this->fileContentDynamic[$this->componentCodeName][$this->hhh . 'DASHBOARDICONACCESS' . $this->hhh] = $this->setDashboardIconAccess(); + $this->fileContentDynamic[$this->componentCodeName][$this->hhh + . 'DASHBOARDICONACCESS' . $this->hhh] + = $this->setDashboardIconAccess(); // DASH_MODEL_METHODS - $this->fileContentDynamic[$this->componentCodeName][$this->hhh . 'DASH_MODEL_METHODS' . $this->hhh] = $this->setDashboardModelMethods(); + $this->fileContentDynamic[$this->componentCodeName][$this->hhh + . 'DASH_MODEL_METHODS' . $this->hhh] + = $this->setDashboardModelMethods(); // DASH_GET_CUSTOM_DATA - $this->fileContentDynamic[$this->componentCodeName][$this->hhh . 'DASH_GET_CUSTOM_DATA' . $this->hhh] = $this->setDashboardGetCustomData(); + $this->fileContentDynamic[$this->componentCodeName][$this->hhh + . 'DASH_GET_CUSTOM_DATA' . $this->hhh] + = $this->setDashboardGetCustomData(); // DASH_DISPLAY_DATA - $this->fileContentDynamic[$this->componentCodeName][$this->hhh . 'DASH_DISPLAY_DATA' . $this->hhh] = $this->setDashboardDisplayData(); + $this->fileContentDynamic[$this->componentCodeName][$this->hhh + . 'DASH_DISPLAY_DATA' . $this->hhh] + = $this->setDashboardDisplayData(); } else { // DASHBOARDVIEW - $this->fileContentStatic[$this->hhh . 'DASHBOARDVIEW' . $this->hhh] = $this->dynamicDashboard; + $this->fileContentStatic[$this->hhh . 'DASHBOARDVIEW' + . $this->hhh] + = $this->dynamicDashboard; } // add import @@ -775,7 +1386,9 @@ class Infusion extends Interpretation $target = array('admin' => 'import'); $this->buildDynamique($target, 'import'); // set the controller - $this->fileContentDynamic['import'][$this->hhh . 'BLABLABLA' . $this->hhh] = ''; + $this->fileContentDynamic['import'][$this->hhh . 'BLABLABLA' + . $this->hhh] + = ''; } // ensure that the ajax model and controller is set if needed @@ -785,10 +1398,16 @@ class Infusion extends Interpretation $target = array('admin' => 'ajax'); $this->buildDynamique($target, 'ajax'); // set the controller - $this->fileContentDynamic['ajax'][$this->hhh . 'REGISTER_AJAX_TASK' . $this->hhh] = $this->setRegisterAjaxTask('admin'); - $this->fileContentDynamic['ajax'][$this->hhh . 'AJAX_INPUT_RETURN' . $this->hhh] = $this->setAjaxInputReturn('admin'); + $this->fileContentDynamic['ajax'][$this->hhh + . 'REGISTER_AJAX_TASK' . $this->hhh] + = $this->setRegisterAjaxTask('admin'); + $this->fileContentDynamic['ajax'][$this->hhh + . 'AJAX_INPUT_RETURN' . $this->hhh] + = $this->setAjaxInputReturn('admin'); // set the module - $this->fileContentDynamic['ajax'][$this->hhh . 'AJAX_MODEL_METHODS' . $this->hhh] = $this->setAjaxModelMethods('admin'); + $this->fileContentDynamic['ajax'][$this->hhh + . 'AJAX_MODEL_METHODS' . $this->hhh] + = $this->setAjaxModelMethods('admin'); } // ensure that the site ajax model and controller is set if needed @@ -798,14 +1417,21 @@ class Infusion extends Interpretation $target = array('site' => 'ajax'); $this->buildDynamique($target, 'ajax'); // set the controller - $this->fileContentDynamic['ajax'][$this->hhh . 'REGISTER_SITE_AJAX_TASK' . $this->hhh] = $this->setRegisterAjaxTask('site'); - $this->fileContentDynamic['ajax'][$this->hhh . 'AJAX_SITE_INPUT_RETURN' . $this->hhh] = $this->setAjaxInputReturn('site'); + $this->fileContentDynamic['ajax'][$this->hhh + . 'REGISTER_SITE_AJAX_TASK' . $this->hhh] + = $this->setRegisterAjaxTask('site'); + $this->fileContentDynamic['ajax'][$this->hhh + . 'AJAX_SITE_INPUT_RETURN' . $this->hhh] + = $this->setAjaxInputReturn('site'); // set the module - $this->fileContentDynamic['ajax'][$this->hhh . 'AJAX_SITE_MODEL_METHODS' . $this->hhh] = $this->setAjaxModelMethods('site'); + $this->fileContentDynamic['ajax'][$this->hhh + . 'AJAX_SITE_MODEL_METHODS' . $this->hhh] + = $this->setAjaxModelMethods('site'); } // build the validation rules - if (isset($this->validationRules) && ComponentbuilderHelper::checkArray($this->validationRules)) + if (isset($this->validationRules) + && ComponentbuilderHelper::checkArray($this->validationRules)) { foreach ($this->validationRules as $rule => $_php) { @@ -813,19 +1439,25 @@ class Infusion extends Interpretation $target = array('admin' => 'a_rule_zi'); $this->buildDynamique($target, 'rule', $rule); // set the JFormRule Name - $this->fileContentDynamic['a_rule_zi_' . $rule][$this->hhh . 'Name' . $this->hhh] = ucfirst($rule); + $this->fileContentDynamic['a_rule_zi_' . $rule][$this->hhh + . 'Name' . $this->hhh] + = ucfirst($rule); // set the JFormRule PHP - $this->fileContentDynamic['a_rule_zi_' . $rule][$this->hhh . 'VALIDATION_RULE_METHODS' . $this->hhh] = PHP_EOL . $_php; + $this->fileContentDynamic['a_rule_zi_' . $rule][$this->hhh + . 'VALIDATION_RULE_METHODS' . $this->hhh] + = PHP_EOL . $_php; } } // run the second run if needed - if (isset($this->secondRunAdmin) && ComponentbuilderHelper::checkArray($this->secondRunAdmin)) + if (isset($this->secondRunAdmin) + && ComponentbuilderHelper::checkArray($this->secondRunAdmin)) { // start dynamic build foreach ($this->secondRunAdmin as $function => $arrays) { - if (ComponentbuilderHelper::checkArray($arrays) && ComponentbuilderHelper::checkString($function)) + if (ComponentbuilderHelper::checkArray($arrays) + && ComponentbuilderHelper::checkString($function)) { foreach ($arrays as $array) { @@ -836,120 +1468,245 @@ class Infusion extends Interpretation } // CONFIG_FIELDSETS - $keepLang = $this->lang; + $keepLang = $this->lang; $this->lang = 'admin'; // run field sets for second time $this->setConfigFieldsets(2); $this->lang = $keepLang; // setup front-views and all needed stuff for the site - if (isset($this->componentData->site_views) && ComponentbuilderHelper::checkArray($this->componentData->site_views)) + if (isset($this->componentData->site_views) + && ComponentbuilderHelper::checkArray( + $this->componentData->site_views + )) { $this->target = 'site'; // start dynamic build foreach ($this->componentData->site_views as $view) { // for list views - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SViews' . $this->hhh] = $view['settings']->Code; - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'sviews' . $this->hhh] = $view['settings']->code; + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SViews' . $this->hhh] + = $view['settings']->Code; + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'sviews' . $this->hhh] + = $view['settings']->code; // for single views - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SView' . $this->hhh] = $view['settings']->Code; - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'sview' . $this->hhh] = $view['settings']->code; + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SView' . $this->hhh] + = $view['settings']->Code; + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'sview' . $this->hhh] + = $view['settings']->code; // set placeholder - $this->placeholders[$this->hhh . 'SView' . $this->hhh] = $view['settings']->Code; - $this->placeholders[$this->hhh . 'sview' . $this->hhh] = $view['settings']->code; - $this->placeholders[$this->hhh . 'SVIEW' . $this->hhh] = $view['settings']->CODE; - $this->placeholders[$this->bbb . 'SView' . $this->ddd] = $view['settings']->Code; - $this->placeholders[$this->bbb . 'sview' . $this->ddd] = $view['settings']->code; - $this->placeholders[$this->bbb . 'SVIEW' . $this->ddd] = $view['settings']->CODE; - $this->placeholders[$this->hhh . 'SViews' . $this->hhh] = $view['settings']->Code; - $this->placeholders[$this->hhh . 'sviews' . $this->hhh] = $view['settings']->code; - $this->placeholders[$this->hhh . 'SVIEWS' . $this->hhh] = $view['settings']->CODE; - $this->placeholders[$this->bbb . 'SViews' . $this->ddd] = $view['settings']->Code; - $this->placeholders[$this->bbb . 'sviews' . $this->ddd] = $view['settings']->code; - $this->placeholders[$this->bbb . 'SVIEWS' . $this->ddd] = $view['settings']->CODE; + $this->placeholders[$this->hhh . 'SView' . $this->hhh] + = $view['settings']->Code; + $this->placeholders[$this->hhh . 'sview' . $this->hhh] + = $view['settings']->code; + $this->placeholders[$this->hhh . 'SVIEW' . $this->hhh] + = $view['settings']->CODE; + $this->placeholders[$this->bbb . 'SView' . $this->ddd] + = $view['settings']->Code; + $this->placeholders[$this->bbb . 'sview' . $this->ddd] + = $view['settings']->code; + $this->placeholders[$this->bbb . 'SVIEW' . $this->ddd] + = $view['settings']->CODE; + $this->placeholders[$this->hhh . 'SViews' . $this->hhh] + = $view['settings']->Code; + $this->placeholders[$this->hhh . 'sviews' . $this->hhh] + = $view['settings']->code; + $this->placeholders[$this->hhh . 'SVIEWS' . $this->hhh] + = $view['settings']->CODE; + $this->placeholders[$this->bbb . 'SViews' . $this->ddd] + = $view['settings']->Code; + $this->placeholders[$this->bbb . 'sviews' . $this->ddd] + = $view['settings']->code; + $this->placeholders[$this->bbb . 'SVIEWS' . $this->ddd] + = $view['settings']->CODE; // Trigger Event: jcb_ce_onBeforeBuildSiteViewContent - $this->triggerEvent('jcb_ce_onBeforeBuildSiteViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, &$this->fileContentStatic, &$this->fileContentDynamic[$view['settings']->code], &$this->placeholders, &$this->hhh)); + $this->triggerEvent( + 'jcb_ce_onBeforeBuildSiteViewContent', + array(&$this->componentContext, &$view, + &$view['settings']->code, + &$this->fileContentStatic, + &$this->fileContentDynamic[$view['settings']->code], + &$this->placeholders, &$this->hhh) + ); // set license per view if needed - $this->setLockLicensePer($view['settings']->code, $this->target); + $this->setLockLicensePer( + $view['settings']->code, $this->target + ); // set the site default view - if (isset($view['default_view']) && $view['default_view'] == 1) + if (isset($view['default_view']) + && $view['default_view'] == 1) { - $this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' . $this->hhh] = $view['settings']->code; + $this->fileContentStatic[$this->hhh + . 'SITE_DEFAULT_VIEW' . $this->hhh] + = $view['settings']->code; } // add site menu if (isset($view['menu']) && $view['menu'] == 1) { // SITE_MENU_XML <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_MENU_XML' . $this->hhh] = $this->setCustomViewMenu($view); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SITE_MENU_XML' . $this->hhh] + = $this->setCustomViewMenu($view); } // insure the needed route helper is loaded - $this->fileContentStatic[$this->hhh . 'ROUTEHELPER' . $this->hhh] .= $this->setRouterHelp($view['settings']->code, $view['settings']->code, true); + $this->fileContentStatic[$this->hhh . 'ROUTEHELPER' + . $this->hhh] + .= $this->setRouterHelp( + $view['settings']->code, $view['settings']->code, true + ); // build route details - $this->fileContentStatic[$this->hhh . 'ROUTER_PARSE_SWITCH' . $this->hhh] .= $this->routerParseSwitch($view['settings']->code, $view); - $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh] .= $this->routerBuildViews($view['settings']->code); + $this->fileContentStatic[$this->hhh . 'ROUTER_PARSE_SWITCH' + . $this->hhh] + .= $this->routerParseSwitch( + $view['settings']->code, $view + ); + $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' + . $this->hhh] + .= $this->routerBuildViews($view['settings']->code); if ($view['settings']->main_get->gettype == 1) { // set user permission access check USER_PERMISSION_CHECK_ACCESS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'USER_PERMISSION_CHECK_ACCESS' . $this->hhh] = $this->setUserPermissionCheckAccess($view, 1); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'USER_PERMISSION_CHECK_ACCESS' . $this->hhh] + = $this->setUserPermissionCheckAccess($view, 1); // SITE_BEFORE_GET_ITEM <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_BEFORE_GET_ITEM' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_before_getitem', $view['settings']->code, '', null, true); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SITE_BEFORE_GET_ITEM' . $this->hhh] + = $this->getCustomScriptBuilder( + $this->target . '_php_before_getitem', + $view['settings']->code, '', null, true + ); // SITE_GET_ITEM <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_GET_ITEM' . $this->hhh] = $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code, $this->_t(2)); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SITE_GET_ITEM' . $this->hhh] + = $this->setCustomViewGetItem( + $view['settings']->main_get, + $view['settings']->code, $this->_t(2) + ); // SITE_AFTER_GET_ITEM <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_AFTER_GET_ITEM' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_after_getitem', $view['settings']->code, '', null, true); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SITE_AFTER_GET_ITEM' . $this->hhh] + = $this->getCustomScriptBuilder( + $this->target . '_php_after_getitem', + $view['settings']->code, '', null, true + ); } elseif ($view['settings']->main_get->gettype == 2) { // set user permission access check USER_PERMISSION_CHECK_ACCESS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'USER_PERMISSION_CHECK_ACCESS' . $this->hhh] = $this->setUserPermissionCheckAccess($view, 2); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'USER_PERMISSION_CHECK_ACCESS' . $this->hhh] + = $this->setUserPermissionCheckAccess($view, 2); // SITE_GET_LIST_QUERY <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_GET_LIST_QUERY' . $this->hhh] = $this->setCustomViewListQuery($view['settings']->main_get, $view['settings']->code); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SITE_GET_LIST_QUERY' . $this->hhh] + = $this->setCustomViewListQuery( + $view['settings']->main_get, $view['settings']->code + ); // SITE_BEFORE_GET_ITEMS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_BEFORE_GET_ITEMS' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_before_getitems', $view['settings']->code, PHP_EOL, null, true); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SITE_BEFORE_GET_ITEMS' . $this->hhh] + = $this->getCustomScriptBuilder( + $this->target . '_php_before_getitems', + $view['settings']->code, PHP_EOL, null, true + ); // SITE_GET_ITEMS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_GET_ITEMS' . $this->hhh] = $this->setCustomViewGetItems($view['settings']->main_get, $view['settings']->code); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SITE_GET_ITEMS' . $this->hhh] + = $this->setCustomViewGetItems( + $view['settings']->main_get, $view['settings']->code + ); // SITE_AFTER_GET_ITEMS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_AFTER_GET_ITEMS' . $this->hhh] = $this->getCustomScriptBuilder($this->target . '_php_after_getitems', $view['settings']->code, PHP_EOL, null, true); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SITE_AFTER_GET_ITEMS' . $this->hhh] + = $this->getCustomScriptBuilder( + $this->target . '_php_after_getitems', + $view['settings']->code, PHP_EOL, null, true + ); } // add to lang array - $this->setLangContent('site', $this->langPrefix . '_' . $view['settings']->CODE, $view['settings']->name); - $this->setLangContent('site', $this->langPrefix . '_' . $view['settings']->CODE . '_DESC', $view['settings']->description); + $this->setLangContent( + 'site', + $this->langPrefix . '_' . $view['settings']->CODE, + $view['settings']->name + ); + $this->setLangContent( + 'site', + $this->langPrefix . '_' . $view['settings']->CODE + . '_DESC', $view['settings']->description + ); // SITE_CUSTOM_METHODS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_CUSTOM_METHODS' . $this->hhh] = $this->setCustomViewCustomItemMethods($view['settings']->main_get, $view['settings']->code); - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_CUSTOM_METHODS' . $this->hhh] .= $this->setCustomViewCustomMethods($view, $view['settings']->code); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SITE_CUSTOM_METHODS' . $this->hhh] + = $this->setCustomViewCustomItemMethods( + $view['settings']->main_get, $view['settings']->code + ); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SITE_CUSTOM_METHODS' . $this->hhh] + .= $this->setCustomViewCustomMethods( + $view, $view['settings']->code + ); // SITE_DIPLAY_METHOD <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_DIPLAY_METHOD' . $this->hhh] = $this->setCustomViewDisplayMethod($view); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SITE_DIPLAY_METHOD' . $this->hhh] + = $this->setCustomViewDisplayMethod($view); // set document details $this->setPrepareDocument($view); // SITE_EXTRA_DIPLAY_METHODS <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_EXTRA_DIPLAY_METHODS' . $this->hhh] = $this->setCustomViewExtraDisplayMethods($view); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SITE_EXTRA_DIPLAY_METHODS' . $this->hhh] + = $this->setCustomViewExtraDisplayMethods($view); // SITE_CODE_BODY <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_CODE_BODY' . $this->hhh] = $this->setCustomViewCodeBody($view); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SITE_CODE_BODY' . $this->hhh] + = $this->setCustomViewCodeBody($view); // SITE_BODY <<>> - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_BODY' . $this->hhh] = $this->setCustomViewBody($view); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SITE_BODY' . $this->hhh] + = $this->setCustomViewBody($view); // setup the templates $this->setCustomViewTemplateBody($view); - + // set the site form if needed - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_TOP_FORM' . $this->hhh] = $this->setCustomViewForm($view['settings']->code, $view['settings']->main_get->gettype, 1); - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_BOTTOM_FORM' . $this->hhh] = $this->setCustomViewForm($view['settings']->code, $view['settings']->main_get->gettype, 2); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SITE_TOP_FORM' . $this->hhh] + = $this->setCustomViewForm( + $view['settings']->code, + $view['settings']->main_get->gettype, 1 + ); + $this->fileContentDynamic[$view['settings']->code][$this->hhh + . 'SITE_BOTTOM_FORM' . $this->hhh] + = $this->setCustomViewForm( + $view['settings']->code, + $view['settings']->main_get->gettype, 2 + ); // Trigger Event: jcb_ce_onAfterBuildSiteViewContent - $this->triggerEvent('jcb_ce_onAfterBuildSiteViewContent', array(&$this->componentContext, &$view, &$view['settings']->code, &$this->fileContentStatic, &$this->fileContentDynamic[$view['settings']->code], &$this->placeholders, &$this->hhh)); + $this->triggerEvent( + 'jcb_ce_onAfterBuildSiteViewContent', + array(&$this->componentContext, &$view, + &$view['settings']->code, + &$this->fileContentStatic, + &$this->fileContentDynamic[$view['settings']->code], + &$this->placeholders, &$this->hhh) + ); } // setup the layouts $this->setCustomViewLayouts(); @@ -964,79 +1721,152 @@ class Infusion extends Interpretation { $this->target = 'site'; // if no default site view was set, the redirect to root - if (!isset($this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' . $this->hhh])) + if (!isset( + $this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' + . $this->hhh] + )) { - $this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' . $this->hhh] = ''; + $this->fileContentStatic[$this->hhh . 'SITE_DEFAULT_VIEW' + . $this->hhh] + = ''; } // set site custom script to helper class // SITE_CUSTOM_HELPER_SCRIPT - $this->fileContentStatic[$this->hhh . 'SITE_CUSTOM_HELPER_SCRIPT' . $this->hhh] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_site'], $this->placeholders); + $this->fileContentStatic[$this->hhh + . 'SITE_CUSTOM_HELPER_SCRIPT' . $this->hhh] + = $this->setPlaceholders( + $this->customScriptBuilder['component_php_helper_site'], + $this->placeholders + ); // SITE_GLOBAL_EVENT_HELPER - $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] = ''; + $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' + . $this->hhh] + = ''; // SITE_GLOBAL_EVENT - $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT' . $this->hhh] = ''; + $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT' + . $this->hhh] + = ''; // now load the data for the global event if needed if ($this->componentData->add_site_event == 1) { - $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT' . $this->hhh] = PHP_EOL . PHP_EOL . '// Triger the Global Site Event'; - $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT' . $this->hhh] .= PHP_EOL . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . 'Helper::globalEvent($document);'; + $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT' + . $this->hhh] + = PHP_EOL . PHP_EOL . '// Triger the Global Site Event'; + $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT' + . $this->hhh] + .= PHP_EOL . $this->fileContentStatic[$this->hhh + . 'Component' . $this->hhh] + . 'Helper::globalEvent($document);'; // SITE_GLOBAL_EVENT_HELPER - $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] = PHP_EOL . PHP_EOL . $this->_t(1) . '/**'; - $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '* The Global Site Event Method.'; - $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '**/'; - $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . 'public static function globalEvent($document)'; - $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '{'; - $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->setPlaceholders($this->customScriptBuilder['component_php_site_event'], $this->placeholders); - $this->fileContentStatic[$this->hhh . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] .= PHP_EOL . $this->_t(1) . '}'; + $this->fileContentStatic[$this->hhh + . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] + = PHP_EOL . PHP_EOL . $this->_t(1) . '/**'; + $this->fileContentStatic[$this->hhh + . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] + .= PHP_EOL . $this->_t(1) + . '* The Global Site Event Method.'; + $this->fileContentStatic[$this->hhh + . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] + .= PHP_EOL . $this->_t(1) . '**/'; + $this->fileContentStatic[$this->hhh + . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] + .= PHP_EOL . $this->_t(1) + . 'public static function globalEvent($document)'; + $this->fileContentStatic[$this->hhh + . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] + .= PHP_EOL . $this->_t(1) . '{'; + $this->fileContentStatic[$this->hhh + . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] + .= PHP_EOL . $this->setPlaceholders( + $this->customScriptBuilder['component_php_site_event'], + $this->placeholders + ); + $this->fileContentStatic[$this->hhh + . 'SITE_GLOBAL_EVENT_HELPER' . $this->hhh] + .= PHP_EOL . $this->_t(1) . '}'; } } // PREINSTALLSCRIPT - $this->fileContentStatic[$this->hhh . 'PREINSTALLSCRIPT' . $this->hhh] = $this->getCustomScriptBuilder('php_preflight', 'install', PHP_EOL, null, true); + $this->fileContentStatic[$this->hhh . 'PREINSTALLSCRIPT' + . $this->hhh] + = $this->getCustomScriptBuilder( + 'php_preflight', 'install', PHP_EOL, null, true + ); // PREUPDATESCRIPT - $this->fileContentStatic[$this->hhh . 'PREUPDATESCRIPT' . $this->hhh] = $this->getCustomScriptBuilder('php_preflight', 'update', PHP_EOL, null, true); + $this->fileContentStatic[$this->hhh . 'PREUPDATESCRIPT' + . $this->hhh] + = $this->getCustomScriptBuilder( + 'php_preflight', 'update', PHP_EOL, null, true + ); // POSTINSTALLSCRIPT - $this->fileContentStatic[$this->hhh . 'POSTINSTALLSCRIPT' . $this->hhh] = $this->setPostInstallScript(); + $this->fileContentStatic[$this->hhh . 'POSTINSTALLSCRIPT' + . $this->hhh] + = $this->setPostInstallScript(); // POSTUPDATESCRIPT - $this->fileContentStatic[$this->hhh . 'POSTUPDATESCRIPT' . $this->hhh] = $this->setPostUpdateScript(); + $this->fileContentStatic[$this->hhh . 'POSTUPDATESCRIPT' + . $this->hhh] + = $this->setPostUpdateScript(); // UNINSTALLSCRIPT - $this->fileContentStatic[$this->hhh . 'UNINSTALLSCRIPT' . $this->hhh] = $this->setUninstallScript(); + $this->fileContentStatic[$this->hhh . 'UNINSTALLSCRIPT' + . $this->hhh] + = $this->setUninstallScript(); // MOVEFOLDERSSCRIPT - $this->fileContentStatic[$this->hhh . 'MOVEFOLDERSSCRIPT' . $this->hhh] = $this->setMoveFolderScript(); + $this->fileContentStatic[$this->hhh . 'MOVEFOLDERSSCRIPT' + . $this->hhh] + = $this->setMoveFolderScript(); // MOVEFOLDERSMETHOD - $this->fileContentStatic[$this->hhh . 'MOVEFOLDERSMETHOD' . $this->hhh] = $this->setMoveFolderMethod(); + $this->fileContentStatic[$this->hhh . 'MOVEFOLDERSMETHOD' + . $this->hhh] + = $this->setMoveFolderMethod(); // HELPER_UIKIT - $this->fileContentStatic[$this->hhh . 'HELPER_UIKIT' . $this->hhh] = $this->setUikitHelperMethods(); + $this->fileContentStatic[$this->hhh . 'HELPER_UIKIT' . $this->hhh] + = $this->setUikitHelperMethods(); // CONFIG_FIELDSETS - $this->fileContentStatic[$this->hhh . 'CONFIG_FIELDSETS' . $this->hhh] = implode(PHP_EOL, $this->configFieldSets); + $this->fileContentStatic[$this->hhh . 'CONFIG_FIELDSETS' + . $this->hhh] + = implode(PHP_EOL, $this->configFieldSets); // check if this has been set - if (!isset($this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh]) || !ComponentbuilderHelper::checkString($this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh])) + if (!isset( + $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' + . $this->hhh] + ) + || !ComponentbuilderHelper::checkString( + $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' + . $this->hhh] + )) { - $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh] = 0; + $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' + . $this->hhh] + = 0; } else { - $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh] = '(' . $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' . $this->hhh] . ')'; + $this->fileContentStatic[$this->hhh . 'ROUTER_BUILD_VIEWS' + . $this->hhh] + = '(' . $this->fileContentStatic[$this->hhh + . 'ROUTER_BUILD_VIEWS' . $this->hhh] . ')'; } // README if ($this->componentData->addreadme) { - $this->fileContentStatic[$this->hhh . 'README' . $this->hhh] = $this->componentData->readme; + $this->fileContentStatic[$this->hhh . 'README' . $this->hhh] + = $this->componentData->readme; } // tweak system to set stuff to the module domain - $_backup_target = $this->target; - $_backup_lang = $this->lang; + $_backup_target = $this->target; + $_backup_lang = $this->lang; $_backup_langPrefix = $this->langPrefix; // infuse module data if set if (ComponentbuilderHelper::checkArray($this->joomlaModules)) @@ -1049,40 +1879,61 @@ class Infusion extends Interpretation $this->lang = $module->key; $this->langPrefix = $module->lang_prefix; // MODCODE - $this->fileContentDynamic[$module->key][$this->hhh . 'MODCODE' . $this->hhh] = $this->getModCode($module); + $this->fileContentDynamic[$module->key][$this->hhh + . 'MODCODE' . $this->hhh] + = $this->getModCode($module); // DYNAMICGET - $this->fileContentDynamic[$module->key][$this->hhh . 'DYNAMICGETS' . $this->hhh] = $this->setCustomViewCustomMethods($module, $module->key); + $this->fileContentDynamic[$module->key][$this->hhh + . 'DYNAMICGETS' . $this->hhh] + = $this->setCustomViewCustomMethods( + $module, $module->key + ); // HELPERCODE if ($module->add_class_helper >= 1) { - $this->fileContentDynamic[$module->key][$this->hhh . 'HELPERCODE' . $this->hhh] = $this->getModHelperCode($module); + $this->fileContentDynamic[$module->key][$this->hhh + . 'HELPERCODE' . $this->hhh] + = $this->getModHelperCode($module); } // MODDEFAULT - $this->fileContentDynamic[$module->key][$this->hhh . 'MODDEFAULT' . $this->hhh] = $this->getModDefault($module); + $this->fileContentDynamic[$module->key][$this->hhh + . 'MODDEFAULT' . $this->hhh] + = $this->getModDefault($module); // only add install script if needed if ($module->add_install_script) { // INSTALLCLASS - $this->fileContentDynamic[$module->key][$this->hhh . 'INSTALLCLASS' . $this->hhh] = $this->getExtensionInstallClass($module); + $this->fileContentDynamic[$module->key][$this->hhh + . 'INSTALLCLASS' . $this->hhh] + = $this->getExtensionInstallClass($module); } // FIELDSET - if (isset($module->form_files) && ComponentbuilderHelper::checkArray($module->form_files)) + if (isset($module->form_files) + && ComponentbuilderHelper::checkArray( + $module->form_files + )) { - foreach($module->form_files as $file => $files) + foreach ($module->form_files as $file => $files) { foreach ($files as $field_name => $fieldsets) { foreach ($fieldsets as $fieldset => $fields) { // FIELDSET_ . $file.$field_name.$fieldset - $this->fileContentDynamic[$module->key][$this->hhh . 'FIELDSET_' . $file.$field_name.$fieldset . $this->hhh] = - $this->getExtensionFieldsetXML($module, $fields); + $this->fileContentDynamic[$module->key][$this->hhh + . 'FIELDSET_' . $file . $field_name + . $fieldset . $this->hhh] + = $this->getExtensionFieldsetXML( + $module, $fields + ); } } } } // MAINXML - $this->fileContentDynamic[$module->key][$this->hhh . 'MAINXML' . $this->hhh] = $this->getModuleMainXML($module); + $this->fileContentDynamic[$module->key][$this->hhh + . 'MAINXML' . $this->hhh] + = $this->getModuleMainXML($module); } } } @@ -1093,56 +1944,75 @@ class Infusion extends Interpretation { if (ComponentbuilderHelper::checkObject($plugin)) { - $this->target = $plugin->key; - $this->lang = $plugin->key; + $this->target = $plugin->key; + $this->lang = $plugin->key; $this->langPrefix = $plugin->lang_prefix; // MAINCLASS - $this->fileContentDynamic[$plugin->key][$this->hhh . 'MAINCLASS' . $this->hhh] = $this->getPluginMainClass($plugin); + $this->fileContentDynamic[$plugin->key][$this->hhh + . 'MAINCLASS' . $this->hhh] + = $this->getPluginMainClass($plugin); // only add install script if needed if ($plugin->add_install_script) { // INSTALLCLASS - $this->fileContentDynamic[$plugin->key][$this->hhh . 'INSTALLCLASS' . $this->hhh] = $this->getExtensionInstallClass($plugin); + $this->fileContentDynamic[$plugin->key][$this->hhh + . 'INSTALLCLASS' . $this->hhh] + = $this->getExtensionInstallClass($plugin); } // FIELDSET - if (isset($plugin->form_files) && ComponentbuilderHelper::checkArray($plugin->form_files)) + if (isset($plugin->form_files) + && ComponentbuilderHelper::checkArray( + $plugin->form_files + )) { - foreach($plugin->form_files as $file => $files) + foreach ($plugin->form_files as $file => $files) { foreach ($files as $field_name => $fieldsets) { foreach ($fieldsets as $fieldset => $fields) { // FIELDSET_ . $file.$field_name.$fieldset - $this->fileContentDynamic[$plugin->key][$this->hhh . 'FIELDSET_' . $file.$field_name.$fieldset . $this->hhh] = - $this->getExtensionFieldsetXML($plugin, $fields); + $this->fileContentDynamic[$plugin->key][$this->hhh + . 'FIELDSET_' . $file . $field_name + . $fieldset . $this->hhh] + = $this->getExtensionFieldsetXML( + $plugin, $fields + ); } } } } // MAINXML - $this->fileContentDynamic[$plugin->key][$this->hhh . 'MAINXML' . $this->hhh] = $this->getPluginMainXML($plugin); + $this->fileContentDynamic[$plugin->key][$this->hhh + . 'MAINXML' . $this->hhh] + = $this->getPluginMainXML($plugin); } } } // rest globals - $this->target = $_backup_target; - $this->lang = $_backup_lang; + $this->target = $_backup_target; + $this->lang = $_backup_lang; $this->langPrefix = $_backup_langPrefix; // Trigger Event: jcb_ce_onAfterBuildFilesContent - $this->triggerEvent('jcb_ce_onAfterBuildFilesContent', array(&$this->componentContext, &$this->componentData, &$this->fileContentStatic, &$this->fileContentDynamic, &$this->placeholders, &$this->hhh)); + $this->triggerEvent( + 'jcb_ce_onAfterBuildFilesContent', + array(&$this->componentContext, &$this->componentData, + &$this->fileContentStatic, &$this->fileContentDynamic, + &$this->placeholders, &$this->hhh) + ); return true; } + return false; } /** * Set the view place holders to global scope - * + * * @param object $view The view settings - * + * * @ return void */ protected function setViewPlaceholders(&$view) @@ -1154,15 +2024,23 @@ class Infusion extends Interpretation if (isset($view->name_single)) { // set main keys - $viewName_single = ComponentbuilderHelper::safeString($view->name_single); - $viewName_u = ComponentbuilderHelper::safeString($view->name_single, 'U'); - $viewName_f = ComponentbuilderHelper::safeString($view->name_single, 'F'); + $viewName_single = ComponentbuilderHelper::safeString( + $view->name_single + ); + $viewName_u = ComponentbuilderHelper::safeString( + $view->name_single, 'U' + ); + $viewName_f = ComponentbuilderHelper::safeString( + $view->name_single, 'F' + ); // set some place holder for the views - $this->placeholders[$this->hhh . 'view' . $this->hhh] = $viewName_single; + $this->placeholders[$this->hhh . 'view' . $this->hhh] + = $viewName_single; $this->placeholders[$this->hhh . 'View' . $this->hhh] = $viewName_f; $this->placeholders[$this->hhh . 'VIEW' . $this->hhh] = $viewName_u; - $this->placeholders[$this->bbb . 'view' . $this->ddd] = $viewName_single; + $this->placeholders[$this->bbb . 'view' . $this->ddd] + = $viewName_single; $this->placeholders[$this->bbb . 'View' . $this->ddd] = $viewName_f; $this->placeholders[$this->bbb . 'VIEW' . $this->ddd] = $viewName_u; } @@ -1170,46 +2048,82 @@ class Infusion extends Interpretation // VIEWS <<>> if (isset($view->name_list)) { - $viewName_list = ComponentbuilderHelper::safeString($view->name_list); - $viewsName_u = ComponentbuilderHelper::safeString($view->name_list, 'U'); - $viewsName_f = ComponentbuilderHelper::safeString($view->name_list, 'F'); + $viewName_list = ComponentbuilderHelper::safeString( + $view->name_list + ); + $viewsName_u = ComponentbuilderHelper::safeString( + $view->name_list, 'U' + ); + $viewsName_f = ComponentbuilderHelper::safeString( + $view->name_list, 'F' + ); // set some place holder for the views - $this->placeholders[$this->hhh . 'views' . $this->hhh] = $viewName_list; - $this->placeholders[$this->hhh . 'Views' . $this->hhh] = $viewsName_f; - $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh] = $viewsName_u; - $this->placeholders[$this->bbb . 'views' . $this->ddd] = $viewName_list; - $this->placeholders[$this->bbb . 'Views' . $this->ddd] = $viewsName_f; - $this->placeholders[$this->bbb . 'VIEWS' . $this->ddd] = $viewsName_u; + $this->placeholders[$this->hhh . 'views' . $this->hhh] + = $viewName_list; + $this->placeholders[$this->hhh . 'Views' . $this->hhh] + = $viewsName_f; + $this->placeholders[$this->hhh . 'VIEWS' . $this->hhh] + = $viewsName_u; + $this->placeholders[$this->bbb . 'views' . $this->ddd] + = $viewName_list; + $this->placeholders[$this->bbb . 'Views' . $this->ddd] + = $viewsName_f; + $this->placeholders[$this->bbb . 'VIEWS' . $this->ddd] + = $viewsName_u; } // view <<>> if (isset($viewName_single)) { - $this->fileContentDynamic[$viewName_single][$this->hhh . 'view' . $this->hhh] = $viewName_single; - $this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEW' . $this->hhh] = $viewName_u; - $this->fileContentDynamic[$viewName_single][$this->hhh . 'View' . $this->hhh] = $viewName_f; + $this->fileContentDynamic[$viewName_single][$this->hhh . 'view' + . $this->hhh] + = $viewName_single; + $this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEW' + . $this->hhh] + = $viewName_u; + $this->fileContentDynamic[$viewName_single][$this->hhh . 'View' + . $this->hhh] + = $viewName_f; if (isset($viewName_list)) { - $this->fileContentDynamic[$viewName_list][$this->hhh . 'view' . $this->hhh] = $viewName_single; - $this->fileContentDynamic[$viewName_list][$this->hhh . 'VIEW' . $this->hhh] = $viewName_u; - $this->fileContentDynamic[$viewName_list][$this->hhh . 'View' . $this->hhh] = $viewName_f; + $this->fileContentDynamic[$viewName_list][$this->hhh . 'view' + . $this->hhh] + = $viewName_single; + $this->fileContentDynamic[$viewName_list][$this->hhh . 'VIEW' + . $this->hhh] + = $viewName_u; + $this->fileContentDynamic[$viewName_list][$this->hhh . 'View' + . $this->hhh] + = $viewName_f; } } // views <<>> if (isset($viewName_list)) { - $this->fileContentDynamic[$viewName_list][$this->hhh . 'views' . $this->hhh] = $viewName_list; - $this->fileContentDynamic[$viewName_list][$this->hhh . 'VIEWS' . $this->hhh] = $viewsName_u; - $this->fileContentDynamic[$viewName_list][$this->hhh . 'Views' . $this->hhh] = $viewsName_f; + $this->fileContentDynamic[$viewName_list][$this->hhh . 'views' + . $this->hhh] + = $viewName_list; + $this->fileContentDynamic[$viewName_list][$this->hhh . 'VIEWS' + . $this->hhh] + = $viewsName_u; + $this->fileContentDynamic[$viewName_list][$this->hhh . 'Views' + . $this->hhh] + = $viewsName_f; if (isset($viewName_single)) { - $this->fileContentDynamic[$viewName_single][$this->hhh . 'views' . $this->hhh] = $viewName_list; - $this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEWS' . $this->hhh] = $viewsName_u; - $this->fileContentDynamic[$viewName_single][$this->hhh . 'Views' . $this->hhh] = $viewsName_f; + $this->fileContentDynamic[$viewName_single][$this->hhh . 'views' + . $this->hhh] + = $viewName_list; + $this->fileContentDynamic[$viewName_single][$this->hhh . 'VIEWS' + . $this->hhh] + = $viewsName_u; + $this->fileContentDynamic[$viewName_single][$this->hhh . 'Views' + . $this->hhh] + = $viewsName_f; } } } @@ -1218,36 +2132,54 @@ class Infusion extends Interpretation * Build the language values and insert into file * * @return boolean on success - * + * */ public function setLangFileData() { // reset values - $values = array(); + $values = array(); $mainLangLoader = array(); // check the admin lang is set if ($this->setLangAdmin()) { - $values[] = array_values($this->languages[$this->langTag]['admin']); - $mainLangLoader['admin'] = count($this->languages[$this->langTag]['admin']); + $values[] = array_values( + $this->languages['components'][$this->langTag]['admin'] + ); + $mainLangLoader['admin'] = count( + $this->languages['components'][$this->langTag]['admin'] + ); } // check the admin system lang is set if ($this->setLangAdminSys()) { - $values[] = array_values($this->languages[$this->langTag]['adminsys']); - $mainLangLoader['adminsys'] = count($this->languages[$this->langTag]['adminsys']); + $values[] = array_values( + $this->languages['components'][$this->langTag]['adminsys'] + ); + $mainLangLoader['adminsys'] = count( + $this->languages['components'][$this->langTag]['adminsys'] + ); } // check the site lang is set - if ((!$this->removeSiteFolder || !$this->removeSiteEditFolder) && $this->setLangSite()) + if ((!$this->removeSiteFolder || !$this->removeSiteEditFolder) + && $this->setLangSite()) { - $values[] = array_values($this->languages[$this->langTag]['site']); - $mainLangLoader['site'] = count($this->languages[$this->langTag]['site']); + $values[] = array_values( + $this->languages['components'][$this->langTag]['site'] + ); + $mainLangLoader['site'] = count( + $this->languages['components'][$this->langTag]['site'] + ); } // check the site system lang is set - if ((!$this->removeSiteFolder || !$this->removeSiteEditFolder) && $this->setLangSiteSys()) + if ((!$this->removeSiteFolder || !$this->removeSiteEditFolder) + && $this->setLangSiteSys()) { - $values[] = array_values($this->languages[$this->langTag]['sitesys']); - $mainLangLoader['sitesys'] = count($this->languages[$this->langTag]['sitesys']); + $values[] = array_values( + $this->languages['components'][$this->langTag]['sitesys'] + ); + $mainLangLoader['sitesys'] = count( + $this->languages['components'][$this->langTag]['sitesys'] + ); } $values = array_unique(ComponentbuilderHelper::mergeArrays($values)); // get the other lang strings if there is any @@ -1259,45 +2191,33 @@ class Infusion extends Interpretation // path to INI file $getPAth = $this->templatePath . '/en-GB.com_admin.ini'; // Trigger Event: jcb_ce_onBeforeBuildAllLangFiles - $this->triggerEvent('jcb_ce_onBeforeBuildAllLangFiles', array(&$this->componentContext, &$this->languages, &$this->langTag)); + $this->triggerEvent( + 'jcb_ce_onBeforeBuildAllLangFiles', + array(&$this->componentContext, &$this->languages['components'], &$this->langTag) + ); // now we insert the values into the files - if (ComponentbuilderHelper::checkArray($this->languages)) + if (ComponentbuilderHelper::checkArray($this->languages['components'])) { // rest xml array $langXML = array(); - foreach ($this->languages as $tag => $areas) + foreach ($this->languages['components'] as $tag => $areas) { // trim the tag $tag = trim($tag); foreach ($areas as $area => $languageStrings) { - // only log messages for none $this->langTag translations - if ($this->langTag !== $tag) + // check if language should be added + if (!$this->shouldLanguageBeAdded($tag, $languageStrings, $mainLangLoader[$area])) { - $langStringNr = count($languageStrings); - $langStringSum = ComponentbuilderHelper::bcmath('mul', $langStringNr, 100); - $percentage = ComponentbuilderHelper::bcmath('div', $langStringSum, $mainLangLoader[$area]); - $stringNAme = ($langStringNr == 1) ? '(string ' . $tag . ' translated)' : '(strings ' . $tag . ' translated)'; - // force load if debug lines are added - if (!$this->debugLinenr) - { - // check if we sould install this translation - if ($percentage < $this->percentageLanguageAdd) - { - // dont add - $this->langNot[$area . ' ' . $tag] = '' . $mainLangLoader[$area] . '(total ' . $this->langTag . ' strings) only ' . $langStringNr . '' . $stringNAme . ' = ' . $percentage; - continue; - } - } - // show if it was added as well - $this->langSet[$area . ' ' . $tag] = '' . $mainLangLoader[$area] . '(total ' . $this->langTag . ' strings) and ' . $langStringNr . '' . $stringNAme . ' = ' . $percentage; + continue; } // set naming convention $p = 'admin'; $t = ''; if (strpos($area, 'site') !== false) { - if ($this->removeSiteFolder && $this->removeSiteEditFolder) + if ($this->removeSiteFolder + && $this->removeSiteEditFolder) { continue; } @@ -1307,8 +2227,9 @@ class Infusion extends Interpretation { $t = '.sys'; } - // build the path to to place the lang file - $path = $this->componentPath . '/' . $p . '/language/' . $tag; + // build the path to place the lang file + $path = $this->componentPath . '/' . $p . '/language/' + . $tag; if (!JFolder::exists($path)) { JFolder::create($path); @@ -1316,18 +2237,22 @@ class Infusion extends Interpretation $this->folderCount++; } // build the file name - $fileName = $tag . '.com_' . $this->componentCodeName . $t . '.ini'; + $fileName = $tag . '.com_' . $this->componentCodeName . $t + . '.ini'; // move the file to its place JFile::copy($getPAth, $path . '/' . $fileName); // count the file created $this->fileCount++; // add content to it - $lang = array_map(function ($langstring, $placeholder) - { - return $placeholder . '="' . $langstring . '"'; - }, $languageStrings, array_keys($languageStrings)); + $lang = array_map( + function ($langstring, $placeholder) { + return $placeholder . '="' . $langstring . '"'; + }, $languageStrings, array_keys($languageStrings) + ); // add to language file - $this->writeFile($path . '/' . $fileName, implode(PHP_EOL, $lang)); + $this->writeFile( + $path . '/' . $fileName, implode(PHP_EOL, $lang) + ); // set the line counter $this->lineCount = $this->lineCount + count((array) $lang); // build xml strings @@ -1335,25 +2260,34 @@ class Infusion extends Interpretation { $langXML[$p] = array(); } - $langXML[$p][] = 'language/' . $tag . '/' . $fileName . ''; + $langXML[$p][] = 'language/' + . $tag . '/' . $fileName . ''; } } // load the lang xml if (ComponentbuilderHelper::checkArray($langXML)) { $replace = array(); - if (isset($langXML['admin']) && ComponentbuilderHelper::checkArray($langXML['admin'])) + if (isset($langXML['admin']) + && ComponentbuilderHelper::checkArray($langXML['admin'])) { - $replace[$this->hhh . 'ADMIN_LANGUAGES' . $this->hhh] = implode(PHP_EOL . $this->_t(3), $langXML['admin']); + $replace[$this->hhh . 'ADMIN_LANGUAGES' . $this->hhh] + = implode(PHP_EOL . $this->_t(3), $langXML['admin']); } - if ((!$this->removeSiteFolder || !$this->removeSiteEditFolder) && isset($langXML['site']) && ComponentbuilderHelper::checkArray($langXML['site'])) + if ((!$this->removeSiteFolder || !$this->removeSiteEditFolder) + && isset($langXML['site']) + && ComponentbuilderHelper::checkArray($langXML['site'])) { - $replace[$this->hhh . 'SITE_LANGUAGES' . $this->hhh] = implode(PHP_EOL . $this->_t(2), $langXML['site']); + $replace[$this->hhh . 'SITE_LANGUAGES' . $this->hhh] + = implode(PHP_EOL . $this->_t(2), $langXML['site']); } // build xml path - $xmlPath = $this->componentPath . '/' . $this->componentCodeName . '.xml'; + $xmlPath = $this->componentPath . '/' . $this->componentCodeName + . '.xml'; // get the content in xml - $componentXML = ComponentbuilderHelper::getFileContents($xmlPath); + $componentXML = ComponentbuilderHelper::getFileContents( + $xmlPath + ); // update the xml content $componentXML = $this->setPlaceholders($componentXML, $replace); // store the values back to xml diff --git a/componentbuilder.xml b/componentbuilder.xml index 4a54c3ebc..1ed69498c 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 24th March, 2020 + 28th March, 2020 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com -- 2.40.1 From ad8717a47dc7991ac76666421135d140d73dcf3a Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Fri, 3 Apr 2020 20:45:48 +0200 Subject: [PATCH 8/8] Added events to the new module and plugin translation areas. Updated the fieldtypes to have more info on the showon property. --- README.md | 8 +- admin/README.txt | 8 +- admin/helpers/compiler.php | 2 +- admin/helpers/compiler/a_Get.php | 7 +- admin/helpers/compiler/e_Interpretation.php | 196 +++++++++++--------- admin/helpers/compiler/f_Infusion.php | 99 ++++++---- admin/models/import_joomla_components.php | 67 ++++--- admin/models/joomla_components.php | 12 +- admin/sql/install.mysql.utf8.sql | 72 +++---- componentbuilder.xml | 2 +- 10 files changed, 270 insertions(+), 203 deletions(-) diff --git a/README.md b/README.md index b321ef0f6..b8d0abdb2 100644 --- a/README.md +++ b/README.md @@ -144,14 +144,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 28th March, 2020 ++ *Last Build*: 3rd April, 2020 + *Version*: 2.10.13 + *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **280177** -+ *Field count*: **1512** ++ *Line count*: **280662** ++ *Field count*: **1514** + *File count*: **1771** -+ *Folder count*: **296** ++ *Folder count*: **287** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/README.txt b/admin/README.txt index b321ef0f6..b8d0abdb2 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -144,14 +144,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 28th March, 2020 ++ *Last Build*: 3rd April, 2020 + *Version*: 2.10.13 + *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **280177** -+ *Field count*: **1512** ++ *Line count*: **280662** ++ *Field count*: **1514** + *File count*: **1771** -+ *Folder count*: **296** ++ *Folder count*: **287** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/helpers/compiler.php b/admin/helpers/compiler.php index f9e1389f7..f7ac678b2 100644 --- a/admin/helpers/compiler.php +++ b/admin/helpers/compiler.php @@ -25,7 +25,7 @@ class Compiler extends Infusion * * @var string */ - private $tempPath; + public $tempPath; /** * The timer diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index e9b97a8f3..8976c4176 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -1249,6 +1249,11 @@ class Get $component->system_name ); + // set the component name_code + $component->name_code = ComponentbuilderHelper::safeString( + $component->name_code + ); + // ensure version naming is correct $this->component_version = preg_replace( '/[^0-9.]+/', '', $component->component_version @@ -1447,7 +1452,7 @@ class Get { $this->setJoomlaFields = true; } - // has become a lacacy issue, can't remove this + // has become a legacy issue, can't remove this $array['view'] = $array['adminview']; // get the admin settings/data $array['settings'] = $this->getAdminViewData( diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 42cec9669..931bc316a 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -25835,14 +25835,17 @@ function vdm_dkim() { // Trigger Event: jcb_ce_onBeforeBuildModuleLang $this->triggerEvent( 'jcb_ce_onBeforeBuildModuleLang', - array(&$module->context, &$this->langContent[$module->key], + array(&$this->componentContext, &$module, + &$this->langContent[$module->key], &$module->lang_prefix, &$module->official_name) ); // get other languages $values = array_unique($this->langContent[$module->key]); // get the other lang strings if there is any $this->multiLangString = $this->getMultiLangStrings($values); - // start the modules language bucket + // start the modules language bucket (must rest every time) + $this->languages['modules'] = array(); + $this->languages['modules'][$this->langTag] = array(); $this->languages['modules'][$this->langTag]['all'] = $this->langContent[$module->key]; unset($this->langContent[$module->key]); @@ -25855,7 +25858,8 @@ function vdm_dkim() { // Trigger Event: jcb_ce_onBeforeBuildModuleLangFiles $this->triggerEvent( 'jcb_ce_onBeforeBuildModuleLangFiles', - array(&$module->context, &$this->languages['modules'], + array(&$this->componentContext, &$module, + &$this->languages['modules'], &$this->langTag) ); // now we insert the values into the files @@ -25867,46 +25871,48 @@ function vdm_dkim() { $tag = trim($tag); foreach ($areas as $area => $languageStrings) { + $file_name = $tag . '.' . $module->file_name . '.ini'; // check if language should be added - if (!$this->shouldLanguageBeAdded( - $tag, $languageStrings, $total + if ($this->shouldLanguageBeAdded( + $tag, $languageStrings, $total, + $file_name )) { - continue; - } - $lang = array_map( - function ($langstring, $placeholder) { - return $placeholder . '="' . $langstring . '"'; - }, array_values($languageStrings), - array_keys($languageStrings) - ); - // set path - $path = $module->folder_path . '/language/' . $tag; - // create path if not exist - if (!JFolder::exists($path)) - { - JFolder::create($path); - // count the folder created - $this->folderCount++; - } - // add to language files (for now we add all to both TODO) - $this->writeFile( - $path . '/' . $tag . '.' . $module->file_name - . '.ini', - implode(PHP_EOL, $lang) - ); - $this->writeFile( - $path . '/' . $tag . '.' . $module->file_name - . '.sys.ini', - implode(PHP_EOL, $lang) - ); - // set the line counter - $this->lineCount = $this->lineCount + count( - (array) $lang + $lang = array_map( + function ($langstring, $placeholder) { + return $placeholder . '="' . $langstring + . '"'; + }, array_values($languageStrings), + array_keys($languageStrings) ); - unset($lang); - // trigger to add language - $addLang[$tag] = $tag; + // set path + $path = $module->folder_path . '/language/' . $tag + . '/'; + // create path if not exist + if (!JFolder::exists($path)) + { + JFolder::create($path); + // count the folder created + $this->folderCount++; + } + // add to language files (for now we add all to both TODO) + $this->writeFile( + $path . $file_name, + implode(PHP_EOL, $lang) + ); + $this->writeFile( + $path . $tag . '.' . $module->file_name + . '.sys.ini', + implode(PHP_EOL, $lang) + ); + // set the line counter + $this->lineCount = $this->lineCount + count( + (array) $lang + ); + unset($lang); + // trigger to add language + $addLang[$tag] = $tag; + } } } } @@ -25995,7 +26001,7 @@ function vdm_dkim() { } } // add language folder - if ($addLang) + if (ComponentbuilderHelper::checkArray($addLang)) { $xml .= PHP_EOL . $this->_t(2) . 'language'; } @@ -26122,9 +26128,6 @@ function vdm_dkim() { public function getPluginMainXML(&$plugin) { - // set some defaults - $view = ''; - $viewType = 0; // set the custom table key $dbkey = 'yy'; // build the xml @@ -26174,14 +26177,17 @@ function vdm_dkim() { // Trigger Event: jcb_ce_onBeforeBuildPluginLang $this->triggerEvent( 'jcb_ce_onBeforeBuildPluginLang', - array(&$plugin->context, &$this->langContent[$plugin->key], + array(&$this->componentContext, &$plugin, + &$this->langContent[$plugin->key], &$plugin->lang_prefix, &$plugin->official_name) ); // get other languages $values = array_unique($this->langContent[$plugin->key]); // get the other lang strings if there is any $this->multiLangString = $this->getMultiLangStrings($values); - // start the plugins language bucket + // start the plugins language bucket (must rest every time) + $this->languages['plugins'] = array(); + $this->languages['plugins'][$this->langTag] = array(); $this->languages['plugins'][$this->langTag]['all'] = $this->langContent[$plugin->key]; unset($this->langContent[$plugin->key]); @@ -26194,7 +26200,8 @@ function vdm_dkim() { // Trigger Event: jcb_ce_onBeforeBuildPluginLangFiles $this->triggerEvent( 'jcb_ce_onBeforeBuildPluginLangFiles', - array(&$plugin->context, &$this->languages['plugins'], + array(&$this->componentContext, &$plugin, + &$this->languages['plugins'], &$this->langTag) ); // now we insert the values into the files @@ -26206,47 +26213,53 @@ function vdm_dkim() { $tag = trim($tag); foreach ($areas as $area => $languageStrings) { + $file_name = $tag . '.plg_' . strtolower($plugin->group) + . '_' + . strtolower($plugin->code_name) . '.ini'; // check if language should be added - if (!$this->shouldLanguageBeAdded( - $tag, $languageStrings, $total + if ($this->shouldLanguageBeAdded( + $tag, $languageStrings, $total, + $file_name )) { - continue; - } - $lang = array_map( - function ($langstring, $placeholder) { - return $placeholder . '="' . $langstring . '"'; - }, array_values($languageStrings), - array_keys($languageStrings) - ); - // set path - $path = $plugin->folder_path . '/language/' . $tag . '/' - . $tag; - // create path if not exist - if (!JFolder::exists($path)) - { - JFolder::create($path); - // count the folder created - $this->folderCount++; - } - // add to language file - $this->writeFile( - $path . '.plg_' . strtolower($plugin->group) . '_' - . strtolower($plugin->code_name) . '.ini', - implode(PHP_EOL, $lang) - ); - $this->writeFile( - $path . '.plg_' . strtolower($plugin->group) . '_' - . strtolower($plugin->code_name) . '.sys.ini', - implode(PHP_EOL, $lang) - ); - // set the line counter - $this->lineCount = $this->lineCount + count( - (array) $lang + $lang = array_map( + function ($langstring, $placeholder) { + return $placeholder . '="' . $langstring + . '"'; + }, array_values($languageStrings), + array_keys($languageStrings) ); - unset($lang); - // trigger to add language - $addLang[$tag] = $tag; + // set path + $path = $plugin->folder_path . '/language/' . $tag + . '/'; + // create path if not exist + if (!JFolder::exists($path)) + { + JFolder::create($path); + // count the folder created + $this->folderCount++; + } + // add to language file + $this->writeFile( + $path . $file_name, + implode(PHP_EOL, $lang) + ); + $this->writeFile( + $path . $tag . '.plg_' . strtolower( + $plugin->group + ) + . '_' + . strtolower($plugin->code_name) . '.sys.ini', + implode(PHP_EOL, $lang) + ); + // set the line counter + $this->lineCount = $this->lineCount + count( + (array) $lang + ); + unset($lang); + // trigger to add language + $addLang[$tag] = $tag; + } } } } @@ -26338,7 +26351,7 @@ function vdm_dkim() { } } // add language folder - if ($addLang) + if (ComponentbuilderHelper::checkArray($addLang)) { $xml .= PHP_EOL . $this->_t(2) . 'language'; } @@ -26734,8 +26747,15 @@ function vdm_dkim() { return $script; } - public function shouldLanguageBeAdded(&$tag, &$languageStrings, &$total) - { + /** + * check if a translation should be added + * + * @return bool + * + */ + public function shouldLanguageBeAdded(&$tag, &$languageStrings, &$total, + &$file_name + ) { // only log messages for none $this->langTag translations if ($this->langTag !== $tag) { @@ -26756,7 +26776,7 @@ function vdm_dkim() { if ($percentage < $this->percentageLanguageAdd) { // dont add - $this->langNot[$area . ' ' . $tag] = '' + $this->langNot[$file_name] = '' . $total . '(total ' . $this->langTag . ' strings) only ' . $langStringNr . '' . $stringNAme @@ -26766,7 +26786,7 @@ function vdm_dkim() { } } // show if it was added as well - $this->langSet[$area . ' ' . $tag] = '' + $this->langSet[$file_name] = '' . $total . '(total ' . $this->langTag . ' strings) and ' . $langStringNr . '' . $stringNAme . ' = ' diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index 9c895d8ca..105f4561e 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -1875,6 +1875,11 @@ class Infusion extends Interpretation { if (ComponentbuilderHelper::checkObject($module)) { + // Trigger Event: jcb_ce_onBeforeInfuseModuleData + $this->triggerEvent( + 'jcb_ce_onBeforeInfuseModuleData', + array(&$this->componentContext, &$module, $this) + ); $this->target = $module->key; $this->lang = $module->key; $this->langPrefix = $module->lang_prefix; @@ -1934,6 +1939,11 @@ class Infusion extends Interpretation $this->fileContentDynamic[$module->key][$this->hhh . 'MAINXML' . $this->hhh] = $this->getModuleMainXML($module); + // Trigger Event: jcb_ce_onAfterInfuseModuleData + $this->triggerEvent( + 'jcb_ce_onAfterInfuseModuleData', + array(&$this->componentContext, &$module, $this) + ); } } } @@ -1944,6 +1954,11 @@ class Infusion extends Interpretation { if (ComponentbuilderHelper::checkObject($plugin)) { + // Trigger Event: jcb_ce_onBeforeInfusePluginData + $this->triggerEvent( + 'jcb_ce_onBeforeInfusePluginData', + array(&$this->componentContext, &$plugin, $this) + ); $this->target = $plugin->key; $this->lang = $plugin->key; $this->langPrefix = $plugin->lang_prefix; @@ -1986,6 +2001,11 @@ class Infusion extends Interpretation $this->fileContentDynamic[$plugin->key][$this->hhh . 'MAINXML' . $this->hhh] = $this->getPluginMainXML($plugin); + // Trigger Event: jcb_ce_onAfterInfusePluginData + $this->triggerEvent( + 'jcb_ce_onAfterInfusePluginData', + array(&$this->componentContext, &$plugin, $this) + ); } } } @@ -2206,11 +2226,6 @@ class Infusion extends Interpretation $tag = trim($tag); foreach ($areas as $area => $languageStrings) { - // check if language should be added - if (!$this->shouldLanguageBeAdded($tag, $languageStrings, $mainLangLoader[$area])) - { - continue; - } // set naming convention $p = 'admin'; $t = ''; @@ -2227,41 +2242,53 @@ class Infusion extends Interpretation { $t = '.sys'; } - // build the path to place the lang file - $path = $this->componentPath . '/' . $p . '/language/' - . $tag; - if (!JFolder::exists($path)) - { - JFolder::create($path); - // count the folder created - $this->folderCount++; - } // build the file name - $fileName = $tag . '.com_' . $this->componentCodeName . $t + $file_name = $tag . '.com_' . $this->componentCodeName . $t . '.ini'; - // move the file to its place - JFile::copy($getPAth, $path . '/' . $fileName); - // count the file created - $this->fileCount++; - // add content to it - $lang = array_map( - function ($langstring, $placeholder) { - return $placeholder . '="' . $langstring . '"'; - }, $languageStrings, array_keys($languageStrings) - ); - // add to language file - $this->writeFile( - $path . '/' . $fileName, implode(PHP_EOL, $lang) - ); - // set the line counter - $this->lineCount = $this->lineCount + count((array) $lang); - // build xml strings - if (!isset($langXML[$p])) + // check if language should be added + if ($this->shouldLanguageBeAdded( + $tag, $languageStrings, $mainLangLoader[$area], + $file_name + )) { - $langXML[$p] = array(); + // build the path to place the lang file + $path = $this->componentPath . '/' . $p . '/language/' + . $tag . '/'; + if (!JFolder::exists($path)) + { + JFolder::create($path); + // count the folder created + $this->folderCount++; + } + // move the file to its place + JFile::copy($getPAth, $path . $file_name); + // count the file created + $this->fileCount++; + // add content to it + $lang = array_map( + function ($langstring, $placeholder) { + return $placeholder . '="' . $langstring . '"'; + }, array_values($languageStrings), + array_keys($languageStrings) + ); + // add to language file + $this->writeFile( + $path . $file_name, implode(PHP_EOL, $lang) + ); + // set the line counter + $this->lineCount = $this->lineCount + count( + (array) $lang + ); + unset($lang); + // build xml strings + if (!isset($langXML[$p])) + { + $langXML[$p] = array(); + } + $langXML[$p][] = 'language/' + . $tag . '/' . $file_name . ''; } - $langXML[$p][] = 'language/' - . $tag . '/' . $fileName . ''; } } // load the lang xml diff --git a/admin/models/import_joomla_components.php b/admin/models/import_joomla_components.php index 818f45467..99722c3a1 100644 --- a/admin/models/import_joomla_components.php +++ b/admin/models/import_joomla_components.php @@ -699,13 +699,13 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy // the array of tables to store $tables = array( 'validation_rule', 'fieldtype', 'field', 'admin_view', 'snippet', 'dynamic_get', 'custom_admin_view', 'site_view', - 'template', 'layout', 'joomla_component', 'language', 'language_translation', 'custom_code', 'placeholder', 'class_extends', + 'template', 'layout', 'joomla_component', 'language', 'custom_code', 'placeholder', 'class_extends', 'joomla_module', 'joomla_module_files_folders_urls', 'joomla_module_updates', 'joomla_plugin_group', 'class_property', 'class_method', 'joomla_plugin', 'joomla_plugin_files_folders_urls', 'joomla_plugin_updates', 'admin_fields', 'admin_fields_conditions', 'admin_fields_relations', 'admin_custom_tabs', 'component_admin_views', 'component_site_views', 'component_custom_admin_views', 'component_updates', 'component_mysql_tweaks', 'component_custom_admin_menus', 'component_config', 'component_dashboard', 'component_files_folders', - 'component_placeholders', 'component_modules', 'component_plugins' + 'component_placeholders', 'component_modules', 'component_plugins', 'language_translation' ); // get prefix $prefix = $this->_db->getPrefix(); @@ -786,6 +786,8 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy if ($table === 'language_translation') { $item->localComponents = $local->components; + $item->localModules = $local->modules; + $item->localPlugins = $local->plugins; $item->localTranslation = $local->translation; } // make sure we have the correct ID set @@ -2192,40 +2194,49 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy $item = $this->setNewID($item, 'component', 'joomla_component', $type); break; case 'language_translation': - // update the component ID where needed - $item = $this->setNewID($item, 'component', 'joomla_component', $type); - // load the local components if found - if (isset($item->localComponents) && ComponentbuilderHelper::checkJson($item->localComponents)) + $langKeys = array( + array('target' => 'components', 'parent' => 'joomla_component', 'local' => 'localComponents'), + array('target' => 'modules', 'parent' => 'joomla_module', 'local' => 'localModules'), + array('target' => 'plugins', 'parent' => 'joomla_plugin', 'local' => 'localPlugins') + ); + // we have a few to check so we loop them + foreach ($langKeys as $lang) { - $components = array(); - if (isset($item->components) && ComponentbuilderHelper::checkJson($item->components)) + // update the target ID where needed + $item = $this->setNewID($item, $lang['target'], 'joomla_component', $type); + // load the local targets if found + if (isset($item->{$lang['local']}) && ComponentbuilderHelper::checkJson($item->{$lang['local']})) { - $components = json_decode($item->components, true); - } - $localComponents = json_decode($item->localComponents, true); - foreach ($localComponents as $lid) - { - if (!is_numeric($lid)) + $targets = array(); + if (isset($item->{$lang['target']}) && ComponentbuilderHelper::checkJson($item->{$lang['target']})) { - continue; + $targets = json_decode($item->{$lang['target']}, true); } - // add if not already there - if (!in_array($lid, $components)) + $localComponents = json_decode($item->{$lang['local']}, true); + foreach ($localComponents as $lid) { - $components[] = $lid; + if (!is_numeric($lid)) + { + continue; + } + // add if not already there + if (!in_array($lid, $targets)) + { + $targets[] = $lid; + } } } - } - // remove the localComponents - if (isset($item->localComponents)) - { - unset($item->localComponents); - } - // load it back - if (isset($components) && ComponentbuilderHelper::checkArray($components)) - { + // remove the localComponents + if (isset($item->{$lang['local']})) + { + unset($item->{$lang['local']}); + } // load it back - $item->components = json_encode(array_values($components), JSON_FORCE_OBJECT); + if (isset($targets) && ComponentbuilderHelper::checkArray($targets)) + { + // load it back + $item->{$lang['target']} = json_encode(array_values($targets), JSON_FORCE_OBJECT); + } } // merge the translations where needed if (isset($item->translation) && isset($item->localTranslation) diff --git a/admin/models/joomla_components.php b/admin/models/joomla_components.php index aa3c20858..486333733 100644 --- a/admin/models/joomla_components.php +++ b/admin/models/joomla_components.php @@ -966,6 +966,8 @@ class ComponentbuilderModelJoomla_components extends JModelList $this->setData('field', $this->getValues($item->fields, 'subform++', 'fields.field'), 'id'); // add dynamic gets $this->setSmartIDs($item->custom_get, 'dynamic_get'); + // set module language strings + $this->setLanguageTranslation($item->id, 'modules'); } // actions to take if table is joomla_plugin if ('joomla_plugin' === $table) @@ -982,6 +984,8 @@ class ComponentbuilderModelJoomla_components extends JModelList $this->setData('class_property', $this->getValues($item->property_selection, 'subform', 'property'), 'id'); // add class_method $this->setData('class_method', $this->getValues($item->method_selection, 'subform', 'method'), 'id'); + // set plugin language strings + $this->setLanguageTranslation($item->id, 'plugins'); } // actions to take if table is joomla_plugin_group if ('joomla_plugin_group' === $table) @@ -1664,7 +1668,7 @@ class ComponentbuilderModelJoomla_components extends JModelList * @return void * */ - protected function setLanguageTranslation(&$id) + protected function setLanguageTranslation(&$id, $target = 'components') { // Create a new query object. $query = $this->_db->getQuery(true); @@ -1695,10 +1699,10 @@ class ComponentbuilderModelJoomla_components extends JModelList } foreach ($items as $item) { - if (!isset($this->smartBox['language_translation'][$item->id]) && ComponentbuilderHelper::checkJson($item->components)) + if (!isset($this->smartBox['language_translation'][$item->id]) && ComponentbuilderHelper::checkJson($item->{$target})) { - $components = json_decode($item->components, true); - if (in_array($id, $components)) + $targets = json_decode($item->{$target}, true); + if (in_array($id, $targets)) { // load to global object $this->smartBox['language_translation'][$item->id] = $item; diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index 1c24e2442..21d8f239e 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -2129,45 +2129,45 @@ INSERT INTO `#__componentbuilder_field` (`id`, `add_css_view`, `add_css_views`, -- INSERT INTO `#__componentbuilder_fieldtype` (`id`, `catid`, `description`, `name`, `properties`, `short_description`, `params`, `published`, `version`, `hits`, `ordering`, `guid`) VALUES -(1, '', 'The calendar form field type provides a text box for entry of a date. An icon next to the text box provides a link to a pop-up calendar, which can also be used to enter the date value. If the field has a saved value this is shown in the text box. Otherwis', 'Calendar', '{\"properties0\":{\"name\":\"type\",\"example\":\"calendar\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be calendar.\"},\"properties1\":{\"name\":\"name\",\"example\":\"date\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a date\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"NOW\",\"adjustable\":\"1\",\"description\":\"(optional) is the default date. This must be given in the same format as specified by the format argument. You can put \\\"NOW\\\" to have current time.\"},\"properties4\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the text box.\"},\"properties5\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is whether the text box is read-only (true or false). If the text box is read-only, the date cannot be changed, but can be selected and copied. No calendar icon will be shown.\"},\"properties6\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is whether the text box is disabled (true or false). If the text box is disabled, the date cannot be changed, selected or copied.\"},\"properties7\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"},\"properties8\":{\"name\":\"format\",\"example\":\"%d-%m-%Y\",\"adjustable\":\"1\",\"description\":\"(optional) is the date format to be used. This is in the format used by PHP to specify date string formats (see below). If no format argument is given, \'%Y-%m-%d\' is assumed (giving dates like \'2008-04-16\').\"},\"properties9\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is time zone to be used. There are two values; server_utc and user_utc. The first one is server time zone and the later is user time zone as configured in global configuration and user information respectively.\"},\"properties10\":{\"name\":\"size\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional)\"},\"properties11\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"},\"properties13\":{\"name\":\"translateformat\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): If set to true, the calendar will use a language string to determine the format. The `format` attribute is ignored. If false, the `format` attribute is used (same behaviour as today). (starting with 3.7.0)\"},\"properties14\":{\"name\":\"showtime\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): If set to true and translateformat is true, the language key DATE_FORMAT_CALENDAR_DATETIME is used, otherwise DATE_FORMAT_CALENDAR_DATE. (starting with 3.7.0)\"},\"properties15\":{\"name\":\"timeformat\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): can be set to 12 (and specify AM or PM) or 24 (starting with 3.7.0)\"},\"properties16\":{\"name\":\"singleheader\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): if set to false, the year and the month selection will be set on two separates lines, with independant selection (starting with 3.7.0)\"},\"properties17\":{\"name\":\"todaybutton\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): if set to true, a button is added at the bottom of the datePicker to select the date of the current day (starting with 3.7.0)\"},\"properties18\":{\"name\":\"weeknumbers\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): if set to true, a column is added at the left of the datePicker to display the number of the week in the current year (starting with 3.7.0)\"},\"properties19\":{\"name\":\"filltable\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): if set to true, dates of the previous and next month is added at the top and the bottom of the current month to fill the grid (starting with 3.7.0)\"},\"properties20\":{\"name\":\"minyear\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): set a signed integer for a number of years (-10, -2, 0, 7, 12, ...) to define the relative lower limit for the year selection. The user could not select a year before your limit (starting with 3.7.0)\"},\"properties21\":{\"name\":\"maxyear\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): set a signed integer for a number of years (-10, -2, 0, 7, 12, ...) to define the relative upper limit for the year selection. The user could not select a year after your limit (starting with 3.7.0)\"}}', 'provides a text box for entry of a date. An icon next to the text box provides a link to a pop-up calendar, which can also be used to enter the date value.', '', 1, 6, '', '', '6cf5a33f-cb25-4a58-bfec-7e1511896402'), -(2, '', 'The category form field type provides a drop down list of all published categories for a certain extension. If the parameter has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected. If the show_root', 'Category', '{\"properties0\":{\"name\":\"type\",\"example\":\"category\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be category.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mycategory\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a category\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"extension\",\"example\":\"com_content\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the name of the extension for which the categories will be retrieved. For example, to list content categories, use the value \'com_content\'. You can add also target one view, use the value \'com_component.view\'.\"},\"properties4\":{\"name\":\"scope\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is an alias for extension.\"},\"properties5\":{\"name\":\"required\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties6\":{\"name\":\"show_root\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) is whether a choice representing the root category will be shown. Remove completely if it is not to be shown.\"},\"properties7\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default category ID number.\"},\"properties8\":{\"name\":\"description\",\"example\":\"select one of the following categories\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties9\":{\"name\":\"class\",\"example\":\"inputbox\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties10\":{\"name\":\"published\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(optional) (1\\/0\\/2\\/-2) is whether the drop down will show only published (1), unpublished (0), archived (2) or trashed (-2) categories. It is possible to combine different publishing status by entering the list of the corresponding numbers separated by comma (e.g. \\\"0,2,-2\\\" will display only unpublished, archived and trashed categories in the drop-down).\"},\"properties11\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'provides a drop down list of categories for an extension.', '', 1, 10, '', '', 'f70346b3-2096-4f44-8b26-01ab87da7d1e'), -(3, '', 'The checkbox form field type provides a single checkbox. If the parameter has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.', 'Checkbox', '{\"properties0\":{\"name\":\"type\",\"example\":\"checkbox\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be checkbox\"},\"properties1\":{\"name\":\"name\",\"example\":\"show_title\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Show title\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"value\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(optional) is the value of the parameter if this checkbox is set (usually 1).\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default value (usually 0 or 1).\"},\"properties5\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Show the title of the item\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the label.\"},\"properties7\":{\"name\":\"class\",\"example\":\"inputbox\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties8\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"},\"properties9\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (JavaScript use)\"}}', 'provides a single checkbox to be checked or unchecked', '', 1, 6, '', '', '10066262-b6e3-4f82-941e-cbe4f61ddd6c'), -(4, '', 'The checkboxes form field type provides a set of checkboxes. Note: unlike most standard form field types, such as textfield or checkbox, this field is not an \"out of the box\" solution. It will create checkboxes for you, and submit their values in form of ', 'Checkboxes', '{\"properties0\":{\"name\":\"type\",\"example\":\"checkboxes\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be checkboxs\"},\"properties1\":{\"name\":\"name\",\"example\":\"toppings\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select Toppings\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"option\",\"example\":\"anch|Anchovies,chor|Chorizo,on|Onions,mush|Mushrooms\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default value.\"},\"properties5\":{\"name\":\"description\",\"example\":\"Select the topping of your choice\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the label.\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties8\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'provides unlimited checkboxes that can be used for multi-select.', '', 1, 3, '', '', 'ac10859b-58da-4584-9682-36a6c2c8d04d'), -(5, '', 'Provides a color picker. Enter the color as #ff00ff or pick it from the palet.', 'Color', '{\"properties0\":{\"name\":\"type\",\"example\":\"color\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be color.\"},\"properties1\":{\"name\":\"name\",\"example\":\"backgroundcolor\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"default\",\"example\":\"#FFFFFF\",\"adjustable\":\"1\",\"description\":\"(optional) provides a color when not set.\"},\"properties3\":{\"name\":\"label\",\"example\":\"Background\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties4\":{\"name\":\"description\",\"example\":\"Select the background color here.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) tooltip for the form field.\"},\"properties5\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties6\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'provides a color picker when clicking the input box.', '', 1, 4, '', '', '7f60f198-53e7-4fe9-813f-d1b6c553680e'), -(6, '', 'The list form field type provides a drop down list or a list box of other current component table entries. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.', 'Custom', '{\"properties0\":{\"name\":\"type\",\"example\":\"subjects\",\"mandatory\":\"1\",\"description\":\"(mandatory) can be anything, just not the same as any other default Joomla field type. You can also not use the \\\"_\\\" (underscore) or \\\"-\\\" (hyphen) in the type name, and no spaces.\"},\"properties1\":{\"name\":\"name\",\"example\":\"subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a Subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties5\":{\"name\":\"class\",\"example\":\"list_class\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties7\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties8\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties9\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties10\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties11\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"},\"properties13\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"},\"properties14\":{\"name\":\"extends\",\"example\":\"list\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The JFormField sub class that should be extended. The options are (\'list\',\'radio\',\'checkboxes\')\"},\"properties15\":{\"name\":\"button\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) to add new button next to field in edit view\"},\"properties16\":{\"name\":\"table\",\"example\":\"#__###component###_subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The table being linked to. The ###TABLE### placeholder holds the table in the php.\"},\"properties17\":{\"name\":\"component\",\"example\":\"com_###component###\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the component where this table is found. Must be com_users\"},\"properties18\":{\"name\":\"view\",\"example\":\"subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The single view name if the place this field is added.\"},\"properties19\":{\"name\":\"views\",\"example\":\"subjects\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The list view name if the place this field is added.\"},\"properties20\":{\"name\":\"value_field\",\"example\":\"name\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the text field in table linked to. The ###TEXT### placeholder holds the value_field in the php.\"},\"properties21\":{\"name\":\"key_field\",\"example\":\"id\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The field from the linked table to save in this table as the unique key. The ###ID### placeholder holds the key_field in the php.\"},\"properties22\":{\"name\":\"prime_php\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"This field makes sure that the PHP used here is used to build the field type, and other are custom fields with the same field type are ignored. So to avoid that they over write the PHP added here. You should only have one prime per\\/type. To disable remove the field or set to 0\"},\"properties23\":{\"name\":\"type_php_1\",\"example\":\"\\/\\/ Get the user object.\\r\\n\\t\\t$user = JFactory::getUser();\\r\\n\\t\\t\\/\\/ Get the databse object.\\r\\n\\t\\t$db = JFactory::getDBO();\\r\\n\\t\\t$query = $db->getQuery(true);\\r\\n\\t\\t$query->select($db->quoteName(array(\'a.###ID###\',\'a.###TEXT###\'),array(\'###ID###\',\'###CODE_TEXT###\')));\\r\\n\\t\\t$query->from($db->quoteName(\'###TABLE###\', \'a\'));\\r\\n\\t\\t$query->where($db->quoteName(\'a.published\') . \' = 1\');\\r\\n\\t\\t$query->order(\'a.###TEXT### ASC\');\\r\\n\\t\\t\\/\\/ Implement View Level Access (if set in table)\\r\\n\\t\\tif (!$user->authorise(\'core.options\', \'[[[com_component]]]\'))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$columns = $db->getTableColumns(\'###TABLE###\');\\r\\n\\t\\t\\tif(isset($columns[\'access\']))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$groups = implode(\',\', $user->getAuthorisedViewLevels());\\r\\n\\t\\t\\t\\t$query->where(\'a.access IN (\' . $groups . \')\');\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\t$db->setQuery((string)$query);\\r\\n\\t\\t$items = $db->loadObjectList();\\r\\n\\t\\t$options = array();\\r\\n\\t\\tif ($items)\\r\\n\\t\\t{\\r\\n\\t\\t\\t$options[] = JHtml::_(\'select.option\', \'\', \'Select an option\');\\r\\n\\t\\t\\tforeach($items as $item)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$options[] = JHtml::_(\'select.option\', $item->###ID###, $item->###CODE_TEXT###);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\treturn $options;\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"}}', 'provides a drop down list of items entries.', '', 1, 24, '', '', 'dd2e1f4b-f5db-45e8-85fa-efd27bae7b6a'), -(7, '', 'The a list of users that can be targeting one or more groups and excluded users that already belongs to an item in a view.', 'CustomUser', '{\"properties0\":{\"name\":\"type\",\"example\":\"staffusers\",\"mandatory\":\"1\",\"description\":\"(mandatory) can be anything, just not the same as any other default Joomla field type.\"},\"properties1\":{\"name\":\"name\",\"example\":\"staff\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Staff\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties5\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties8\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties9\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"\"},\"properties10\":{\"name\":\"hint\",\"example\":\"select a user\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"\"},\"properties11\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"},\"properties12\":{\"name\":\"extends\",\"example\":\"user\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The JFormField sub class that should be extended. The options are (\'list\',\'radio\',\'checkboxes\')\"},\"properties13\":{\"name\":\"table\",\"example\":\"#__users\",\"mandatory\":\"1\",\"description\":\"(mandatory) The table being linked to. Must be #__users\"},\"properties14\":{\"name\":\"component\",\"example\":\"com_users\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the component where this table is found. Must be com_users\"},\"properties15\":{\"name\":\"view\",\"example\":\"###view###\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The single view name if the place this field is added.\"},\"properties16\":{\"name\":\"views\",\"example\":\"###views###\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The list view name if the place this field is added.\"},\"properties17\":{\"name\":\"value_field\",\"example\":\"name\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the text field in table linked to.\"},\"properties18\":{\"name\":\"key_field\",\"example\":\"id\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The field from the linked table to save in this table as the unique key.\"},\"properties19\":{\"name\":\"type_php_1\",\"example\":\"\\/\\/ set the groups array\",\"adjustable\":\"1\",\"description\":\"The php for the getGroups method.\"},\"properties20\":{\"name\":\"type_php_2\",\"example\":\"$groups = JComponentHelper::getParams(\'com_###component###\')->get(\'###type###\');\",\"adjustable\":\"1\",\"description\":\"The php for the getGroups method.\"},\"properties21\":{\"name\":\"type_php_3\",\"example\":\"return $groups;\",\"adjustable\":\"1\",\"description\":\"The php for the getGroups method.\"},\"properties22\":{\"name\":\"type_phpx_1\",\"example\":\"\\/\\/ To ensure that there is only one record per user\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties23\":{\"name\":\"type_phpx_2\",\"example\":\"\\/\\/ Get a db connection.\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties24\":{\"name\":\"type_phpx_3\",\"example\":\"$db = JFactory::getDbo();\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties25\":{\"name\":\"type_phpx_4\",\"example\":\"\\/\\/ Create a new query object.\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties26\":{\"name\":\"type_phpx_5\",\"example\":\"$query = $db->getQuery(true);\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties27\":{\"name\":\"type_phpx_6\",\"example\":\"\\/\\/ Select all records from the #__###component###_###view### table from ###CODE### column\\\".\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties28\":{\"name\":\"type_phpx_7\",\"example\":\"$query->select($db->quoteName(\'###CODE###\'));\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties29\":{\"name\":\"type_phpx_8\",\"example\":\"$query->from($db->quoteName(\'#__###component###_###view###\'));\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties30\":{\"name\":\"type_phpx_9\",\"example\":\"$db->setQuery($query);\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties31\":{\"name\":\"type_phpx_10\",\"example\":\"$db->execute();\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties32\":{\"name\":\"type_phpx_11\",\"example\":\"$found = $db->getNumRows();\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties33\":{\"name\":\"type_phpx_12\",\"example\":\"if ($found)\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties34\":{\"name\":\"type_phpx_13\",\"example\":\"{\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties35\":{\"name\":\"type_phpx_14\",\"example\":\"\\\\t\\/\\/ return all users already used\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties36\":{\"name\":\"type_phpx_15\",\"example\":\"\\\\treturn array_unique($db->loadColumn());\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties37\":{\"name\":\"type_phpx_16\",\"example\":\"}\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties38\":{\"name\":\"type_phpx_17\",\"example\":\"return null;\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"}}', 'Provides list of users.', '', 1, 4, '', '', 'a4a39f70-070f-459c-be4b-0ac103a29b9a'), -(8, '', 'The Editor field type provides a WYSIWYG editor.', 'Editor', '{\"properties0\":{\"name\":\"type\",\"example\":\"editor\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be editor.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mytextblock\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Test Field\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"Some text\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties4\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the label.\"},\"properties5\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties6\":{\"name\":\"width\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the width (in pixels) of the wysiwyg editor and defaults to 100%.\"},\"properties7\":{\"name\":\"height\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the height (in pixels) of the wysiwyg editor and defaults to 250px.\"},\"properties8\":{\"name\":\"cols\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the width of the editor (in columns).\"},\"properties9\":{\"name\":\"rows\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the height of the editor (in rows).\"},\"properties10\":{\"name\":\"buttons\",\"example\":\"no\",\"adjustable\":\"1\",\"description\":\"(optional) can be an array of plugin buttons to be excluded or set to false. The default editors-xtd are: article, image, pagebreak and readmore.\"},\"properties11\":{\"name\":\"syntax\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) can be used to set the code syntax matching for this field.\"},\"properties12\":{\"name\":\"hide\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) array of plugin buttons to be hidden. eg... set buttons=\\\"true\\\" hide=\\\"readmore,pagebreak\\\"\"},\"properties13\":{\"name\":\"editor\",\"example\":\"codemirror|none\",\"adjustable\":\"1\",\"description\":\"specifies the editor to be used and can include two options (editor=\\\"desired|alternative\\\")\"},\"properties14\":{\"name\":\"filter\",\"example\":\"safehtml\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties15\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties16\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties17\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'provides an editor area field.', '', 1, 10, '', '', '51f288d2-6eaa-42bc-a182-a6f69b3032b8'), +(1, '', 'The calendar form field type provides a text box for entry of a date. An icon next to the text box provides a link to a pop-up calendar, which can also be used to enter the date value. If the field has a saved value this is shown in the text box. Otherwis', 'Calendar', '{\"properties0\":{\"name\":\"type\",\"example\":\"calendar\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be calendar.\"},\"properties1\":{\"name\":\"name\",\"example\":\"date\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a date\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"NOW\",\"adjustable\":\"1\",\"description\":\"(optional) is the default date. This must be given in the same format as specified by the format argument. You can put \\\"NOW\\\" to have current time.\"},\"properties4\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the text box.\"},\"properties5\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is whether the text box is read-only (true or false). If the text box is read-only, the date cannot be changed, but can be selected and copied. No calendar icon will be shown.\"},\"properties6\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is whether the text box is disabled (true or false). If the text box is disabled, the date cannot be changed, selected or copied.\"},\"properties7\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"},\"properties8\":{\"name\":\"format\",\"example\":\"%d-%m-%Y\",\"adjustable\":\"1\",\"description\":\"(optional) is the date format to be used. This is in the format used by PHP to specify date string formats (see below). If no format argument is given, \'%Y-%m-%d\' is assumed (giving dates like \'2008-04-16\').\"},\"properties9\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is time zone to be used. There are two values; server_utc and user_utc. The first one is server time zone and the later is user time zone as configured in global configuration and user information respectively.\"},\"properties10\":{\"name\":\"size\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional)\"},\"properties11\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties13\":{\"name\":\"translateformat\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): If set to true, the calendar will use a language string to determine the format. The `format` attribute is ignored. If false, the `format` attribute is used (same behaviour as today). (starting with 3.7.0)\"},\"properties14\":{\"name\":\"showtime\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): If set to true and translateformat is true, the language key DATE_FORMAT_CALENDAR_DATETIME is used, otherwise DATE_FORMAT_CALENDAR_DATE. (starting with 3.7.0)\"},\"properties15\":{\"name\":\"timeformat\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): can be set to 12 (and specify AM or PM) or 24 (starting with 3.7.0)\"},\"properties16\":{\"name\":\"singleheader\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): if set to false, the year and the month selection will be set on two separates lines, with independant selection (starting with 3.7.0)\"},\"properties17\":{\"name\":\"todaybutton\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): if set to true, a button is added at the bottom of the datePicker to select the date of the current day (starting with 3.7.0)\"},\"properties18\":{\"name\":\"weeknumbers\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): if set to true, a column is added at the left of the datePicker to display the number of the week in the current year (starting with 3.7.0)\"},\"properties19\":{\"name\":\"filltable\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): if set to true, dates of the previous and next month is added at the top and the bottom of the current month to fill the grid (starting with 3.7.0)\"},\"properties20\":{\"name\":\"minyear\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): set a signed integer for a number of years (-10, -2, 0, 7, 12, ...) to define the relative lower limit for the year selection. The user could not select a year before your limit (starting with 3.7.0)\"},\"properties21\":{\"name\":\"maxyear\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional): set a signed integer for a number of years (-10, -2, 0, 7, 12, ...) to define the relative upper limit for the year selection. The user could not select a year after your limit (starting with 3.7.0)\"}}', 'provides a text box for entry of a date. An icon next to the text box provides a link to a pop-up calendar, which can also be used to enter the date value.', '', 1, 7, '', '', '6cf5a33f-cb25-4a58-bfec-7e1511896402'), +(2, '', 'The category form field type provides a drop down list of all published categories for a certain extension. If the parameter has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected. If the show_root', 'Category', '{\"properties0\":{\"name\":\"type\",\"example\":\"category\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be category.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mycategory\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a category\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"extension\",\"example\":\"com_content\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the name of the extension for which the categories will be retrieved. For example, to list content categories, use the value \'com_content\'. You can add also target one view, use the value \'com_component.view\'.\"},\"properties4\":{\"name\":\"scope\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is an alias for extension.\"},\"properties5\":{\"name\":\"required\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties6\":{\"name\":\"show_root\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) is whether a choice representing the root category will be shown. Remove completely if it is not to be shown.\"},\"properties7\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default category ID number.\"},\"properties8\":{\"name\":\"description\",\"example\":\"select one of the following categories\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties9\":{\"name\":\"class\",\"example\":\"inputbox\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties10\":{\"name\":\"published\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(optional) (1\\/0\\/2\\/-2) is whether the drop down will show only published (1), unpublished (0), archived (2) or trashed (-2) categories. It is possible to combine different publishing status by entering the list of the corresponding numbers separated by comma (e.g. \\\"0,2,-2\\\" will display only unpublished, archived and trashed categories in the drop-down).\"},\"properties11\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'provides a drop down list of categories for an extension.', '', 1, 11, '', '', 'f70346b3-2096-4f44-8b26-01ab87da7d1e'), +(3, '', 'The checkbox form field type provides a single checkbox. If the parameter has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.', 'Checkbox', '{\"properties0\":{\"name\":\"type\",\"example\":\"checkbox\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be checkbox\"},\"properties1\":{\"name\":\"name\",\"example\":\"show_title\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Show title\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"value\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(optional) is the value of the parameter if this checkbox is set (usually 1).\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default value (usually 0 or 1).\"},\"properties5\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Show the title of the item\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the label.\"},\"properties7\":{\"name\":\"class\",\"example\":\"inputbox\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties8\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties9\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (JavaScript use)\"}}', 'provides a single checkbox to be checked or unchecked', '', 1, 7, '', '', '10066262-b6e3-4f82-941e-cbe4f61ddd6c'), +(4, '', 'The checkboxes form field type provides a set of checkboxes. Note: unlike most standard form field types, such as textfield or checkbox, this field is not an \"out of the box\" solution. It will create checkboxes for you, and submit their values in form of ', 'Checkboxes', '{\"properties0\":{\"name\":\"type\",\"example\":\"checkboxes\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be checkboxs\"},\"properties1\":{\"name\":\"name\",\"example\":\"toppings\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select Toppings\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"option\",\"example\":\"anch|Anchovies,chor|Chorizo,on|Onions,mush|Mushrooms\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default value.\"},\"properties5\":{\"name\":\"description\",\"example\":\"Select the topping of your choice\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the label.\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties8\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'provides unlimited checkboxes that can be used for multi-select.', '', 1, 4, '', '', 'ac10859b-58da-4584-9682-36a6c2c8d04d'), +(5, '', 'Provides a color picker. Enter the color as #ff00ff or pick it from the palet.', 'Color', '{\"properties0\":{\"name\":\"type\",\"example\":\"color\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be color.\"},\"properties1\":{\"name\":\"name\",\"example\":\"backgroundcolor\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"default\",\"example\":\"#FFFFFF\",\"adjustable\":\"1\",\"description\":\"(optional) provides a color when not set.\"},\"properties3\":{\"name\":\"label\",\"example\":\"Background\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties4\":{\"name\":\"description\",\"example\":\"Select the background color here.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) tooltip for the form field.\"},\"properties5\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties6\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'provides a color picker when clicking the input box.', '', 1, 5, '', '', '7f60f198-53e7-4fe9-813f-d1b6c553680e'), +(6, '', 'The list form field type provides a drop down list or a list box of other current component table entries. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.', 'Custom', '{\"properties0\":{\"name\":\"type\",\"example\":\"subjects\",\"mandatory\":\"1\",\"description\":\"(mandatory) can be anything, just not the same as any other default Joomla field type. You can also not use the \\\"_\\\" (underscore) or \\\"-\\\" (hyphen) in the type name, and no spaces.\"},\"properties1\":{\"name\":\"name\",\"example\":\"subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a Subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties5\":{\"name\":\"class\",\"example\":\"list_class\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties7\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties8\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties9\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties10\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties11\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties13\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"},\"properties14\":{\"name\":\"extends\",\"example\":\"list\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The JFormField sub class that should be extended. The options are (\'list\',\'radio\',\'checkboxes\')\"},\"properties15\":{\"name\":\"button\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) to add new button next to field in edit view\"},\"properties16\":{\"name\":\"table\",\"example\":\"#__###component###_subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The table being linked to. The ###TABLE### placeholder holds the table in the php.\"},\"properties17\":{\"name\":\"component\",\"example\":\"com_###component###\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the component where this table is found. Must be com_users\"},\"properties18\":{\"name\":\"view\",\"example\":\"subject\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The single view name if the place this field is added.\"},\"properties19\":{\"name\":\"views\",\"example\":\"subjects\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The list view name if the place this field is added.\"},\"properties20\":{\"name\":\"value_field\",\"example\":\"name\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the text field in table linked to. The ###TEXT### placeholder holds the value_field in the php.\"},\"properties21\":{\"name\":\"key_field\",\"example\":\"id\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The field from the linked table to save in this table as the unique key. The ###ID### placeholder holds the key_field in the php.\"},\"properties22\":{\"name\":\"prime_php\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"This field makes sure that the PHP used here is used to build the field type, and other are custom fields with the same field type are ignored. So to avoid that they over write the PHP added here. You should only have one prime per\\/type. To disable remove the field or set to 0\"},\"properties23\":{\"name\":\"type_php_1\",\"example\":\"\\/\\/ Get the user object.\\r\\n\\t\\t$user = JFactory::getUser();\\r\\n\\t\\t\\/\\/ Get the databse object.\\r\\n\\t\\t$db = JFactory::getDBO();\\r\\n\\t\\t$query = $db->getQuery(true);\\r\\n\\t\\t$query->select($db->quoteName(array(\'a.###ID###\',\'a.###TEXT###\'),array(\'###ID###\',\'###CODE_TEXT###\')));\\r\\n\\t\\t$query->from($db->quoteName(\'###TABLE###\', \'a\'));\\r\\n\\t\\t$query->where($db->quoteName(\'a.published\') . \' = 1\');\\r\\n\\t\\t$query->order(\'a.###TEXT### ASC\');\\r\\n\\t\\t\\/\\/ Implement View Level Access (if set in table)\\r\\n\\t\\tif (!$user->authorise(\'core.options\', \'[[[com_component]]]\'))\\r\\n\\t\\t{\\r\\n\\t\\t\\t$columns = $db->getTableColumns(\'###TABLE###\');\\r\\n\\t\\t\\tif(isset($columns[\'access\']))\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$groups = implode(\',\', $user->getAuthorisedViewLevels());\\r\\n\\t\\t\\t\\t$query->where(\'a.access IN (\' . $groups . \')\');\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\t$db->setQuery((string)$query);\\r\\n\\t\\t$items = $db->loadObjectList();\\r\\n\\t\\t$options = array();\\r\\n\\t\\tif ($items)\\r\\n\\t\\t{\\r\\n\\t\\t\\t$options[] = JHtml::_(\'select.option\', \'\', \'Select an option\');\\r\\n\\t\\t\\tforeach($items as $item)\\r\\n\\t\\t\\t{\\r\\n\\t\\t\\t\\t$options[] = JHtml::_(\'select.option\', $item->###ID###, $item->###CODE_TEXT###);\\r\\n\\t\\t\\t}\\r\\n\\t\\t}\\r\\n\\t\\treturn $options;\",\"adjustable\":\"1\",\"description\":\"The php for the getOptions method.\"}}', 'provides a drop down list of items entries.', '', 1, 25, '', '', 'dd2e1f4b-f5db-45e8-85fa-efd27bae7b6a'), +(7, '', 'The a list of users that can be targeting one or more groups and excluded users that already belongs to an item in a view.', 'CustomUser', '{\"properties0\":{\"name\":\"type\",\"example\":\"staffusers\",\"mandatory\":\"1\",\"description\":\"(mandatory) can be anything, just not the same as any other default Joomla field type.\"},\"properties1\":{\"name\":\"name\",\"example\":\"staff\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Staff\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties5\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties8\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties9\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"\"},\"properties10\":{\"name\":\"hint\",\"example\":\"select a user\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"\"},\"properties11\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties12\":{\"name\":\"extends\",\"example\":\"user\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"The JFormField sub class that should be extended. The options are (\'list\',\'radio\',\'checkboxes\')\"},\"properties13\":{\"name\":\"table\",\"example\":\"#__users\",\"mandatory\":\"1\",\"description\":\"(mandatory) The table being linked to. Must be #__users\"},\"properties14\":{\"name\":\"component\",\"example\":\"com_users\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the component where this table is found. Must be com_users\"},\"properties15\":{\"name\":\"view\",\"example\":\"###view###\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The single view name if the place this field is added.\"},\"properties16\":{\"name\":\"views\",\"example\":\"###views###\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The list view name if the place this field is added.\"},\"properties17\":{\"name\":\"value_field\",\"example\":\"name\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The name of the text field in table linked to.\"},\"properties18\":{\"name\":\"key_field\",\"example\":\"id\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The field from the linked table to save in this table as the unique key.\"},\"properties19\":{\"name\":\"type_php_1\",\"example\":\"\\/\\/ set the groups array\",\"adjustable\":\"1\",\"description\":\"The php for the getGroups method.\"},\"properties20\":{\"name\":\"type_php_2\",\"example\":\"$groups = JComponentHelper::getParams(\'com_###component###\')->get(\'###type###\');\",\"adjustable\":\"1\",\"description\":\"The php for the getGroups method.\"},\"properties21\":{\"name\":\"type_php_3\",\"example\":\"return $groups;\",\"adjustable\":\"1\",\"description\":\"The php for the getGroups method.\"},\"properties22\":{\"name\":\"type_phpx_1\",\"example\":\"\\/\\/ To ensure that there is only one record per user\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties23\":{\"name\":\"type_phpx_2\",\"example\":\"\\/\\/ Get a db connection.\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties24\":{\"name\":\"type_phpx_3\",\"example\":\"$db = JFactory::getDbo();\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties25\":{\"name\":\"type_phpx_4\",\"example\":\"\\/\\/ Create a new query object.\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties26\":{\"name\":\"type_phpx_5\",\"example\":\"$query = $db->getQuery(true);\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties27\":{\"name\":\"type_phpx_6\",\"example\":\"\\/\\/ Select all records from the #__###component###_###view### table from ###CODE### column\\\".\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties28\":{\"name\":\"type_phpx_7\",\"example\":\"$query->select($db->quoteName(\'###CODE###\'));\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties29\":{\"name\":\"type_phpx_8\",\"example\":\"$query->from($db->quoteName(\'#__###component###_###view###\'));\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties30\":{\"name\":\"type_phpx_9\",\"example\":\"$db->setQuery($query);\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties31\":{\"name\":\"type_phpx_10\",\"example\":\"$db->execute();\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties32\":{\"name\":\"type_phpx_11\",\"example\":\"$found = $db->getNumRows();\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties33\":{\"name\":\"type_phpx_12\",\"example\":\"if ($found)\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties34\":{\"name\":\"type_phpx_13\",\"example\":\"{\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties35\":{\"name\":\"type_phpx_14\",\"example\":\"\\\\t\\/\\/ return all users already used\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties36\":{\"name\":\"type_phpx_15\",\"example\":\"\\\\treturn array_unique($db->loadColumn());\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties37\":{\"name\":\"type_phpx_16\",\"example\":\"}\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"},\"properties38\":{\"name\":\"type_phpx_17\",\"example\":\"return null;\",\"adjustable\":\"1\",\"description\":\"The php for the getExcluded method.\"}}', 'Provides list of users.', '', 1, 5, '', '', 'a4a39f70-070f-459c-be4b-0ac103a29b9a'), +(8, '', 'The Editor field type provides a WYSIWYG editor.', 'Editor', '{\"properties0\":{\"name\":\"type\",\"example\":\"editor\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be editor.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mytextblock\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Test Field\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"Some text\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties4\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the label.\"},\"properties5\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties6\":{\"name\":\"width\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the width (in pixels) of the wysiwyg editor and defaults to 100%.\"},\"properties7\":{\"name\":\"height\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the height (in pixels) of the wysiwyg editor and defaults to 250px.\"},\"properties8\":{\"name\":\"cols\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the width of the editor (in columns).\"},\"properties9\":{\"name\":\"rows\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) defines the height of the editor (in rows).\"},\"properties10\":{\"name\":\"buttons\",\"example\":\"no\",\"adjustable\":\"1\",\"description\":\"(optional) can be an array of plugin buttons to be excluded or set to false. The default editors-xtd are: article, image, pagebreak and readmore.\"},\"properties11\":{\"name\":\"syntax\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) can be used to set the code syntax matching for this field.\"},\"properties12\":{\"name\":\"hide\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) array of plugin buttons to be hidden. eg... set buttons=\\\"true\\\" hide=\\\"readmore,pagebreak\\\"\"},\"properties13\":{\"name\":\"editor\",\"example\":\"codemirror|none\",\"adjustable\":\"1\",\"description\":\"specifies the editor to be used and can include two options (editor=\\\"desired|alternative\\\")\"},\"properties14\":{\"name\":\"filter\",\"example\":\"safehtml\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties15\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties16\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties17\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'provides an editor area field.', '', 1, 11, '', '', '51f288d2-6eaa-42bc-a182-a6f69b3032b8'), (9, '', 'The hidden form field type provides a hidden field for saving a field whose value cannot be altered directly by a user in the Administrator (it can be altered in code or by editing the params.ini file). If the parameter has a saved value this is entered i', 'Hidden', '{\"properties0\":{\"name\":\"type\",\"example\":\"hidden\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be hidden.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mysecretvariable\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"default\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the data which needs to be collected.\"},\"properties5\":{\"name\":\"filter\",\"example\":\"STRING\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties4\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"}}', 'provides a hidden field for saving a form field whose value cannot be altered directly by a user.', '', 1, 2, '', '', '82f1b5ca-bb9b-44d7-9a7a-9a03fb2a31dd'), -(10, '', 'The integer form field type provides a select box with a range of integer values. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.', 'Integer', '{\"properties0\":{\"name\":\"type\",\"example\":\"integer\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be integer.\"},\"properties1\":{\"name\":\"name\",\"example\":\"size\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Size\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default value.\"},\"properties4\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties5\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties6\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties7\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties8\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties9\":{\"name\":\"first\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) this value is the lowest on the list.\"},\"properties10\":{\"name\":\"last\",\"example\":\"20\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) this value is the highest on the list.\"},\"properties11\":{\"name\":\"step\",\"example\":\"5\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"},\"properties13\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a drop down list of integers between a minimum and maximum.', '', 1, 5, '', '', 'fdbb50ea-35d2-45b2-a0bc-076fdf1544b8'), -(11, '', 'The list form field type provides a drop down list or a list box of custom-defined entries. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.', 'List', '{\"properties0\":{\"name\":\"type\",\"example\":\"list\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be list.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mylist\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an option\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties5\":{\"name\":\"class\",\"example\":\"list_class\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties7\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) filter options\"},\"properties8\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties9\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties10\":{\"name\":\"option\",\"example\":\"0|Option 1,1|Option 2,2|Option 1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties11\":{\"name\":\"useglobal\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) if set to true, it will show the value that is set in the global configuration if found in the database.\"},\"properties12\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) is the default list item value.\"},\"properties13\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\"},\"properties14\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a drop down list of custom-defined entries.', '', 1, 8, '', '', 'a51dfc06-1b9b-4d0a-86ba-f705bcd40d4d'), -(12, '', 'The media form field type provides modal access to the media manager for the choice of an image. Users with appropriate permissions will be able to upload files.', 'Media', '{\"properties0\":{\"name\":\"type\",\"example\":\"media\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be media.\"},\"properties1\":{\"name\":\"name\",\"example\":\"media\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Media\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"directory\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the directory from which the user will be able to choose a file. This attribute should be relative to the top level \\/images\\/ folder.\"},\"properties5\":{\"name\":\"preview\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) shows or hides the preview of the currently chosen image. (\\\"true\\\": Show always, \\\"tooltip\\\": Show as tooltip, \\\"false\\\": Show never) (since Joomla! 2.5.5)\"},\"properties6\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'provides modal access to the media manager for insertion of images with upload for users with appropriate permissions.', '', 1, 3, '', '', '69957007-e3d4-4976-a32b-611d02dbad71'), -(13, '', 'Provides a meter to show value in a range, updated with jQuery if needed or simply a fixed value.', 'Meter', '{\"properties0\":{\"name\":\"type\",\"example\":\"meter\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) must be meter.\"},\"properties1\":{\"name\":\"name\",\"example\":\"meter\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Meter\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"width\",\"example\":\"330px\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is the width of meter box\"},\"properties4\":{\"name\":\"color\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The background color\"},\"properties5\":{\"name\":\"default\",\"example\":\"9\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"animated\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) lets the bar have strips\"},\"properties7\":{\"name\":\"active\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) lets the strips on the bar move\"},\"properties8\":{\"name\":\"description\",\"example\":\"Enter some description\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties9\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties10\":{\"name\":\"min\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(mandatory) this value is the min on the meter.\"},\"properties11\":{\"name\":\"max\",\"example\":\"20\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(mandatory) this value is the max on meter.\"},\"properties12\":{\"name\":\"step\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.\"},\"properties13\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'Provides a meter to show value in a range.', '', 1, 2, '', '', '81668284-e572-4e17-927b-ba697fc64bd0'), -(14, '', 'This form field makes it possible to create titles, texts, descriptions and even alert boxes. It also allows you to bring order in the settings for extensions, by separating them with useful titles. Or adding descriptions for certain settings (without having to rely on the tooltips). Or adding any other text you want.', 'Note', '{\"properties0\":{\"name\":\"type\",\"example\":\"note\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be note\"},\"properties1\":{\"name\":\"name\",\"example\":\"note_one\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"The notice\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory or optional if using description) (translatable) is the descriptive title of the note \"},\"properties3\":{\"name\":\"description\",\"example\":\"The notice description\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional if using label)(translatable) the description\\/text of the note \"},\"properties4\":{\"name\":\"heading\",\"example\":\"h4\",\"adjustable\":\"1\",\"description\":\"(optional) the type of heading element to use for the label (default: h4)\"},\"properties5\":{\"name\":\"class\",\"example\":\"alert\",\"adjustable\":\"1\",\"description\":\"(optional) a class name (or class names), like these examples ( alert, alert alert-info, alert alert-success, alert alert-error )\"},\"properties6\":{\"name\":\"close\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) a value of \'true\' (for alerts) or the value for the data-dismiss of the bootstrap close icon\"},\"properties7\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\"}}', 'supports a one line text field.', '', 1, 4, '', '', 'f9ecacd0-8481-4157-8c71-d7aaefc2b7c3'), -(15, '', 'Provides a one line text box with up-down handles to set a number in the field.', 'Number', '{\"properties0\":{\"name\":\"type\",\"example\":\"number\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be number.\"},\"properties1\":{\"name\":\"name\",\"example\":\"number\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Number\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default value.\"},\"properties4\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties5\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"min\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) this value is the lowest on the list.\"},\"properties8\":{\"name\":\"max\",\"example\":\"40\",\"mandatory\":\"1\",\"description\":\"(mandatory) this value is the highest on the list.\"},\"properties9\":{\"name\":\"step\",\"example\":\"5\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.\"},\"properties10\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Javascript that should run on changing of the value.\"},\"properties11\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'Provides a one line text box with up-down handles to set a number in the field.', '', 1, 3, '', '', '5abd2b73-643b-4273-841a-787991aad968'), -(16, '', 'The password form field type provides a text box for entry of a password. The password characters will be obscured as they are entered. If the field has a saved value this is entered (in obscured form) into the text box. If not, the default value (if any)', 'Password', '{\"properties0\":{\"name\":\"type\",\"example\":\"password\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be password.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mypassword\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Enter A Password\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"default\",\"example\":\"secret\",\"adjustable\":\"1\",\"description\":\"(optional) is the default password.\"},\"properties5\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties6\":{\"name\":\"message\",\"example\":\"Error! Please add password here.\",\"adjustable\":\"1\",\"description\":\"(optional) The error message that will be displayed instead of the default message.\"},\"properties7\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties8\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties10\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties12\":{\"name\":\"field\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) used in validation of \\\"equals\\\" to link the field to match.\"},\"properties13\":{\"name\":\"filter\",\"example\":\"raw\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties14\":{\"name\":\"hint\",\"example\":\"Password Here\",\"adjustable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties15\":{\"name\":\"autocomplete\",\"example\":\"off\",\"adjustable\":\"1\",\"description\":\"(optional) The autocomplete state for the form field. If \'off\' element will not be automatically completed by browser.\"},\"properties16\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"},\"properties17\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a text box for entry of a password. The password characters will be obscured as they are entered.', '', 1, 8, '', '', '0022598d-0ee1-44f2-aa94-c2eb47595f73'), -(17, '', 'The radio form field type provides radio buttons to select different options. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.', 'Radio', '{\"properties0\":{\"name\":\"type\",\"example\":\"radio\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be radio.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myradiovalue\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an option\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"class\",\"example\":\"btn-group btn-group-yesno\",\"adjustable\":\"1\",\"description\":\"(optional) New in Joomla 3, if set to class=\\\"btn-group btn-group-yesno\\\" will show the nice coloured buttons\"},\"properties5\":{\"name\":\"option\",\"example\":\"1|Yes,0|No\",\"adjustable\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties6\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) is the default radio button item value.\"},\"properties7\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties8\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties9\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties10\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties11\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\"},\"properties13\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides radio buttons to select different options.', '', 1, 17, '', '', 'b868ed59-4208-4206-8504-95a35a74a11c'), -(18, '', 'Provides a horizontal scroll bar to specify a value in a range.', 'Range', '{\"properties0\":{\"name\":\"type\",\"example\":\"range\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be range.\"},\"properties1\":{\"name\":\"name\",\"example\":\"range\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Range\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"9\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties4\":{\"name\":\"description\",\"example\":\"Enter some description\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties5\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties6\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties7\":{\"name\":\"min\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(mandatory) this value is the min on the meter.\"},\"properties8\":{\"name\":\"max\",\"example\":\"20\",\"adjustable\":\"1\",\"description\":\"(mandatory) this value is the max on meter.\"},\"properties9\":{\"name\":\"step\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.\"},\"properties10\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties12\":{\"name\":\"onchange\",\"example\":\"jQuery(\'#jform_range\').closest(\'.controls\').find(\'span\').remove(); var value = jQuery(\'#jform_range\').val();jQuery(\'#jform_range\').closest(\'.controls\').append(\' \'+value+\'\');\",\"adjustable\":\"1\",\"description\":\"(optional) javascript to run when the range is changed\"},\"properties13\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'Provides a horizontal scroll bar to specify a value in a range.', '', 1, 4, '', '', '627d3845-7273-4f75-8e63-7b3a319a42c8'), -(19, '', 'Provides a modal with rows of formfields that you specify. As many options can be added as desired. Note this form field has a jQuery based javascript file as a dependency.', 'Repeatable', '{\"properties0\":{\"name\":\"type\",\"example\":\"repeatable\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(mandatory) must be repeatable.\"},\"properties1\":{\"name\":\"name\",\"example\":\"repeatable_list\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the parameter\"},\"properties2\":{\"name\":\"label\",\"example\":\"The Repeatable List\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) description text for the form field. Displays at the top of the modal with the name as well as in the usual position in the form\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The default value for the form field if the field is left empty. Note this has to be a json string compatible with the contents of the form field.\"},\"properties5\":{\"name\":\"id\",\"example\":\"aid\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) id of the hidden from field. (the modal will have this id with an added suffix of \\\"_modal\\\" and the table within the modal will have this id with a suffix of _modal_table\\\")\"},\"properties6\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) class of the table.\"},\"properties7\":{\"name\":\"select\",\"example\":\"Click here\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) The text to show on the modal button.\"},\"properties8\":{\"name\":\"icon\",\"example\":\"list\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The icon to show on the select button (is prefixed with \\\"icon-\\\").\"},\"properties9\":{\"name\":\"maximum\",\"example\":\"50\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The maximum number of rows of fields allowed (by default 999 to be effectively infinite)\"},\"properties10\":{\"name\":\"fields\",\"example\":\"1,2,3\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) The fields to add to the modal. All fields must first be created in component builder as a field before you can add them here, since you must use the id of the field. Separate the field ids with commas. Do not add custom fields that are not also used in this component.\"},\"properties11\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) Use only if you would like to save raw data, since the default is best.\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'Allows form fields which can have as many options as the user desires.', '', 1, 4, '', '', '05bf68d4-52f9-4705-8ae7-cba137fce0ad'), +(10, '', 'The integer form field type provides a select box with a range of integer values. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.', 'Integer', '{\"properties0\":{\"name\":\"type\",\"example\":\"integer\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be integer.\"},\"properties1\":{\"name\":\"name\",\"example\":\"size\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Size\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default value.\"},\"properties4\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties5\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties6\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties7\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties8\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties9\":{\"name\":\"first\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) this value is the lowest on the list.\"},\"properties10\":{\"name\":\"last\",\"example\":\"20\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) this value is the highest on the list.\"},\"properties11\":{\"name\":\"step\",\"example\":\"5\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties13\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a drop down list of integers between a minimum and maximum.', '', 1, 6, '', '', 'fdbb50ea-35d2-45b2-a0bc-076fdf1544b8'), +(11, '', 'The list form field type provides a drop down list or a list box of custom-defined entries. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.', 'List', '{\"properties0\":{\"name\":\"type\",\"example\":\"list\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be list.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mylist\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an option\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties5\":{\"name\":\"class\",\"example\":\"list_class\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties7\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) filter options\"},\"properties8\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties9\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties10\":{\"name\":\"option\",\"example\":\"0|Option 1,1|Option 2,2|Option 1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties11\":{\"name\":\"useglobal\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) if set to true, it will show the value that is set in the global configuration if found in the database.\"},\"properties12\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) is the default list item value.\"},\"properties13\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties14\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a drop down list of custom-defined entries.', '', 1, 9, '', '', 'a51dfc06-1b9b-4d0a-86ba-f705bcd40d4d'), +(12, '', 'The media form field type provides modal access to the media manager for the choice of an image. Users with appropriate permissions will be able to upload files.', 'Media', '{\"properties0\":{\"name\":\"type\",\"example\":\"media\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be media.\"},\"properties1\":{\"name\":\"name\",\"example\":\"media\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Media\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"directory\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the directory from which the user will be able to choose a file. This attribute should be relative to the top level \\/images\\/ folder.\"},\"properties5\":{\"name\":\"preview\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) shows or hides the preview of the currently chosen image. (\\\"true\\\": Show always, \\\"tooltip\\\": Show as tooltip, \\\"false\\\": Show never) (since Joomla! 2.5.5)\"},\"properties6\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'provides modal access to the media manager for insertion of images with upload for users with appropriate permissions.', '', 1, 4, '', '', '69957007-e3d4-4976-a32b-611d02dbad71'), +(13, '', 'Provides a meter to show value in a range, updated with jQuery if needed or simply a fixed value.', 'Meter', '{\"properties0\":{\"name\":\"type\",\"example\":\"meter\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be meter.\"},\"properties1\":{\"name\":\"name\",\"example\":\"meter\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Meter\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"width\",\"example\":\"330px\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of meter box\"},\"properties4\":{\"name\":\"color\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The background color\"},\"properties5\":{\"name\":\"default\",\"example\":\"9\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"animated\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(optional) lets the bar have strips\"},\"properties7\":{\"name\":\"active\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(optional) lets the strips on the bar move\"},\"properties8\":{\"name\":\"description\",\"example\":\"Enter some description\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties9\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties10\":{\"name\":\"min\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(mandatory) this value is the min on the meter.\"},\"properties11\":{\"name\":\"max\",\"example\":\"20\",\"adjustable\":\"1\",\"description\":\"(mandatory) this value is the max on meter.\"},\"properties12\":{\"name\":\"step\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.\"},\"properties13\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'Provides a meter to show value in a range.', '', 1, 3, '', '', '81668284-e572-4e17-927b-ba697fc64bd0'), +(14, '', 'This form field makes it possible to create titles, texts, descriptions and even alert boxes. It also allows you to bring order in the settings for extensions, by separating them with useful titles. Or adding descriptions for certain settings (without having to rely on the tooltips). Or adding any other text you want.', 'Note', '{\"properties0\":{\"name\":\"type\",\"example\":\"note\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be note\"},\"properties1\":{\"name\":\"name\",\"example\":\"note_one\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"The notice\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory or optional if using description) (translatable) is the descriptive title of the note \"},\"properties3\":{\"name\":\"description\",\"example\":\"The notice description\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional if using label)(translatable) the description\\/text of the note \"},\"properties4\":{\"name\":\"heading\",\"example\":\"h4\",\"adjustable\":\"1\",\"description\":\"(optional) the type of heading element to use for the label (default: h4)\"},\"properties5\":{\"name\":\"class\",\"example\":\"alert\",\"adjustable\":\"1\",\"description\":\"(optional) a class name (or class names), like these examples ( alert, alert alert-info, alert alert-success, alert alert-error )\"},\"properties6\":{\"name\":\"close\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) a value of \'true\' (for alerts) or the value for the data-dismiss of the bootstrap close icon\"},\"properties7\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'supports a one line text field.', '', 1, 5, '', '', 'f9ecacd0-8481-4157-8c71-d7aaefc2b7c3'), +(15, '', 'Provides a one line text box with up-down handles to set a number in the field.', 'Number', '{\"properties0\":{\"name\":\"type\",\"example\":\"number\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be number.\"},\"properties1\":{\"name\":\"name\",\"example\":\"number\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Number\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default value.\"},\"properties4\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties5\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"min\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) this value is the lowest on the list.\"},\"properties8\":{\"name\":\"max\",\"example\":\"40\",\"mandatory\":\"1\",\"description\":\"(mandatory) this value is the highest on the list.\"},\"properties9\":{\"name\":\"step\",\"example\":\"5\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.\"},\"properties10\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Javascript that should run on changing of the value.\"},\"properties11\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'Provides a one line text box with up-down handles to set a number in the field.', '', 1, 4, '', '', '5abd2b73-643b-4273-841a-787991aad968'), +(16, '', 'The password form field type provides a text box for entry of a password. The password characters will be obscured as they are entered. If the field has a saved value this is entered (in obscured form) into the text box. If not, the default value (if any)', 'Password', '{\"properties0\":{\"name\":\"type\",\"example\":\"password\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be password.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mypassword\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Enter A Password\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"default\",\"example\":\"secret\",\"adjustable\":\"1\",\"description\":\"(optional) is the default password.\"},\"properties5\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties6\":{\"name\":\"message\",\"example\":\"Error! Please add password here.\",\"adjustable\":\"1\",\"description\":\"(optional) The error message that will be displayed instead of the default message.\"},\"properties7\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties8\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties10\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties12\":{\"name\":\"field\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) used in validation of \\\"equals\\\" to link the field to match.\"},\"properties13\":{\"name\":\"filter\",\"example\":\"raw\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties14\":{\"name\":\"hint\",\"example\":\"Password Here\",\"adjustable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties15\":{\"name\":\"autocomplete\",\"example\":\"off\",\"adjustable\":\"1\",\"description\":\"(optional) The autocomplete state for the form field. If \'off\' element will not be automatically completed by browser.\"},\"properties16\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties17\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a text box for entry of a password. The password characters will be obscured as they are entered.', '', 1, 9, '', '', '0022598d-0ee1-44f2-aa94-c2eb47595f73'), +(17, '', 'The radio form field type provides radio buttons to select different options. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.', 'Radio', '{\"properties0\":{\"name\":\"type\",\"example\":\"radio\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be radio.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myradiovalue\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an option\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"class\",\"example\":\"btn-group btn-group-yesno\",\"adjustable\":\"1\",\"description\":\"(optional) New in Joomla 3, if set to class=\\\"btn-group btn-group-yesno\\\" will show the nice coloured buttons\"},\"properties5\":{\"name\":\"option\",\"example\":\"1|Yes,0|No\",\"adjustable\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties6\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) is the default radio button item value.\"},\"properties7\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties8\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties9\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties10\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties11\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties13\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides radio buttons to select different options.', '', 1, 18, '', '', 'b868ed59-4208-4206-8504-95a35a74a11c'), +(18, '', 'Provides a horizontal scroll bar to specify a value in a range.', 'Range', '{\"properties0\":{\"name\":\"type\",\"example\":\"range\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be range.\"},\"properties1\":{\"name\":\"name\",\"example\":\"range\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Range\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"9\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties4\":{\"name\":\"description\",\"example\":\"Enter some description\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties5\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties6\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties7\":{\"name\":\"min\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(mandatory) this value is the min on the meter.\"},\"properties8\":{\"name\":\"max\",\"example\":\"20\",\"adjustable\":\"1\",\"description\":\"(mandatory) this value is the max on meter.\"},\"properties9\":{\"name\":\"step\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.\"},\"properties10\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties12\":{\"name\":\"onchange\",\"example\":\"jQuery(\'#jform_range\').closest(\'.controls\').find(\'span\').remove(); var value = jQuery(\'#jform_range\').val();jQuery(\'#jform_range\').closest(\'.controls\').append(\' \'+value+\'\');\",\"adjustable\":\"1\",\"description\":\"(optional) javascript to run when the range is changed\"},\"properties13\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'Provides a horizontal scroll bar to specify a value in a range.', '', 1, 5, '', '', '627d3845-7273-4f75-8e63-7b3a319a42c8'), +(19, '', 'Provides a modal with rows of formfields that you specify. As many options can be added as desired. Note this form field has a jQuery based javascript file as a dependency.', 'Repeatable', '{\"properties0\":{\"name\":\"type\",\"example\":\"repeatable\",\"adjustable\":\"1\",\"description\":\"(mandatory) must be repeatable.\"},\"properties1\":{\"name\":\"name\",\"example\":\"repeatable_list\",\"adjustable\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter\"},\"properties2\":{\"name\":\"label\",\"example\":\"The Repeatable List\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) description text for the form field. Displays at the top of the modal with the name as well as in the usual position in the form\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The default value for the form field if the field is left empty. Note this has to be a json string compatible with the contents of the form field.\"},\"properties5\":{\"name\":\"id\",\"example\":\"aid\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) id of the hidden from field. (the modal will have this id with an added suffix of \\\"_modal\\\" and the table within the modal will have this id with a suffix of _modal_table\\\")\"},\"properties6\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) class of the table.\"},\"properties7\":{\"name\":\"select\",\"example\":\"Click here\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) The text to show on the modal button.\"},\"properties8\":{\"name\":\"icon\",\"example\":\"list\",\"adjustable\":\"1\",\"description\":\"(optional) The icon to show on the select button (is prefixed with \\\"icon-\\\").\"},\"properties9\":{\"name\":\"maximum\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) The maximum number of rows of fields allowed (by default 999 to be effectively infinite)\"},\"properties10\":{\"name\":\"fields\",\"example\":\"1,2,3\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The fields to add to the modal. All fields must first be created in component builder as a field before you can add them here, since you must use the id of the field. Separate the field ids with commas. Do not add custom fields that are not also used in this component.\"},\"properties11\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Use only if you would like to save raw data, since the default is best.\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'Allows form fields which can have as many options as the user desires.', '', 1, 5, '', '', '05bf68d4-52f9-4705-8ae7-cba137fce0ad'), (20, '', 'The spacer form field type provides a visual separator between parameter field elements. It is purely a visual aid and no field value is stored.', 'Spacer', '{\"properties0\":{\"name\":\"type\",\"example\":\"spacer\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) must be spacer.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myspacer\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"The notice\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is the text to use as a spacer.\"},\"properties3\":{\"name\":\"description\",\"example\":\"The notice description\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"hr\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is whether to display a horizontal rule (\'true\' or \'false\'). If this attribute is \'true\', the label attribute will be ignored.\"},\"properties5\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"}}', 'provides a visual separator between form fields. It is purely a visual aid and no value is stored.', '', 1, 1, '', '', '626d0cba-a908-4a4f-a447-96d781aeaa0b'), -(21, '', 'Using this generic form field type forces you to write SQL in an XML file and is rather limited. For more flexibility, consider using Custom FieldType.\r\n\r\nThe sql form field type provides a drop down list of entries obtained by running a query on the Joom', 'SQL', '{\"properties0\":{\"name\":\"type\",\"example\":\"sql\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) must be sql.\"},\"properties1\":{\"name\":\"name\",\"example\":\"title\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an article\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"query\",\"example\":\"SELECT id, concat( title, \' (\', created, \')\') AS title FROM #__content\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the SQL query which will provide the data for the drop-down list. The query must return two columns; one called \'value\' (unless overridden by the key_field attribute) which will hold the values of the list items; the other called the same as the value of the name attribute (unless overridden by the value_field attribute) containing the text to be shown in the drop-down list.\"},\"properties4\":{\"name\":\"default\",\"example\":\"10\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is the default value. This is the value of the \'value\' field, unless overridden by the key_field attribute.\"},\"properties5\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties6\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties7\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties8\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties9\":{\"name\":\"key_field\",\"example\":\"id\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is the name of the column that will contain values for the parameter. If omitted then the column called \'value\' will be used, if it exists.\"},\"properties10\":{\"name\":\"value_field\",\"example\":\"title\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is the name of the column that will contain values to be shown to the user in the drop-down list. If omitted then the column with the same name as the name attribute will be used, if it exists.\"},\"properties11\":{\"name\":\"translate\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) will translate the output of the value_field if set to true. It defaults to false.\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'provides a drop down list of entries obtained by running a query on the Joomla Database. The first results column returned by the query provides the values for the drop down box.', '', 1, 2, '', '', 'd4c16f1e-fd6e-4714-90eb-f9d97edd9c32'), -(22, '', 'The Tag field type provides a point where you can enter tags - this is either AJAX or nested.', 'Tag', '{\"properties0\":{\"name\":\"type\",\"example\":\"tag\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) must be tag.\"},\"properties1\":{\"name\":\"name\",\"example\":\"tags\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"mode\",\"example\":\"ajax\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the way the tags will be loaded, the options are ( ajax or nested )\"},\"properties3\":{\"name\":\"label\",\"example\":\"Tags\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties4\":{\"name\":\"description\",\"example\":\"Assign tags to ###VIEW### items. Tag names must be unique.\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is the description of the field.\"},\"properties5\":{\"name\":\"id\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is the id to add to the field. Note if none is set this will be the name of the field.\"},\"properties6\":{\"name\":\"class\",\"example\":\"inputbox small\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is the class to add to the field.\"},\"properties7\":{\"name\":\"published\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) determines if non published tags should be allowed.\"},\"properties8\":{\"name\":\"language\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is language to filter the existing tags by.\"},\"properties9\":{\"name\":\"multiple\",\"example\":\"true\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is the ability to add more than 1 tag to the form field.\"},\"properties10\":{\"name\":\"custom\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) if the ajax mode is chosen setting this to [deny] will prevent users from adding in new tags.\"},\"properties11\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'provides an entry point for tags (either AJAX or Nested).', '', 1, 2, '', '', '48cba89e-8fcb-481e-a7d3-2e41773e452d'), -(23, '', 'The tel field type is an alias for a text field. Telephone numbers can be validated using the tel rule and filtered using the tel input filter.', 'Tel', '{\"properties0\":{\"name\":\"type\",\"example\":\"text\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be text.\"},\"properties1\":{\"name\":\"name\",\"example\":\"phone\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Phone\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"maxlength\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) limits the number of characters that may be entered.\"},\"properties5\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Enter phone number\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties7\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties8\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties10\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"name\":\"filter\",\"example\":\"tel\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties12\":{\"name\":\"validated\",\"example\":\"tel\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to validated the input data.\"},\"properties13\":{\"name\":\"message\",\"example\":\"Error! Please add phone number here.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The error message that will be displayed instead of the default message.\"},\"properties14\":{\"name\":\"hint\",\"example\":\"Your Phone Number\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties15\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\"},\"properties16\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides an input field for a telephone number.', '', 1, 5, '', '', '1c6c519c-3bc8-4914-8940-3e9591b0bce6'), -(24, '', 'The text form field type provides a text box for data entry. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.', 'Text', '{\"properties0\":{\"name\":\"type\",\"example\":\"text\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be text.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mytextvalue\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Enter some text\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"maxlength\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) limits the number of characters that may be entered.\"},\"properties5\":{\"name\":\"default\",\"example\":\"Some text\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Enter some description\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties7\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties8\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties10\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"name\":\"filter\",\"example\":\"STRING\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties12\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties13\":{\"name\":\"field\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) used in validation of \\\"equals\\\" to link the field to match.\"},\"properties14\":{\"name\":\"message\",\"example\":\"Error! Please add some text here.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The error message that will be displayed instead of the default message.\"},\"properties15\":{\"name\":\"hint\",\"example\":\"Your Name Here\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties16\":{\"name\":\"autocomplete\",\"example\":\"on\",\"adjustable\":\"1\",\"description\":\"(optional) The autocomplete state for the form field. If \'off\' element will not be automatically completed by browser.\"},\"properties17\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\"},\"properties18\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a text box for data entry.', '', 1, 9, '', '', '201327fe-3067-4316-a155-3fe2a52e05c0'), -(25, '', 'The textarea form field type provides a text area for entry of multi-line text. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.', 'Textarea', '{\"properties0\":{\"name\":\"type\",\"example\":\"textarea\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be textarea.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mytextarea\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Enter some text\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"rows\",\"example\":\"10\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the height of the visible text area in lines. If omitted the width is determined by the browser. The value of rows does not limit the number of lines that may be entered.\"},\"properties4\":{\"name\":\"cols\",\"example\":\"5\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the width of the visible text area in characters. If omitted the width is determined by the browser. The value of cols does not limit the number of characters that may be entered.\"},\"properties5\":{\"name\":\"default\",\"example\":\"default text\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Text Area\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the label.\"},\"properties7\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties8\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties9\":{\"name\":\"filter\",\"example\":\"raw\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties10\":{\"name\":\"hint\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the textarea.\"},\"properties11\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties12\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties13\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties14\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties15\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\"},\"properties16\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a text area for entry of multi-line text.', '', 1, 8, '', '', '76fe1250-6fa7-49e5-a0ee-f06d8d4c9f99'), -(26, '', 'The timezones form field type provides a drop down list of time zones. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.', 'Timezone', '{\"properties0\":{\"name\":\"type\",\"example\":\"timezone\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) must be timezone.\"},\"properties1\":{\"name\":\"name\",\"example\":\"timezone\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Timezone\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is the default time zone. For example, use \'-10\' for \'(UTC -10:00) Hawaii\'.\"},\"properties4\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties5\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'provides a drop down list of time zones.', '', 1, 2, '', '', 'ed8d8cf4-cb05-49cc-95ef-4ef275f539f9'), -(27, '', 'This field essentially is a text field with the type of url. If a fully qualified url (that is one with a scheme and domain such as http://example.com) is entered and it uses idn (that is uses characters that are non ascii such as ê or Ψ) it will translat', 'URL', '{\"properties0\":{\"name\":\"type\",\"example\":\"url\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be url.\"},\"properties1\":{\"name\":\"name\",\"example\":\"website\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Website\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"maxlength\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) limits the number of characters that may be entered.\"},\"properties5\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Enter website address\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties7\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties8\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties10\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"name\":\"relative\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) set to true for relative URLs\"},\"properties12\":{\"name\":\"filter\",\"example\":\"url\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties13\":{\"name\":\"validated\",\"example\":\"url\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties14\":{\"name\":\"scheme\",\"example\":\"http,https,mailto\",\"adjustable\":\"1\",\"description\":\"(optional) Validates that the value is a URL with a valid scheme (which can be restricted by the optional comma-separated field \'scheme\'), and passes a basic syntax check.\"},\"properties15\":{\"name\":\"message\",\"example\":\"Error! Please add website here.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties16\":{\"name\":\"hint\",\"example\":\"Your Website Here\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties17\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\"},\"properties18\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a URL text input field.', '', 1, 8, '', '', '8df6e07e-2b16-43ed-a18d-2059fa44cdf1'), -(28, '', 'The user form field type provides a modal select box of users.', 'User', '{\"properties0\":{\"name\":\"type\",\"example\":\"user\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be user.\"},\"properties1\":{\"name\":\"name\",\"example\":\"user\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute.\"},\"properties2\":{\"name\":\"label\",\"example\":\"User\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"},\"properties5\":{\"name\":\"size\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'provides a modal list of users.', '', 1, 3, '', '', 'b0641980-5e78-42f6-972f-86aa607db23e'), -(29, '', 'The usergroup form field type provides a modal select box of user groups.', 'Usergroup', '{\"properties0\":{\"name\":\"type\",\"example\":\"usergroup\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) must be usergroup.\"},\"properties1\":{\"name\":\"name\",\"example\":\"usergroup\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Group\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Select a group\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"},\"properties5\":{\"name\":\"size\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is the field required true if yes.\"},\"properties7\":{\"name\":\"multiple\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) If set to multiple then allows more than one usergroup to be selected.\"},\"properties8\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'provides a drop down list of user groups.', '', 1, 2, '', '', 'e2f31181-fbb3-4c3a-859d-72b6b0cff308'), -(30, '', 'The filelist form field type provides a drop down list of files from a specified directory. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.\r\n\r\nBy default, the first item on the', 'Filelist', '{\"properties0\":{\"name\":\"type\",\"example\":\"filelist\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be filelist.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myfile\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a file\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"directory\",\"example\":\"images\\/stories\",\"adjustable\":\"1\",\"description\":\"(optional) is the filesystem path to the directory containing the files to be listed. If omitted the directory given by JPATH_ROOT is assumed.\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default file name.\"},\"properties5\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties6\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to filter the list of files selected for inclusion in the drop-down list. If omitted, all files in the directory are included. The filter argument expression is applied before the exclude argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties7\":{\"name\":\"exclude\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to exclude files from the list. The exclude argument expression is applied after the filter argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties8\":{\"name\":\"stripext\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true then file name extensions will be stripped from the file names listed. Also note that the file name will be saved without the extension too.\"},\"properties9\":{\"name\":\"hide_none\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true, the \'- Do not use -\' item is omitted from the drop-down list.\"},\"properties10\":{\"name\":\"hide_default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true, the \'- Use default -\' item is omitted from the drop-down list.\"},\"properties11\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'Provides a drop down list of files from a specified directory.', '', 1, 3, '', 1, '0c80df15-52c6-4647-983b-4bb4888a2edf'), -(31, '', 'The folderlist form field type provides a drop down list of folders from a specfied directory. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.\r\n\r\nBy default, the first item on ', 'Folderlist', '{\"properties0\":{\"name\":\"type\",\"example\":\"folderlist\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be folderlist.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myfolder\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a folder\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"directory\",\"example\":\"images\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the filesystem path to the directory containing the folders to be listed.\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default folder name.\"},\"properties5\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties6\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to filter the list of folders selected for inclusion in the drop-down list. If omitted, all folders in the directory are included. The filter argument expression is applied before the exclude argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties7\":{\"name\":\"exclude\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to exclude folders from the list. The exclude argument expression is applied after the filter argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties8\":{\"name\":\"hide_none\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true, the \'- Do not use -\' item is omitted from the drop-down list.\"},\"properties9\":{\"name\":\"hide_default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true, the \'- Use default -\' item is omitted from the drop-down list.\"},\"properties10\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'Provides a drop down list of folders from a specified directory.', '', 1, 3, '', 2, 'd3ab2ae4-9370-4497-ae6d-dee2e0b74b7a'), -(32, '', 'Note: When using the file input type you should always add the attribute enctype=\"multipart/form-data\" to your form tag. Otherwise, the uploaded files will not be attached correctly.\r\n\r\nNote 2: You can put a soft limit file size by adding a hidden field with name=\"MAX_FILE_SIZE\" and value the maximum allowed bytes which is handled by php, but you must also handle it in your code with or without it.', 'File', '{\"properties0\":{\"name\":\"type\",\"example\":\"file\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be file.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myfilevalue\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Enter some text\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Choose an image from your computer with maximum 100KB\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value, but doesn\'t mean much for a file.\"},\"properties5\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the file box in characters.\"},\"properties6\":{\"name\":\"accept\",\"example\":\"image\\/*\",\"adjustable\":\"1\",\"description\":\"(optional) Tells the browser what MIME types<\\/a> your form will allow to be uploaded.\"},\"properties7\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"},\"properties8\":{\"name\":\"labelclass\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) adds a CSS class for form field\'s label; for Joomla 2.5.4+\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute\"},\"properties10\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"},\"properties11\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) For Joomla form validating it to be filled in\"},\"properties12\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Whether to Joomla validate the field according to rules\"},\"properties13\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\"}}', 'Provides an input field for files', '', 1, 8, '', 3, '6da71c1e-119c-4e0d-a309-f3e52ecfa1d1'), -(33, '', 'The menuitem form field type provides a drop down grouped list of the available menu items from your Joomla site.', 'menuitem', '{\"properties0\":{\"name\":\"type\",\"example\":\"menuitem\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be menuitem.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mymenuitem\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a menu item\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default menu item. Note that this is the ItemID number of the menu item.\"},\"properties4\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties5\":{\"name\":\"published\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) determines whether all menu items are listed or only published menu items. If state is \'0\' then all menu items will be listed. If state is \'1\' then only published menu items will be listed.\"},\"properties6\":{\"name\":\"filter\",\"example\":\"int\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties7\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\"}}', 'provides a drop down list of the available menu items from your Joomla site.', '', 1, 4, '', 4, 'f183b0e2-017f-48bd-8dba-d332ce1b8d9e'), -(34, '', 'Remember all views already have [accesslevel] added by default, only add this if you need more custom access selection! Provides a dropdown list of accesslevel options with the current option selected.', 'Accesslevel', '{\"properties0\":{\"name\":\"type\",\"example\":\"accesslevel\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be accesslevel\"},\"properties1\":{\"name\":\"name\",\"example\":\"accesstwo\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute. \"},\"properties2\":{\"name\":\"label\",\"example\":\"Access Two\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Select an access level to this concept.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"},\"properties5\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the field required true if yes.\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) If set to multiple then allows more than one usergroup to be selected.\"},\"properties7\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'List of accesslevels', '', 1, 3, '', 5, '913ed2ce-836c-48e8-97af-e482441f47df'), -(35, '', 'Provides a form with rows of fields that you specify. As many options can be added as desired. Note this form field has a jQuery based javascript file as a dependency.', 'Subform', '{\"properties0\":{\"name\":\"type\",\"example\":\"subform\",\"description\":\"(mandatory) must be subform.\"},\"properties1\":{\"name\":\"name\",\"example\":\"options\",\"adjustable\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter\"},\"properties2\":{\"name\":\"label\",\"example\":\"The Option List\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"layout\",\"example\":\"joomla.form.field.subform.repeatable-table\",\"adjustable\":\"1\",\"description\":\"(mandatory) The layout for the repeatable table.\"},\"properties4\":{\"name\":\"component\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) To change the component where it should search for layout\"},\"properties5\":{\"name\":\"client\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Function to initialise the application client
    Frontend: site<\\/code> or 0<\\/code>
    Backend: admin<\\/code> or 1<\\/code>\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"true\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The rows to be multiple.\"},\"properties7\":{\"name\":\"buttons\",\"example\":\"add,remove,move\",\"adjustable\":\"1\",\"description\":\"(optional) Which buttons to show if multiple mode is true.
    Options: add,remove,move<\\/code>\"},\"properties8\":{\"name\":\"fields\",\"example\":\"1,2,3\",\"adjustable\":\"1\",\"description\":\"(mandatory) The fields to add to the modal. All fields must first be created in component builder as a field before you can add them here, since you must use the id of the field. Separate the field ids with commas. Do not add custom fields that are not also used in this component.\"},\"properties9\":{\"name\":\"formsource\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) you can add a path to a xml file containing the fields.\"},\"properties10\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) description text for the form field. Displays at the top of the modal with the name as well as in the usual position in the form\"},\"properties11\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The default value for the form field if the field is left empty. Note this has to be a json string compatible with the contents of the form field.\"},\"properties12\":{\"name\":\"icon\",\"example\":\"list\",\"adjustable\":\"1\",\"description\":\"(optional) The icon to show on the select button (is prefixed with \\\"icon-\\\").\"},\"properties13\":{\"name\":\"max\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) The maximum number of rows of fields allowed (by default 999 to be effectively infinite)\"},\"properties14\":{\"name\":\"min\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The minimum number of rows of fields required\"},\"properties15\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Use only if you would like to save raw data, since the default is best.\"},\"properties16\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'Allows form fields which can have as many options as the user desires.', '', 1, 13, '', 6, '7139f2c8-a70a-46a6-bbe3-4eefe54ca515'), -(36, '', 'Provides an input field for an email address.', 'Email', '{\"properties0\":{\"name\":\"type\",\"example\":\"email\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be email.\"},\"properties1\":{\"name\":\"name\",\"example\":\"email\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Email Address\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"maxlength\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) limits the number of characters that may be entered.\"},\"properties5\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Enter some description\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties7\":{\"name\":\"class\",\"example\":\"inputbox\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties8\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties10\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"name\":\"filter\",\"example\":\"STRING\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties12\":{\"name\":\"validate\",\"example\":\"email\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties13\":{\"name\":\"unique\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) Used in validation, to check if we should test for uniqueness, to insure that this email does not already belong to another user. Check line 99 in \\/libraries\\/src\\/Form\\/Rule\\/EmailRule.php\"},\"properties14\":{\"name\":\"field\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) used in validation of \\\"equals\\\" to link the field to match.\"},\"properties15\":{\"name\":\"message\",\"example\":\"Error! Please add some text here.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The error message that will be displayed instead of the default message.\"},\"properties16\":{\"name\":\"hint\",\"example\":\"your@email.com\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties17\":{\"name\":\"autocomplete\",\"example\":\"on\",\"adjustable\":\"1\",\"description\":\"(optional) The autocomplete state for the form field. If \'off\' element will not be automatically completed by browser.\"},\"properties18\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\"},\"properties19\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'Email form field type', '', 1, 6, '', 7, '35948af5-9e79-4454-8dfa-682ee4fdf650'), -(37, '', 'Provides a dropdown list of plugin options from the folder.', 'Plugins', '{\"properties0\":{\"name\":\"type\",\"example\":\"plugins\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be editors.\"},\"properties1\":{\"name\":\"name\",\"example\":\"editor\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an editor\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties4\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the label.\"},\"properties8\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties5\":{\"name\":\"folder\",\"example\":\"editors\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) editors or captcha.\"},\"properties6\":{\"name\":\"filter\",\"example\":\"cmd\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties7\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'Provides a dropdown list of plugin options from the folder.', '', 1, 7, '', 8, '37fa4e1d-b7ca-4a8f-aa4b-d8085c135233'), +(21, '', 'Using this generic form field type forces you to write SQL in an XML file and is rather limited. For more flexibility, consider using Custom FieldType.\r\n\r\nThe sql form field type provides a drop down list of entries obtained by running a query on the Joom', 'SQL', '{\"properties0\":{\"name\":\"type\",\"example\":\"sql\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be sql.\"},\"properties1\":{\"name\":\"name\",\"example\":\"title\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an article\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"query\",\"example\":\"SELECT id, concat( title, \' (\', created, \')\') AS title FROM #__content\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the SQL query which will provide the data for the drop-down list. The query must return two columns; one called \'value\' (unless overridden by the key_field attribute) which will hold the values of the list items; the other called the same as the value of the name attribute (unless overridden by the value_field attribute) containing the text to be shown in the drop-down list.\"},\"properties4\":{\"name\":\"default\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the default value. This is the value of the \'value\' field, unless overridden by the key_field attribute.\"},\"properties5\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties6\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties7\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties8\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties9\":{\"name\":\"key_field\",\"example\":\"id\",\"adjustable\":\"1\",\"description\":\"(optional) is the name of the column that will contain values for the parameter. If omitted then the column called \'value\' will be used, if it exists.\"},\"properties10\":{\"name\":\"value_field\",\"example\":\"title\",\"adjustable\":\"1\",\"description\":\"(optional) is the name of the column that will contain values to be shown to the user in the drop-down list. If omitted then the column with the same name as the name attribute will be used, if it exists.\"},\"properties11\":{\"name\":\"translate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) will translate the output of the value_field if set to true. It defaults to false.\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'provides a drop down list of entries obtained by running a query on the Joomla Database. The first results column returned by the query provides the values for the drop down box.', '', 1, 3, '', '', 'd4c16f1e-fd6e-4714-90eb-f9d97edd9c32'), +(22, '', 'The Tag field type provides a point where you can enter tags - this is either AJAX or nested.', 'Tag', '{\"properties0\":{\"name\":\"type\",\"example\":\"tag\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be tag.\"},\"properties1\":{\"name\":\"name\",\"example\":\"tags\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"mode\",\"example\":\"ajax\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the way the tags will be loaded, the options are ( ajax or nested )\"},\"properties3\":{\"name\":\"label\",\"example\":\"Tags\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties4\":{\"name\":\"description\",\"example\":\"Assign tags to ###VIEW### items. Tag names must be unique.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is the description of the field.\"},\"properties5\":{\"name\":\"id\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the id to add to the field. Note if none is set this will be the name of the field.\"},\"properties6\":{\"name\":\"class\",\"example\":\"inputbox small\",\"adjustable\":\"1\",\"description\":\"(optional) is the class to add to the field.\"},\"properties7\":{\"name\":\"published\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) determines if non published tags should be allowed.\"},\"properties8\":{\"name\":\"language\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is language to filter the existing tags by.\"},\"properties9\":{\"name\":\"multiple\",\"example\":\"true\",\"adjustable\":\"1\",\"description\":\"(optional) is the ability to add more than 1 tag to the form field.\"},\"properties10\":{\"name\":\"custom\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) if the ajax mode is chosen setting this to [deny] will prevent users from adding in new tags.\"},\"properties11\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'provides an entry point for tags (either AJAX or Nested).', '', 1, 3, '', '', '48cba89e-8fcb-481e-a7d3-2e41773e452d'), +(23, '', 'The tel field type is an alias for a text field. Telephone numbers can be validated using the tel rule and filtered using the tel input filter.', 'Tel', '{\"properties0\":{\"name\":\"type\",\"example\":\"text\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be text.\"},\"properties1\":{\"name\":\"name\",\"example\":\"phone\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Phone\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"maxlength\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) limits the number of characters that may be entered.\"},\"properties5\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Enter phone number\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties7\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties8\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties10\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"name\":\"filter\",\"example\":\"tel\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties12\":{\"name\":\"validated\",\"example\":\"tel\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to validated the input data.\"},\"properties13\":{\"name\":\"message\",\"example\":\"Error! Please add phone number here.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The error message that will be displayed instead of the default message.\"},\"properties14\":{\"name\":\"hint\",\"example\":\"Your Phone Number\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties15\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties16\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides an input field for a telephone number.', '', 1, 6, '', '', '1c6c519c-3bc8-4914-8940-3e9591b0bce6'), +(24, '', 'The text form field type provides a text box for data entry. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.', 'Text', '{\"properties0\":{\"name\":\"type\",\"example\":\"text\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be text.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mytextvalue\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Enter some text\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"maxlength\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) limits the number of characters that may be entered.\"},\"properties5\":{\"name\":\"default\",\"example\":\"Some text\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Enter some description\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties7\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties8\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties10\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"name\":\"filter\",\"example\":\"STRING\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties12\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties13\":{\"name\":\"field\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) used in validation of \\\"equals\\\" to link the field to match.\"},\"properties14\":{\"name\":\"message\",\"example\":\"Error! Please add some text here.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The error message that will be displayed instead of the default message.\"},\"properties15\":{\"name\":\"hint\",\"example\":\"Your Name Here\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties16\":{\"name\":\"autocomplete\",\"example\":\"on\",\"adjustable\":\"1\",\"description\":\"(optional) The autocomplete state for the form field. If \'off\' element will not be automatically completed by browser.\"},\"properties17\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties18\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a text box for data entry.', '', 1, 10, '', '', '201327fe-3067-4316-a155-3fe2a52e05c0'), +(25, '', 'The textarea form field type provides a text area for entry of multi-line text. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.', 'Textarea', '{\"properties0\":{\"name\":\"type\",\"example\":\"textarea\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be textarea.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mytextarea\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Enter some text\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"rows\",\"example\":\"10\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the height of the visible text area in lines. If omitted the width is determined by the browser. The value of rows does not limit the number of lines that may be entered.\"},\"properties4\":{\"name\":\"cols\",\"example\":\"5\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the width of the visible text area in characters. If omitted the width is determined by the browser. The value of cols does not limit the number of characters that may be entered.\"},\"properties5\":{\"name\":\"default\",\"example\":\"default text\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Text Area\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the label.\"},\"properties7\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties8\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties9\":{\"name\":\"filter\",\"example\":\"raw\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties10\":{\"name\":\"hint\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the textarea.\"},\"properties11\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties12\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties13\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties14\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties15\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties16\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a text area for entry of multi-line text.', '', 1, 9, '', '', '76fe1250-6fa7-49e5-a0ee-f06d8d4c9f99'), +(26, '', 'The timezones form field type provides a drop down list of time zones. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.', 'Timezone', '{\"properties0\":{\"name\":\"type\",\"example\":\"timezone\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be timezone.\"},\"properties1\":{\"name\":\"name\",\"example\":\"timezone\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Timezone\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default time zone. For example, use \'-10\' for \'(UTC -10:00) Hawaii\'.\"},\"properties4\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties5\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'provides a drop down list of time zones.', '', 1, 3, '', '', 'ed8d8cf4-cb05-49cc-95ef-4ef275f539f9'), +(27, '', 'This field essentially is a text field with the type of url. If a fully qualified url (that is one with a scheme and domain such as http://example.com) is entered and it uses idn (that is uses characters that are non ascii such as ê or Ψ) it will translat', 'URL', '{\"properties0\":{\"name\":\"type\",\"example\":\"url\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be url.\"},\"properties1\":{\"name\":\"name\",\"example\":\"website\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Website\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"maxlength\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) limits the number of characters that may be entered.\"},\"properties5\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Enter website address\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties7\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties8\":{\"name\":\"readonly\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties10\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"name\":\"relative\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) set to true for relative URLs\"},\"properties12\":{\"name\":\"filter\",\"example\":\"url\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties13\":{\"name\":\"validated\",\"example\":\"url\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties14\":{\"name\":\"scheme\",\"example\":\"http,https,mailto\",\"adjustable\":\"1\",\"description\":\"(optional) Validates that the value is a URL with a valid scheme (which can be restricted by the optional comma-separated field \'scheme\'), and passes a basic syntax check.\"},\"properties15\":{\"name\":\"message\",\"example\":\"Error! Please add website here.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties16\":{\"name\":\"hint\",\"example\":\"Your Website Here\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties17\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties18\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a URL text input field.', '', 1, 9, '', '', '8df6e07e-2b16-43ed-a18d-2059fa44cdf1'), +(28, '', 'The user form field type provides a modal select box of users.', 'User', '{\"properties0\":{\"name\":\"type\",\"example\":\"user\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be user.\"},\"properties1\":{\"name\":\"name\",\"example\":\"user\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute.\"},\"properties2\":{\"name\":\"label\",\"example\":\"User\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"},\"properties5\":{\"name\":\"size\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'provides a modal list of users.', '', 1, 4, '', '', 'b0641980-5e78-42f6-972f-86aa607db23e'), +(29, '', 'The usergroup form field type provides a modal select box of user groups.', 'Usergroup', '{\"properties0\":{\"name\":\"type\",\"example\":\"usergroup\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be usergroup.\"},\"properties1\":{\"name\":\"name\",\"example\":\"usergroup\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Group\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Select a group\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"},\"properties5\":{\"name\":\"size\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the field required true if yes.\"},\"properties7\":{\"name\":\"multiple\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) If set to multiple then allows more than one usergroup to be selected.\"},\"properties8\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'provides a drop down list of user groups.', '', 1, 3, '', '', 'e2f31181-fbb3-4c3a-859d-72b6b0cff308'), +(30, '', 'The filelist form field type provides a drop down list of files from a specified directory. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.\r\n\r\nBy default, the first item on the', 'Filelist', '{\"properties0\":{\"name\":\"type\",\"example\":\"filelist\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be filelist.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myfile\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a file\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"directory\",\"example\":\"images\\/stories\",\"adjustable\":\"1\",\"description\":\"(optional) is the filesystem path to the directory containing the files to be listed. If omitted the directory given by JPATH_ROOT is assumed.\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default file name.\"},\"properties5\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties6\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to filter the list of files selected for inclusion in the drop-down list. If omitted, all files in the directory are included. The filter argument expression is applied before the exclude argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties7\":{\"name\":\"exclude\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to exclude files from the list. The exclude argument expression is applied after the filter argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties8\":{\"name\":\"stripext\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true then file name extensions will be stripped from the file names listed. Also note that the file name will be saved without the extension too.\"},\"properties9\":{\"name\":\"hide_none\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true, the \'- Do not use -\' item is omitted from the drop-down list.\"},\"properties10\":{\"name\":\"hide_default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true, the \'- Use default -\' item is omitted from the drop-down list.\"},\"properties11\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'Provides a drop down list of files from a specified directory.', '', 1, 4, '', 1, '0c80df15-52c6-4647-983b-4bb4888a2edf'), +(31, '', 'The folderlist form field type provides a drop down list of folders from a specfied directory. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.\r\n\r\nBy default, the first item on ', 'Folderlist', '{\"properties0\":{\"name\":\"type\",\"example\":\"folderlist\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be folderlist.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myfolder\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a folder\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"directory\",\"example\":\"images\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the filesystem path to the directory containing the folders to be listed.\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default folder name.\"},\"properties5\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties6\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to filter the list of folders selected for inclusion in the drop-down list. If omitted, all folders in the directory are included. The filter argument expression is applied before the exclude argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties7\":{\"name\":\"exclude\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a regular expression string which is used to exclude folders from the list. The exclude argument expression is applied after the filter argument expression. For information on constructing regular expressions see Regular expressions in parameter arguments.\"},\"properties8\":{\"name\":\"hide_none\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true, the \'- Do not use -\' item is omitted from the drop-down list.\"},\"properties9\":{\"name\":\"hide_default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a Boolean argument. If true, the \'- Use default -\' item is omitted from the drop-down list.\"},\"properties10\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'Provides a drop down list of folders from a specified directory.', '', 1, 4, '', 2, 'd3ab2ae4-9370-4497-ae6d-dee2e0b74b7a'), +(32, '', 'Note: When using the file input type you should always add the attribute enctype=\"multipart/form-data\" to your form tag. Otherwise, the uploaded files will not be attached correctly.\r\n\r\nNote 2: You can put a soft limit file size by adding a hidden field with name=\"MAX_FILE_SIZE\" and value the maximum allowed bytes which is handled by php, but you must also handle it in your code with or without it.', 'File', '{\"properties0\":{\"name\":\"type\",\"example\":\"file\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be file.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myfilevalue\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Enter some text\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Choose an image from your computer with maximum 100KB\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value, but doesn\'t mean much for a file.\"},\"properties5\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the file box in characters.\"},\"properties6\":{\"name\":\"accept\",\"example\":\"image\\/*\",\"adjustable\":\"1\",\"description\":\"(optional) Tells the browser what MIME types your form will allow to be uploaded.\"},\"properties7\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"},\"properties8\":{\"name\":\"labelclass\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) adds a CSS class for form field\'s label; for Joomla 2.5.4+\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute\"},\"properties10\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"},\"properties11\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) For Joomla form validating it to be filled in\"},\"properties12\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Whether to Joomla validate the field according to rules\"},\"properties13\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'Provides an input field for files', '', 1, 9, '', 3, '6da71c1e-119c-4e0d-a309-f3e52ecfa1d1'), +(33, '', 'The menuitem form field type provides a drop down grouped list of the available menu items from your Joomla site.', 'menuitem', '{\"properties0\":{\"name\":\"type\",\"example\":\"menuitem\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be menuitem.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mymenuitem\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select a menu item\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the default menu item. Note that this is the ItemID number of the menu item.\"},\"properties4\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties5\":{\"name\":\"published\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) determines whether all menu items are listed or only published menu items. If state is \'0\' then all menu items will be listed. If state is \'1\' then only published menu items will be listed.\"},\"properties6\":{\"name\":\"filter\",\"example\":\"int\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties7\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'provides a drop down list of the available menu items from your Joomla site.', '', 1, 5, '', 4, 'f183b0e2-017f-48bd-8dba-d332ce1b8d9e'), +(34, '', 'Remember all views already have [accesslevel] added by default, only add this if you need more custom access selection! Provides a dropdown list of accesslevel options with the current option selected.', 'Accesslevel', '{\"properties0\":{\"name\":\"type\",\"example\":\"accesslevel\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be accesslevel\"},\"properties1\":{\"name\":\"name\",\"example\":\"accesstwo\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field. This must match the name of the query results column that contains the values that will be shown to the user in the drop-down list, unless a different name is specified in the value_field attribute. \"},\"properties2\":{\"name\":\"label\",\"example\":\"Access Two\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"Select an access level to this concept.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"},\"properties5\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is the field required true if yes.\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) If set to multiple then allows more than one usergroup to be selected.\"},\"properties7\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'List of accesslevels', '', 1, 4, '', 5, '913ed2ce-836c-48e8-97af-e482441f47df'), +(35, '', 'Provides a form with rows of fields that you specify. As many options can be added as desired. Note this form field has a jQuery based javascript file as a dependency.', 'Subform', '{\"properties0\":{\"name\":\"type\",\"example\":\"subform\",\"description\":\"(mandatory) must be subform.\"},\"properties1\":{\"name\":\"name\",\"example\":\"options\",\"adjustable\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter\"},\"properties2\":{\"name\":\"label\",\"example\":\"The Option List\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"layout\",\"example\":\"joomla.form.field.subform.repeatable-table\",\"adjustable\":\"1\",\"description\":\"(mandatory) The layout for the repeatable table.\"},\"properties4\":{\"name\":\"component\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) To change the component where it should search for layout\"},\"properties5\":{\"name\":\"client\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Function to initialise the application clientFrontend: site or 0Backend: admin or 1\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"true\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The rows to be multiple.\"},\"properties7\":{\"name\":\"buttons\",\"example\":\"add,remove,move\",\"adjustable\":\"1\",\"description\":\"(optional) Which buttons to show if multiple mode is true.Options: add,remove,move\"},\"properties8\":{\"name\":\"fields\",\"example\":\"1,2,3\",\"adjustable\":\"1\",\"description\":\"(mandatory) The fields to add to the modal. All fields must first be created in component builder as a field before you can add them here, since you must use the id of the field. Separate the field ids with commas. Do not add custom fields that are not also used in this component.\"},\"properties9\":{\"name\":\"formsource\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) you can add a path to a xml file containing the fields.\"},\"properties10\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) description text for the form field. Displays at the top of the modal with the name as well as in the usual position in the form\"},\"properties11\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The default value for the form field if the field is left empty. Note this has to be a json string compatible with the contents of the form field.\"},\"properties12\":{\"name\":\"icon\",\"example\":\"list\",\"adjustable\":\"1\",\"description\":\"(optional) The icon to show on the select button (is prefixed with \\\"icon-\\\").\"},\"properties13\":{\"name\":\"max\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) The maximum number of rows of fields allowed (by default 999 to be effectively infinite)\"},\"properties14\":{\"name\":\"min\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The minimum number of rows of fields required\"},\"properties15\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Use only if you would like to save raw data, since the default is best.\"},\"properties16\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'Allows form fields which can have as many options as the user desires.', '', 1, 14, '', 6, '7139f2c8-a70a-46a6-bbe3-4eefe54ca515'), +(36, '', 'Provides an input field for an email address.', 'Email', '{\"properties0\":{\"name\":\"type\",\"example\":\"email\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be email.\"},\"properties1\":{\"name\":\"name\",\"example\":\"email\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Email Address\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"maxlength\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) limits the number of characters that may be entered.\"},\"properties5\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Enter some description\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties7\":{\"name\":\"class\",\"example\":\"inputbox\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties8\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties10\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"name\":\"filter\",\"example\":\"STRING\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties12\":{\"name\":\"validate\",\"example\":\"email\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties13\":{\"name\":\"unique\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) Used in validation, to check if we should test for uniqueness, to insure that this email does not already belong to another user. Check line 99 in \\/libraries\\/src\\/Form\\/Rule\\/EmailRule.php\"},\"properties14\":{\"name\":\"field\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) used in validation of \\\"equals\\\" to link the field to match.\"},\"properties15\":{\"name\":\"message\",\"example\":\"Error! Please add some text here.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The error message that will be displayed instead of the default message.\"},\"properties16\":{\"name\":\"hint\",\"example\":\"your@email.com\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties17\":{\"name\":\"autocomplete\",\"example\":\"on\",\"adjustable\":\"1\",\"description\":\"(optional) The autocomplete state for the form field. If \'off\' element will not be automatically completed by browser.\"},\"properties18\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties19\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'Email form field type', '', 1, 7, '', 7, '35948af5-9e79-4454-8dfa-682ee4fdf650'), +(37, '', 'Provides a dropdown list of plugin options from the folder.', 'Plugins', '{\"properties0\":{\"name\":\"type\",\"example\":\"plugins\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be editors.\"},\"properties1\":{\"name\":\"name\",\"example\":\"editor\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an editor\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties4\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the label.\"},\"properties5\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties6\":{\"name\":\"folder\",\"example\":\"editors\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) editors or captcha.\"},\"properties7\":{\"name\":\"filter\",\"example\":\"cmd\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties8\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field. https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"}}', 'Provides a dropdown list of plugin options from the folder.', '', 1, 8, '', 8, '37fa4e1d-b7ca-4a8f-aa4b-d8085c135233'), (38, '', 'Provides the use of a captcha plugin.', 'Captcha', '{\"properties0\":{\"name\":\"type\",\"example\":\"captcha\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be captcha.\"},\"properties3\":{\"name\":\"name\",\"example\":\"captcha\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"validate\",\"example\":\"captcha\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be captcha.\"},\"properties1\":{\"name\":\"label\",\"example\":\"Captcha\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties4\":{\"name\":\"description\",\"example\":\"We do not like spam, please show us you are human\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties5\":{\"name\":\"namespace\",\"example\":\"componentbuilder\",\"description\":\"(optional) the component name seems to work\"}}', 'Captcha robot check.', '', 1, 2, '', 9, '206fdad4-14d0-45f1-9c84-3d09abf48a39'), -(39, '', 'The list form field type provides a drop down list or a list box of custom-defined entries. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.', 'Groupedlist', '{\"properties0\":{\"name\":\"type\",\"example\":\"groupedlist\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be groupedlist.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mygrouplist\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an option\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties5\":{\"name\":\"class\",\"example\":\"list_class\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties7\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) filter options\"},\"properties8\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties9\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties10\":{\"name\":\"option\",\"example\":\"Group Name@@1,1|Option 1|1,2|Option 2|1,Group Name 2@@2,3|Option 3|2\",\"adjustable\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties11\":{\"name\":\"useglobal\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) if set to true, it will show the value that is set in the global configuration if found in the database.\"},\"properties12\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) is the default list item value.\"},\"properties13\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\"},\"properties14\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a drop down list of custom-defined entries.', '', 1, 1, '', 10, '088d47c0-b058-4894-b92e-dcf1b9d5a722'); +(39, '', 'The list form field type provides a drop down list or a list box of custom-defined entries. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.', 'Groupedlist', '{\"properties0\":{\"name\":\"type\",\"example\":\"groupedlist\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be groupedlist.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mygrouplist\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an option\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties5\":{\"name\":\"class\",\"example\":\"list_class\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties7\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) filter options\"},\"properties8\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties9\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties10\":{\"name\":\"option\",\"example\":\"Group Name@@1,1|Option 1|1,2|Option 2|1,Group Name 2@@2,3|Option 3|2\",\"adjustable\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties11\":{\"name\":\"useglobal\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) if set to true, it will show the value that is set in the global configuration if found in the database.\"},\"properties12\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) is the default list item value.\"},\"properties13\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+ https:\\/\\/joomla.stackexchange.com\\/a\\/17682\\/2166\"},\"properties14\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a drop down list of custom-defined entries.', '', 1, 2, '', 10, '088d47c0-b058-4894-b92e-dcf1b9d5a722'); -- -- Dumping data for table `#__componentbuilder_language` diff --git a/componentbuilder.xml b/componentbuilder.xml index 1ed69498c..70777b4c3 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 28th March, 2020 + 3rd April, 2020 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com -- 2.40.1
    '; - $head .= PHP_EOL . $this->_t(3) . ""; + $head .= PHP_EOL . $this->_t(2) . ''; + $head .= PHP_EOL . $this->_t(3) . ""; $head .= PHP_EOL . $this->_t(2) . "'; - $head .= PHP_EOL . $this->_t(3) . ""; + $head .= PHP_EOL . $this->_t(2) . ''; + $head .= PHP_EOL . $this->_t(3) . ""; $head .= PHP_EOL . $this->_t(2) . "