joomlagerman / joomla

The J!German translation team provides German translation for Joomla!
https://www.jgerman.de
GNU General Public License v2.0
25 stars 46 forks source link

[5.1] Add Global Setting for Form Layout option to custom fields #3044

Closed jgerman-bot closed 8 months ago

jgerman-bot commented 10 months ago

New language relevant PR in upstream repo: https://github.com/joomla/joomla-cms/pull/37320 Here are the upstream changes:

Click to expand the diff! ```diff diff --git a/administrator/components/com_fields/src/Plugin/FieldsPlugin.php b/administrator/components/com_fields/src/Plugin/FieldsPlugin.php index 6d42cad44dfea..b82c1ab0cc588 100644 --- a/administrator/components/com_fields/src/Plugin/FieldsPlugin.php +++ b/administrator/components/com_fields/src/Plugin/FieldsPlugin.php @@ -269,10 +269,6 @@ public function onCustomFieldsPrepareDom($field, \DOMElement $parent, Form $form $node->setAttribute('showon', $showon_attribute); } - if ($layout = $field->params->get('form_layout')) { - $node->setAttribute('layout', $layout); - } - if ($field->default_value !== '') { $defaultNode = $node->appendChild(new \DOMElement('default')); $defaultNode->appendChild(new \DOMCdataSection($field->default_value)); @@ -282,6 +278,12 @@ public function onCustomFieldsPrepareDom($field, \DOMElement $parent, Form $form $params = clone $this->params; $params->merge($field->fieldparams); + $layout = $field->params->get('form_layout', $this->params->get('form_layout', '')); + + if ($layout) { + $node->setAttribute('layout', $layout); + } + // Set the specific field parameters foreach ($params->toArray() as $key => $param) { if (\is_array($param)) { diff --git a/administrator/language/en-GB/com_fields.ini b/administrator/language/en-GB/com_fields.ini index 17b2febfe08e9..d2f141ab70b13 100644 --- a/administrator/language/en-GB/com_fields.ini +++ b/administrator/language/en-GB/com_fields.ini @@ -21,7 +21,6 @@ COM_FIELDS_FIELD_EDITABLE_IN_BOTH="Both" COM_FIELDS_FIELD_EDITABLE_IN_LABEL="Editable In" COM_FIELDS_FIELD_EDITABLE_IN_SITE="Site" COM_FIELDS_FIELD_FORM_EDIT="Edit Field" -COM_FIELDS_FIELD_FORM_LAYOUT_LABEL="Layout" COM_FIELDS_FIELD_FORM_NEW="New Field" COM_FIELDS_FIELD_FORMOPTIONS_HEADING="Form Options" COM_FIELDS_FIELD_GROUP_LABEL="Field Group" diff --git a/administrator/language/en-GB/lib_joomla.ini b/administrator/language/en-GB/lib_joomla.ini index 1aa443ca2f114..7fbad4d2981c0 100644 --- a/administrator/language/en-GB/lib_joomla.ini +++ b/administrator/language/en-GB/lib_joomla.ini @@ -300,6 +300,9 @@ JLIB_FORM_FIELD_PARAM_INTEGER_LAST_DESC="This value is the highest in the list." JLIB_FORM_FIELD_PARAM_INTEGER_LAST_LABEL="Last" JLIB_FORM_FIELD_PARAM_INTEGER_STEP_DESC="Each option will be the previous option incremented by this integer, starting with the first value until the last value is reached." JLIB_FORM_FIELD_PARAM_INTEGER_STEP_LABEL="Step" +JLIB_FORM_FIELD_PARAM_LAYOUT_BASIC_SELECT="HTML Select" +JLIB_FORM_FIELD_PARAM_LAYOUT_FANCY_SELECT="Enhanced Select" +JLIB_FORM_FIELD_PARAM_LAYOUT_LABEL="Form Layout" JLIB_FORM_FIELD_PARAM_LIST_MULTIPLE_DESC="Allow multiple values to be selected." JLIB_FORM_FIELD_PARAM_LIST_MULTIPLE_LABEL="Multiple" JLIB_FORM_FIELD_PARAM_LIST_MULTIPLE_VALUES_DESC="The options of the list." diff --git a/administrator/language/en-GB/plg_fields_list.ini b/administrator/language/en-GB/plg_fields_list.ini index 5eeb5f3d4b567..f3b4e535323f2 100644 --- a/administrator/language/en-GB/plg_fields_list.ini +++ b/administrator/language/en-GB/plg_fields_list.ini @@ -5,7 +5,6 @@ PLG_FIELDS_LIST="Fields - List" PLG_FIELDS_LIST_LABEL="List (%s)" -PLG_FIELDS_LIST_PARAMS_FORM_LAYOUT_FANCY_SELECT="Enhanced select" PLG_FIELDS_LIST_PARAMS_MULTIPLE_LABEL="Multiple" PLG_FIELDS_LIST_PARAMS_OPTIONS_LABEL="List Values" PLG_FIELDS_LIST_PARAMS_OPTIONS_NAME_LABEL="Text" diff --git a/administrator/language/en-GB/plg_fields_sql.ini b/administrator/language/en-GB/plg_fields_sql.ini index fd483b287cd3e..69403cdbc53c5 100644 --- a/administrator/language/en-GB/plg_fields_sql.ini +++ b/administrator/language/en-GB/plg_fields_sql.ini @@ -6,7 +6,6 @@ PLG_FIELDS_SQL="Fields - SQL" PLG_FIELDS_SQL_CREATE_NOT_POSSIBLE="Only a Super User can create or edit an SQL field!" PLG_FIELDS_SQL_LABEL="SQL (%s)" -PLG_FIELDS_SQL_PARAMS_FORM_LAYOUT_FANCY_SELECT="Enhanced select" PLG_FIELDS_SQL_PARAMS_HEADER_DESC="Add a string with no value at the top of the dropdown list eg ' - Select Article - '." PLG_FIELDS_SQL_PARAMS_HEADER_LABEL="Header" PLG_FIELDS_SQL_PARAMS_MULTIPLE_LABEL="Multiple" diff --git a/plugins/fields/integer/integer.xml b/plugins/fields/integer/integer.xml index 4c7a9539709a4..ca7d0e3c69a84 100644 --- a/plugins/fields/integer/integer.xml +++ b/plugins/fields/integer/integer.xml @@ -35,6 +35,17 @@ + + + + + + +
+
+ + + + + +
+
+
diff --git a/plugins/fields/list/list.xml b/plugins/fields/list/list.xml index a211faa57f325..f50c406e455fc 100644 --- a/plugins/fields/list/list.xml +++ b/plugins/fields/list/list.xml @@ -35,6 +35,17 @@
+ + + + + - - + + + diff --git a/plugins/fields/radio/params/radio.xml b/plugins/fields/radio/params/radio.xml index aec5f82afcd29..2f15b00247d5f 100644 --- a/plugins/fields/radio/params/radio.xml +++ b/plugins/fields/radio/params/radio.xml @@ -27,23 +27,16 @@ -
-
+ diff --git a/plugins/fields/radio/radio.xml b/plugins/fields/radio/radio.xml index 65dffb93e9e26..1431f390da632 100644 --- a/plugins/fields/radio/radio.xml +++ b/plugins/fields/radio/radio.xml @@ -23,6 +23,17 @@
+ + + + + - - + + +
diff --git a/plugins/fields/sql/sql.xml b/plugins/fields/sql/sql.xml index c02ebc4aa9b1e..bc00290073453 100644 --- a/plugins/fields/sql/sql.xml +++ b/plugins/fields/sql/sql.xml @@ -52,6 +52,18 @@
+ + + + + +
```