JoomlaPolska / jezyk-J4

Język polski dla Joomla 4
GNU General Public License v2.0
3 stars 5 forks source link

Allow to select the edit layout for subforms in custom fields #309

Closed joomlapl-bot closed 1 year ago

joomlapl-bot commented 1 year ago

PR w związku ze zmianą oryginału https://github.com/joomla/joomla-cms/pull/38180 Poniżej zmiany w oryginale:

Click to expand the diff! ```diff diff --git a/administrator/language/en-GB/plg_fields_subform.ini b/administrator/language/en-GB/plg_fields_subform.ini index 075d9a7262f4..e920859e598e 100644 --- a/administrator/language/en-GB/plg_fields_subform.ini +++ b/administrator/language/en-GB/plg_fields_subform.ini @@ -6,6 +6,8 @@ PLG_FIELDS_SUBFORM="Fields - Subform" PLG_FIELDS_SUBFORM_LABEL="Subform (%s)" PLG_FIELDS_SUBFORM_PARAMS_CUSTOMFIELD_LABEL="Field" +PLG_FIELDS_SUBFORM_PARAMS_EDIT_LAYOUT_OPTION_REPEATABLE_FORM_LABEL="Form" +PLG_FIELDS_SUBFORM_PARAMS_EDIT_LAYOUT_OPTION_REPEATABLE_TABLE_LABEL="Table" PLG_FIELDS_SUBFORM_PARAMS_MAX_ROWS_LABEL="Maximum Rows" PLG_FIELDS_SUBFORM_PARAMS_OPTIONS_LABEL="Fields" PLG_FIELDS_SUBFORM_PARAMS_RENDER_VALUES_LABEL="Render Values" diff --git a/plugins/fields/subform/params/subform.xml b/plugins/fields/subform/params/subform.xml index 05eb62154179..8a44744e2ffd 100644 --- a/plugins/fields/subform/params/subform.xml +++ b/plugins/fields/subform/params/subform.xml @@ -59,5 +59,24 @@ + + + +
+
+ + + + + +
+
diff --git a/plugins/fields/subform/subform.php b/plugins/fields/subform/subform.php index 14b7a48a74a0..553e69c13731 100644 --- a/plugins/fields/subform/subform.php +++ b/plugins/fields/subform/subform.php @@ -303,6 +303,12 @@ public function onCustomFieldsPrepareDom($field, DOMElement $parent, Form $form) ); } + // If the edit layout is set we override any automation + $editLayout = $field->params->get('form_layout'); + if ($editLayout) { + $parent_field->setAttribute('layout', $editLayout); + } + return $parent_field; } ```