From 12c456ca6b7b5c66e76f8b5b82789f047bc43327 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Wed, 5 Feb 2020 01:18:34 +0200 Subject: [PATCH] Fixed javascript overload in the field conditions area. Fixed a dynamicGet error that linked the wrong tables with eachother. Fixed gh-519 so that the form is loaded around pagination, note that this may break some implementation, but this fix will allow for a more correct html. --- README.md | 4 +- admin/README.txt | 4 +- admin/assets/css/assistant.css | 4 +- .../joomla_3/default_custom_admin.php | 5 +- .../joomla_3/default_list_custom_admin.php | 5 +- admin/helpers/compiler/a_Get.php | 2 +- admin/helpers/compiler/e_Interpretation.php | 70 +++++--- admin/helpers/compiler/f_Infusion.php | 8 +- admin/layouts/fieldtype/fields_fullwidth.php | 2 +- .../server/linked_components_fullwidth.php | 2 +- admin/models/fieldtype.php | 12 +- admin/models/forms/admin_view.js | 80 ++++----- admin/models/forms/class_method.js | 10 +- admin/models/forms/class_property.js | 10 +- admin/models/forms/custom_code.js | 38 ++-- admin/models/forms/dynamic_get.js | 128 +++++++------- admin/models/forms/field.js | 166 +++++------------- admin/models/forms/fieldtype.js | 80 ++++----- admin/models/forms/help_document.js | 50 +++--- admin/models/forms/joomla_module.js | 49 ++---- admin/models/forms/joomla_plugin.js | 49 ++---- admin/models/forms/library.js | 49 ++---- admin/models/forms/server.js | 90 +++++----- admin/models/server.php | 2 +- admin/views/assistant/tmpl/default.php | 5 +- admin/views/compiler/tmpl/default.php | 37 ++-- admin/views/compiler/view.html.php | 6 - admin/views/fieldtype/view.html.php | 2 +- admin/views/get_snippets/tmpl/default.php | 9 +- admin/views/server/view.html.php | 2 +- componentbuilder.xml | 2 +- 31 files changed, 418 insertions(+), 564 deletions(-) diff --git a/README.md b/README.md index dc042fcb8..79e1095c9 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*: 29th January, 2020 ++ *Last Build*: 4th February, 2020 + *Version*: 2.10.11 + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **281475** ++ *Line count*: **281315** + *Field count*: **1505** + *File count*: **1770** + *Folder count*: **280** diff --git a/admin/README.txt b/admin/README.txt index dc042fcb8..79e1095c9 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*: 29th January, 2020 ++ *Last Build*: 4th February, 2020 + *Version*: 2.10.11 + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **281475** ++ *Line count*: **281315** + *Field count*: **1505** + *File count*: **1770** + *Folder count*: **280** diff --git a/admin/assets/css/assistant.css b/admin/assets/css/assistant.css index f073948a4..3d7b98b8f 100644 --- a/admin/assets/css/assistant.css +++ b/admin/assets/css/assistant.css @@ -10,6 +10,4 @@ /* CSS Document */ -.j-sidebar-container { -margin: -37px 0 0 -1px !important; -} + diff --git a/admin/compiler/joomla_3/default_custom_admin.php b/admin/compiler/joomla_3/default_custom_admin.php index 3da08846a..d3c514504 100644 --- a/admin/compiler/joomla_3/default_custom_admin.php +++ b/admin/compiler/joomla_3/default_custom_admin.php @@ -25,10 +25,7 @@ JHtml::_('behavior.keepalive'); ?> canDo->get('###sview###.access')): ?>###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT### item->id)) ? '&id='. (int) $this->item->id : ''; ?> -
- - -
###CUSTOM_ADMIN_BODY### +###CUSTOM_ADMIN_TOP_FORM######CUSTOM_ADMIN_BODY######CUSTOM_ADMIN_BOTTOM_FORM###

diff --git a/admin/compiler/joomla_3/default_list_custom_admin.php b/admin/compiler/joomla_3/default_list_custom_admin.php index 00804976f..038a79cba 100644 --- a/admin/compiler/joomla_3/default_list_custom_admin.php +++ b/admin/compiler/joomla_3/default_list_custom_admin.php @@ -24,10 +24,7 @@ JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); ?> canDo->get('###sview###.access')): ?>###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT### -
- ###HIDDEN_INPUT_VALUES### - -
###CUSTOM_ADMIN_BODY### +###CUSTOM_ADMIN_TOP_FORM######CUSTOM_ADMIN_BODY######CUSTOM_ADMIN_BOTTOM_FORM###

diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index 3acd27bd8..76778b6ca 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -2115,7 +2115,7 @@ class Get { // load the field details $required = ComponentbuilderHelper::getBetween($fieldValues['settings']->xml, 'required="', '"'); - $required = ($required == true) ? 'yes' : 'no'; + $required = ($required === 'true' || $required === '1') ? 'yes' : 'no'; $filter = ComponentbuilderHelper::getBetween($fieldValues['settings']->xml, 'filter="', '"'); $filter = ComponentbuilderHelper::checkString($filter) ? $filter : 'none'; // set the field name diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 8790dfd44..7bc5d4145 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -159,11 +159,11 @@ class Interpretation extends Fields public $customAdminAdded = array(); /** - * Switch to add form to site views + * Switch to add form to views * * @var array */ - public $addSiteForm = array(); + public $addCustomForm = array(); /** * The extensions params @@ -3365,17 +3365,6 @@ class Interpretation extends Fields { $method .= PHP_EOL . $this->_t(2) . "\$this->pagination = \$this->get('Pagination');"; } - // add id to list view - if (isset($this->customAdminViewListId[$view['settings']->code])) - { - // HIDDEN_INPUT_VALUES - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'HIDDEN_INPUT_VALUES' . $this->hhh] = PHP_EOL . $this->_t(1) . ''; - } - else - { - // also set the input value HIDDEN_INPUT_VALUES - $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'HIDDEN_INPUT_VALUES' . $this->hhh] = ''; - } } // add the custom get methods if (isset($view['settings']->custom_get) && ComponentbuilderHelper::checkArray($view['settings']->custom_get)) @@ -3766,14 +3755,14 @@ class Interpretation extends Fields // return buttons if they were build if (ComponentbuilderHelper::checkArray($buttons)) { - // only for site views - if ('site' === $this->target) + // set the custom get form method JAVASCRIPT_FOR_BUTTONS + $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, 'fileContentDynamic[$view['settings']->code][$this->hhh . 'SITE_JAVASCRIPT_FOR_BUTTONS' . $this->hhh] = $this->setJavaScriptForButtons(); - // insure the form is added - $this->addSiteForm[$view['settings']->code] = true; + $this->addCustomForm[$this->target][$view['settings']->code] = true; } + return PHP_EOL . implode(PHP_EOL, $buttons); } } @@ -4458,32 +4447,59 @@ class Interpretation extends Fields $body[] = $this->_t(2) . 'pagination->getPagesLinks(); ?>'; $body[] = $this->_t(1) . ''; $body[] = ''; - // insure the form is added - $this->addSiteForm[$view['settings']->code] = true; + // insure the form is added (only if no form exist) + if (strpos($view['settings']->default, '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 ('admin' === $this->target && strpos($view['settings']->default, 'addCustomForm[$this->target][$view['settings']->code] = true; + } return PHP_EOL . $this->setPlaceholders($view['settings']->default, $this->placeholders); } } return ''; } - - public function setCustomViewForm(&$view, $type) + + public function setCustomViewForm(&$view, &$gettype, $type) { - if (isset($this->addSiteForm[$view]) && $this->addSiteForm[$view]) + if (isset($this->addCustomForm[$this->target]) && isset($this->addCustomForm[$this->target][$view]) && $this->addCustomForm[$this->target][$view]) { switch($type) { case 1: // top - return '
' . PHP_EOL; + if ('site' === $this->target) + { + return '' . PHP_EOL; + } + else + { + if ($gettype == 2) + { + return '' . PHP_EOL; + } + else + { + return '' . PHP_EOL; + } + } break; case 2: // bottom - return PHP_EOL . '' . PHP_EOL . "" . PHP_EOL . '
'; + $input = ''; + if ('admin' === $this->target && isset($this->customAdminViewListId[$view])) + { + $input = PHP_EOL . $this->_t(1) . ''; + } + return $input . PHP_EOL . '' . PHP_EOL . "" . PHP_EOL . ''; break; } } @@ -4495,7 +4511,7 @@ 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(task)') === false) + if (strpos($view['settings']->default, 'Joomla.submitbutton = function(') === false) { $script = array(); $script[] = PHP_EOL . " item->id)) ? '&id='. (int) $this->item->id : ''; ?> -
- - -
+ -
- - -
+canDo->get('compiler.access')): ?> +
+ + + + +

diff --git a/admin/views/compiler/view.html.php b/admin/views/compiler/view.html.php index 22e6dd893..280ed0b6b 100644 --- a/admin/views/compiler/view.html.php +++ b/admin/views/compiler/view.html.php @@ -222,12 +222,6 @@ class ComponentbuilderViewCompiler extends JViewLegacy $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/custom/marked.js"); // add the document default css file $this->document->addStyleSheet(JURI::root(true) .'/administrator/components/com_componentbuilder/assets/css/compiler.css', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); - // Set the Custom CSS script to view - $this->document->addStyleDeclaration(" - .j-sidebar-container { - margin: -37px 0 0 -1px !important; - } - "); // Set the Custom JS script to view $this->document->addScriptDeclaration(" function getComponentDetails_server(id){ diff --git a/admin/views/fieldtype/view.html.php b/admin/views/fieldtype/view.html.php index f78aa43bb..a7bc6c49e 100644 --- a/admin/views/fieldtype/view.html.php +++ b/admin/views/fieldtype/view.html.php @@ -57,7 +57,7 @@ class ComponentbuilderViewFieldtype extends JViewLegacy } // Get Linked view data - $this->vymfields = $this->get('Vymfields'); + $this->vyffields = $this->get('Vyffields'); // Set the toolbar $this->addToolBar(); diff --git a/admin/views/get_snippets/tmpl/default.php b/admin/views/get_snippets/tmpl/default.php index a7ecb8b8a..d769d42f3 100644 --- a/admin/views/get_snippets/tmpl/default.php +++ b/admin/views/get_snippets/tmpl/default.php @@ -31,10 +31,11 @@ JHtml::_('behavior.keepalive'); } } -
- - -
+ +
+ + +



diff --git a/admin/views/server/view.html.php b/admin/views/server/view.html.php index 84122e6c8..59c22a485 100644 --- a/admin/views/server/view.html.php +++ b/admin/views/server/view.html.php @@ -57,7 +57,7 @@ class ComponentbuilderViewServer extends JViewLegacy } // Get Linked view data - $this->vywlinked_components = $this->get('Vywlinked_components'); + $this->vyplinked_components = $this->get('Vyplinked_components'); // Set the toolbar $this->addToolBar(); diff --git a/componentbuilder.xml b/componentbuilder.xml index add0d0d8b..c8b4818b2 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 29th January, 2020 + 4th February, 2020 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com