From 6c6f43ca84a6b85b00f3f8f60bc4045d7a2de875 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Fri, 2 Aug 2024 11:15:02 +1200 Subject: [PATCH 1/2] ENH Don't use keyword "self" (#410) --- src/GridFieldNestedForm.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/GridFieldNestedForm.php b/src/GridFieldNestedForm.php index 9f4fffc..a6f02f1 100644 --- a/src/GridFieldNestedForm.php +++ b/src/GridFieldNestedForm.php @@ -41,7 +41,7 @@ class GridFieldNestedForm extends AbstractGridFieldComponent implements GridField_DataManipulator { use Configurable, GridFieldStateAware; - + /** * The key used in the post data to identify nested form data */ @@ -55,7 +55,7 @@ class GridFieldNestedForm extends AbstractGridFieldComponent implements * The default max nesting level. Nesting further than this will throw an exception. */ private static int $default_max_nesting_level = 10; - + private string $name; private bool $expandNested = false; @@ -74,12 +74,12 @@ class GridFieldNestedForm extends AbstractGridFieldComponent implements private $canExpandCallback = null; private int $maxNestingLevel = 0; - + public function __construct($name = 'NestedForm') { $this->name = $name; } - + /** * Get the grid field that this component is attached to */ @@ -95,7 +95,7 @@ public function getRelationName(): string { return $this->relationName; } - + /** * Set the relation name to use for the nested grid fields */ @@ -121,7 +121,7 @@ public function setInlineEditable(bool $editable): static $this->inlineEditable = $editable; return $this; } - + /** * Set whether the nested grid fields should be expanded by default */ @@ -255,7 +255,7 @@ public function getColumnContent($gridField, $record, $columnName) ])->renderWith('Symbiote\GridFieldExtensions\GridFieldNestedForm'); } } - + public function getURLHandlers($gridField) { return [ @@ -349,7 +349,7 @@ public function handleMoveToParent(GridField $gridField, $request): string } return $gridField->FieldHolder(); } - + /** * Handle the request to show a nested item */ @@ -424,7 +424,7 @@ public function toggleNestedItem( $stateRelation = $className.'-'.$record->ID.'-'.$this->getRelationName(); $state->$stateRelation = (int)$request->getVar('toggle'); } - + /** * Get the link for the nested grid field */ @@ -444,10 +444,10 @@ public function ToggleLink($action = null): string $manager = $this->getStateManager(); return $manager->addStateToURL($this->gridField, $link); } - + public function handleSave(GridField $gridField, DataObjectInterface $record) { - $postKey = self::POST_KEY; + $postKey = GridFieldNestedForm::POST_KEY; $value = $gridField->Value(); if (isset($value['GridState']) && $value['GridState']) { // set grid state from value, to store open/closed toggle state for nested forms From 54b5fc148369cfbff815d9e5d84c3df952951328 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Tue, 6 Aug 2024 12:44:50 +1200 Subject: [PATCH 2/2] TLN Update translations (#412) --- client/lang/de.js | 14 ++++++++++++++ client/lang/src/de.json | 6 ++++++ lang/de.yml | 17 +++++++++++++++++ lang/eo.yml | 2 ++ 4 files changed, 39 insertions(+) create mode 100644 client/lang/de.js create mode 100644 client/lang/src/de.json create mode 100644 lang/de.yml diff --git a/client/lang/de.js b/client/lang/de.js new file mode 100644 index 0000000..4ebb243 --- /dev/null +++ b/client/lang/de.js @@ -0,0 +1,14 @@ +// This file was generated by silverstripe/tx-translator from client/lang/src/de.json. +// See https://github.com/silverstripe/silverstripe-tx-translator for details +if (typeof(ss) === 'undefined' || typeof(ss.i18n) === 'undefined') { + if (typeof(console) !== 'undefined') { // eslint-disable-line no-console + console.error('Class ss.i18n not defined'); // eslint-disable-line no-console + } +} else { + ss.i18n.addDictionary('de', { + "GridFieldExtensions.ADD_CLASS": "{classname} hinzufügen", + "GridFieldExtensions.CONFIRMDEL": "Sind Sie sicher, dass Sie das löschen wollen?", + "GridFieldExtensions.OPEN_SEARCH_FILTER": "Suche und Filter öffnen", + "GridFieldExtensions.SAVE_PUBLISH": "Speichern und Veröffentlichen" +}); +} \ No newline at end of file diff --git a/client/lang/src/de.json b/client/lang/src/de.json new file mode 100644 index 0000000..f727a03 --- /dev/null +++ b/client/lang/src/de.json @@ -0,0 +1,6 @@ +{ + "GridFieldExtensions.ADD_CLASS": "{classname} hinzufügen", + "GridFieldExtensions.CONFIRMDEL": "Sind Sie sicher, dass Sie das löschen wollen?", + "GridFieldExtensions.OPEN_SEARCH_FILTER": "Suche und Filter öffnen", + "GridFieldExtensions.SAVE_PUBLISH": "Speichern und Veröffentlichen" +} \ No newline at end of file diff --git a/lang/de.yml b/lang/de.yml new file mode 100644 index 0000000..11cee9c --- /dev/null +++ b/lang/de.yml @@ -0,0 +1,17 @@ +de: + GridFieldExtensions: + ADD: Hinzufügen + ADDEXISTING: 'Bestehenden Eintrag hinzufügen' + BACK: Zurück + CURRENT: (aktuell) + Next: Nächste + PREVIOUS: Vorherige + RESULTS: Ergebnisse + SEARCH: Suche + SELECTTYPETOCREATE: '(Bitte Typ auswählen)' + Symbiote\GridFieldExtensions\Extensions\GridFieldDetailFormItemRequestExtension: + NEW: 'Neuen Eintrag hinzufügen' + Symbiote\GridFieldExtensions\GridFieldConfigurablePaginator: + SHOW: Anzeigen + Symbiote\GridFieldExtensions\GridFieldOrderableRows: + REORDERED: 'Einträge neu sortiert.' diff --git a/lang/eo.yml b/lang/eo.yml index 1a7cb12..a830254 100644 --- a/lang/eo.yml +++ b/lang/eo.yml @@ -14,3 +14,5 @@ eo: NEW: 'Aldoni novan rikordon' Symbiote\GridFieldExtensions\GridFieldConfigurablePaginator: SHOW: Vidigi + Symbiote\GridFieldExtensions\GridFieldOrderableRows: + REORDERED: 'Reordigis rikordojn.'