From 400ed4eb84a90267d100c9cd87cbd08c2b38b920 Mon Sep 17 00:00:00 2001 From: ReLater Date: Wed, 12 Jun 2019 15:31:57 +0200 Subject: [PATCH 1/7] Add field "fieldfilter" for subform fields filtering --- plugins/fields/repeatable/params/repeatable.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plugins/fields/repeatable/params/repeatable.xml b/plugins/fields/repeatable/params/repeatable.xml index 31b65933e28d4..00a6b82784ae7 100644 --- a/plugins/fields/repeatable/params/repeatable.xml +++ b/plugins/fields/repeatable/params/repeatable.xml @@ -30,6 +30,20 @@ + + + + + + + From f1fb47f001139bff0f805626675e77d1cb1506b7 Mon Sep 17 00:00:00 2001 From: ReLater Date: Wed, 12 Jun 2019 15:38:20 +0200 Subject: [PATCH 2/7] Add filterfield --- plugins/fields/repeatable/repeatable.php | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/fields/repeatable/repeatable.php b/plugins/fields/repeatable/repeatable.php index b5e3c289457ca..a726b0a94f13e 100644 --- a/plugins/fields/repeatable/repeatable.php +++ b/plugins/fields/repeatable/repeatable.php @@ -64,6 +64,7 @@ public function onCustomFieldsPrepareDom($field, DOMElement $parent, JForm $form $child = $fields->addChild('field'); $child->addAttribute('name', $formField->fieldname); $child->addAttribute('type', $formField->fieldtype); + $child->addAttribute('filter', $formField->fieldfilter); $child->addAttribute('readonly', $readonly); } From ecd216bba711fdefa4c857a9c050cb5a82939f38 Mon Sep 17 00:00:00 2001 From: ReLater Date: Wed, 12 Jun 2019 21:48:26 +0200 Subject: [PATCH 3/7] Showon to fieldfilter + options. Add more filters --- .../fields/repeatable/params/repeatable.xml | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/plugins/fields/repeatable/params/repeatable.xml b/plugins/fields/repeatable/params/repeatable.xml index 00a6b82784ae7..0a79a1b9add31 100644 --- a/plugins/fields/repeatable/params/repeatable.xml +++ b/plugins/fields/repeatable/params/repeatable.xml @@ -37,12 +37,31 @@ description="PLG_FIELDS_TEXT_PARAMS_FILTER_DESC" class="btn-group" validate="options" + showon="fieldtype!:media[AND]fieldtype!:number" > - - - + + + + + + + From ae53efe0d0628c88525539e003537bba765e3cf3 Mon Sep 17 00:00:00 2001 From: ReLater Date: Wed, 12 Jun 2019 22:00:27 +0200 Subject: [PATCH 4/7] shorten showon attributes --- plugins/fields/repeatable/params/repeatable.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/fields/repeatable/params/repeatable.xml b/plugins/fields/repeatable/params/repeatable.xml index 0a79a1b9add31..e404268180f7e 100644 --- a/plugins/fields/repeatable/params/repeatable.xml +++ b/plugins/fields/repeatable/params/repeatable.xml @@ -37,30 +37,30 @@ description="PLG_FIELDS_TEXT_PARAMS_FILTER_DESC" class="btn-group" validate="options" - showon="fieldtype!:media[AND]fieldtype!:number" + showon="fieldtype!:media,number" > From cf28b13f80db243292ed5005a68d67074fba9272 Mon Sep 17 00:00:00 2001 From: ReLater Date: Thu, 13 Jun 2019 18:38:20 +0200 Subject: [PATCH 5/7] Undefined property:stdClass:$fieldfilter for media --- plugins/fields/repeatable/repeatable.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/fields/repeatable/repeatable.php b/plugins/fields/repeatable/repeatable.php index a726b0a94f13e..eabf0a553e4bf 100644 --- a/plugins/fields/repeatable/repeatable.php +++ b/plugins/fields/repeatable/repeatable.php @@ -64,8 +64,12 @@ public function onCustomFieldsPrepareDom($field, DOMElement $parent, JForm $form $child = $fields->addChild('field'); $child->addAttribute('name', $formField->fieldname); $child->addAttribute('type', $formField->fieldtype); - $child->addAttribute('filter', $formField->fieldfilter); $child->addAttribute('readonly', $readonly); + + if (isset($formField->fieldfilter)) + { + $child->addAttribute('filter', $formField->fieldfilter); + } } $fieldNode->setAttribute('formsource', $fieldsXml->asXML()); From e7c5b9162d9c0ba22161c20f145a8a9b4da6c922 Mon Sep 17 00:00:00 2001 From: ReLater Date: Thu, 13 Jun 2019 18:46:54 +0200 Subject: [PATCH 6/7] cs Remove tabs --- plugins/fields/repeatable/repeatable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/fields/repeatable/repeatable.php b/plugins/fields/repeatable/repeatable.php index eabf0a553e4bf..04d49b5f7e302 100644 --- a/plugins/fields/repeatable/repeatable.php +++ b/plugins/fields/repeatable/repeatable.php @@ -65,7 +65,7 @@ public function onCustomFieldsPrepareDom($field, DOMElement $parent, JForm $form $child->addAttribute('name', $formField->fieldname); $child->addAttribute('type', $formField->fieldtype); $child->addAttribute('readonly', $readonly); - + if (isset($formField->fieldfilter)) { $child->addAttribute('filter', $formField->fieldfilter); From 1824077a014dcbe8340c5485a472b3c42d46c1ec Mon Sep 17 00:00:00 2001 From: ReLater Date: Thu, 13 Jun 2019 19:09:06 +0200 Subject: [PATCH 7/7] Remove global option from fieldfilter --- plugins/fields/repeatable/params/repeatable.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/fields/repeatable/params/repeatable.xml b/plugins/fields/repeatable/params/repeatable.xml index e404268180f7e..0f698b44199f9 100644 --- a/plugins/fields/repeatable/params/repeatable.xml +++ b/plugins/fields/repeatable/params/repeatable.xml @@ -39,7 +39,6 @@ validate="options" showon="fieldtype!:media,number" > -