Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/1.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
bwaidelich committed Jun 30, 2020
2 parents 194c1b5 + a0d1a9c commit 4648b88
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Classes/NodeType/ResourceCollectionsPostprocessor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
namespace Neos\Form\Builder\NodeType;

use Neos\ContentRepository\Domain\Model\NodeType;
use Neos\ContentRepository\NodeTypePostprocessor\NodeTypePostprocessorInterface;
use Neos\Flow\Annotations as Flow;

/**
* Node Type post processor that populates the "resourceCollection" property with all configured resource collections
*/
class ResourceCollectionsPostprocessor implements NodeTypePostprocessorInterface
{

/**
* @Flow\InjectConfiguration(package="Neos.Flow", path="resource.collections")
* @var array
*/
protected $resourceCollectionSettings;

public function process(NodeType $nodeType, array &$configuration, array $options)
{
$resourceCollectionOptions = [];
foreach ($this->resourceCollectionSettings as $collectionName => $_) {
$resourceCollectionOptions[] = [
'value' => $collectionName,
'label' => $collectionName,
];
}
$configuration['properties']['resourceCollection']['ui']['inspector']['editorOptions']['values'] = $resourceCollectionOptions;
}
}
3 changes: 3 additions & 0 deletions Configuration/NodeTypes.Finishers.Email.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@
'plaintext':
label: i18n
icon: 'icon-font'
'multipart':
label: i18n
icon: 'icon-puzzle-piece'
'attachAllPersistentResources':
type: boolean
ui:
Expand Down
10 changes: 10 additions & 0 deletions Configuration/NodeTypes.FormElements.FileUpload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
superTypes:
'Neos.Form.Builder:FormElement': true
'Neos.Form.Builder:DefaultValueMixin': false
postprocessors:
'Neos.Form.Builder:ResourceCollectionsPostprocessor':
postprocessor: 'Neos\Form\Builder\NodeType\ResourceCollectionsPostprocessor'
ui:
label: 'File upload'
icon: 'icon-upload'
Expand Down Expand Up @@ -42,3 +45,10 @@
'csv':
label: '.csv'
icon: 'icon-file-text'
'resourceCollection':
type: string
ui:
label: i18n
inspector:
group: 'formElement'
editor: 'Neos.Neos/Inspector/Editors/SelectBoxEditor'
4 changes: 4 additions & 0 deletions Resources/Private/Translations/da/NodeTypes/EmailFinisher.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
<source>Plaintext</source>
<target>Klar tekst</target>
</trans-unit>
<trans-unit id="properties.format.selectBoxEditor.values.multipart" xml:space="preserve">
<source>Multipart</source>
<target>Multipart</target>
</trans-unit>
<trans-unit id="properties.attachAllPersistentResources" xml:space="preserve">
<source>Attach all uploaded files</source>
<target>Vedhæft alle uploadede filer</target>
Expand Down
3 changes: 3 additions & 0 deletions Resources/Private/Translations/de/NodeTypes/EmailFinisher.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
<trans-unit id="properties.format.selectBoxEditor.values.plaintext" xml:space="preserve">
<source>Plaintext</source>
<target xml:lang="de" state="translated">Klartext</target></trans-unit>
<trans-unit id="properties.format.selectBoxEditor.values.multipart" xml:space="preserve">
<source>Multipart</source>
<target xml:lang="de" state="translated">Multipart</target></trans-unit>
<trans-unit id="properties.attachAllPersistentResources" xml:space="preserve">
<source>Attach all uploaded files</source>
<target xml:lang="de" state="translated">Alle hochgeladene Dateien anhängen</target></trans-unit>
Expand Down
3 changes: 3 additions & 0 deletions Resources/Private/Translations/de/NodeTypes/FileUpload.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<trans-unit id="properties.allowedExtensions" xml:space="preserve">
<source>Allowed file types</source>
<target xml:lang="de" state="translated">Erlaubte Dateitypen</target></trans-unit>
<trans-unit id="properties.resourceCollection" xml:space="preserve">
<source>Target Resource Collection</source>
<target xml:lang="de" state="translated">Ziel "Resource Collection"</target></trans-unit>
</body>
</file>
</xliff>
3 changes: 3 additions & 0 deletions Resources/Private/Translations/en/NodeTypes/EmailFinisher.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
<trans-unit id="properties.format.selectBoxEditor.values.plaintext" xml:space="preserve">
<source>Plaintext</source>
</trans-unit>
<trans-unit id="properties.format.selectBoxEditor.values.multipart" xml:space="preserve">
<source>Multipart</source>
</trans-unit>
<trans-unit id="properties.attachAllPersistentResources" xml:space="preserve">
<source>Attach all uploaded files</source>
</trans-unit>
Expand Down
3 changes: 3 additions & 0 deletions Resources/Private/Translations/en/NodeTypes/FileUpload.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<trans-unit id="properties.allowedExtensions" xml:space="preserve">
<source>Allowed file types</source>
</trans-unit>
<trans-unit id="properties.resourceCollection" xml:space="preserve">
<source>Target Resource Collection</source>
</trans-unit>
</body>
</file>
</xliff>

0 comments on commit 4648b88

Please sign in to comment.