diff --git a/NodeTypes/Abstract/FormBuilder.yaml b/NodeTypes/Abstract/FormBuilder.yaml new file mode 100644 index 0000000..a6b1090 --- /dev/null +++ b/NodeTypes/Abstract/FormBuilder.yaml @@ -0,0 +1,8 @@ +# Add the extended nodetypes of the Neos.Form.Builder +# to prevent errors if the new Neos Form-Builder is +# not in the requirements. +'Neos.Form.Builder:AbstractFinisher': + abstract: true + +'Neos.Form.Builder:IdentifierMixin': + abstract: true diff --git a/NodeTypes/Abstract/PaperTiger.yaml b/NodeTypes/Abstract/PaperTiger.yaml new file mode 100644 index 0000000..a0befaf --- /dev/null +++ b/NodeTypes/Abstract/PaperTiger.yaml @@ -0,0 +1,5 @@ +# Add the extended nodetypes of the Sitegeist.PaperTiger +# to prevent errors if Sitegeist.PaperTiger is +# not in the requirements. +'Sitegeist.PaperTiger:Action': + abstract: true \ No newline at end of file diff --git a/Configuration/NodeTypes.yaml b/NodeTypes/FormBuilder/DatabaseStorageFinisher.yaml similarity index 65% rename from Configuration/NodeTypes.yaml rename to NodeTypes/FormBuilder/DatabaseStorageFinisher.yaml index 208d1d1..4b77f8c 100644 --- a/Configuration/NodeTypes.yaml +++ b/NodeTypes/FormBuilder/DatabaseStorageFinisher.yaml @@ -1,13 +1,3 @@ -# Add the extended nodetypes of the Neos.Form.Builder -# to prevent errors if the new Neos Form-Builder is -# not in the requirements. -'Neos.Form.Builder:AbstractFinisher': - abstract: true - -'Neos.Form.Builder:IdentifierMixin': - abstract: true - - 'Wegmeister.DatabaseStorage:DatabaseStorageFinisher': superTypes: 'Neos.Form.Builder:AbstractFinisher': true diff --git a/NodeTypes/PaperTiger/DatabaseStorageAction.yaml b/NodeTypes/PaperTiger/DatabaseStorageAction.yaml new file mode 100644 index 0000000..88cde1b --- /dev/null +++ b/NodeTypes/PaperTiger/DatabaseStorageAction.yaml @@ -0,0 +1,23 @@ +Wegmeister.DatabaseStorage:PaperTiger.DatabaseStorageAction: + superTypes: + 'Sitegeist.PaperTiger:Action': true + ui: + label: 'i18n' + icon: 'icon-database' + properties: + identifier: + type: string + ui: + label: 'i18n' + showInCreationDialog: true + inspector: + group: 'form' + help: + message: 'i18n' + validation: + 'Neos.Neos/Validation/NotEmptyValidator': [] + 'Neos.Neos/Validation/StringLengthValidator': + maximum: 255 + 'Neos.Neos/Validation/RegularExpressionValidator': + regularExpression: '/^[a-z0-9\-]+$/i' + validationErrorMessage: 'Only letters, numbers and dashes are allowed.' \ No newline at end of file diff --git a/Resources/Private/Fusion/FormBuilder/FinisherDefinition.fusion b/Resources/Private/Fusion/FormBuilder/FinisherDefinition.fusion new file mode 100644 index 0000000..68fc271 --- /dev/null +++ b/Resources/Private/Fusion/FormBuilder/FinisherDefinition.fusion @@ -0,0 +1,7 @@ +prototype(Wegmeister.DatabaseStorage:DatabaseStorageFinisher.Definition) < prototype(Neos.Form.Builder:Finisher.Definition) { + formElementType = 'Wegmeister.DatabaseStorage:DatabaseStorageFinisher' + + options { + identifier = ${null} + } +} diff --git a/Resources/Private/Fusion/PaperTiger/ActionDefinition.fusion b/Resources/Private/Fusion/PaperTiger/ActionDefinition.fusion new file mode 100644 index 0000000..14b6971 --- /dev/null +++ b/Resources/Private/Fusion/PaperTiger/ActionDefinition.fusion @@ -0,0 +1,11 @@ +prototype(Wegmeister.DatabaseStorage:PaperTiger.DatabaseStorageAction.Definition) < prototype(Neos.Fusion:Component) { + identifier = ${q(node).property('identifier')} + + renderer = Sitegeist.PaperTiger:Action { + type = '\\Wegmeister\\DatabaseStorage\\FusionForm\\Runtime\\Action\\DatabaseStorageAction' + options { + identifier = ${props.identifier} + formValues = ${data} + } + } +} diff --git a/Resources/Private/Fusion/PaperTiger/ActionPreview.fusion b/Resources/Private/Fusion/PaperTiger/ActionPreview.fusion new file mode 100644 index 0000000..0830251 --- /dev/null +++ b/Resources/Private/Fusion/PaperTiger/ActionPreview.fusion @@ -0,0 +1,11 @@ +prototype(Wegmeister.DatabaseStorage:PaperTiger.DatabaseStorageAction.Preview) < prototype(Neos.Fusion:Component) { + identifier = ${q(node).property('identifier')} + title = ${Translation.translate('Wegmeister.DatabaseStorage:NodeTypes.PaperTiger.DatabaseStorageAction:properties.identifier')} + + renderer = afx` +
+
{props.title}
+
{props.identifier}
+
+ ` +} \ No newline at end of file diff --git a/Resources/Private/Fusion/Root.fusion b/Resources/Private/Fusion/Root.fusion index 68fc271..fe1d560 100644 --- a/Resources/Private/Fusion/Root.fusion +++ b/Resources/Private/Fusion/Root.fusion @@ -1,7 +1 @@ -prototype(Wegmeister.DatabaseStorage:DatabaseStorageFinisher.Definition) < prototype(Neos.Form.Builder:Finisher.Definition) { - formElementType = 'Wegmeister.DatabaseStorage:DatabaseStorageFinisher' - - options { - identifier = ${null} - } -} +include: **/*.fusion diff --git a/Resources/Private/Translations/de/NodeTypes/PaperTiger/DatabaseStorageAction.xlf b/Resources/Private/Translations/de/NodeTypes/PaperTiger/DatabaseStorageAction.xlf new file mode 100644 index 0000000..d4fdc6f --- /dev/null +++ b/Resources/Private/Translations/de/NodeTypes/PaperTiger/DatabaseStorageAction.xlf @@ -0,0 +1,19 @@ + + + + + + Database Storage + Datenbank-Speicher + + + Table name + Tabellenname + + + The name used to store all entered forms in. Items of the same table name will be grouped together. Could theoretically be used on multiple forms, but try not to do that, unless you know what you are doing :) + Der Name, unter dem alle abgeschickten Formulare gespeichert werden. Einträge mit demselben Tabellennamen werden in Gruppen zusammengefasst. Theoretisch können mehrere Formulare den selben Namen verwenden – das sollte aber vermieden werden, sofern Sie sich hier unsicher sind :) + + + + diff --git a/Resources/Private/Translations/en/NodeTypes/PaperTiger/DatabaseStorageAction.xlf b/Resources/Private/Translations/en/NodeTypes/PaperTiger/DatabaseStorageAction.xlf new file mode 100644 index 0000000..7dab857 --- /dev/null +++ b/Resources/Private/Translations/en/NodeTypes/PaperTiger/DatabaseStorageAction.xlf @@ -0,0 +1,16 @@ + + + + + + Database Storage + + + Table name + + + The name used to store all entered forms in. Items of the same table name will be grouped together. Could theoretically be used on multiple forms, but try not to do that, unless you know what you are doing :) + + + + diff --git a/composer.json b/composer.json index ab1dd43..2d2620a 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,8 @@ } }, "suggest": { - "neos/fusion-form": "New Form rendering with Fusion and AFX" + "neos/fusion-form": "New Form rendering with Fusion and AFX", + "sitegeist/papertiger": "Form builder for Neos CMS based on Neos.Fusion.Form" }, "extra": { "neos": {