-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEATURE: Allow FileUpload "resourceCollection" to be configured
See neos/form#114
- Loading branch information
1 parent
4e6cf76
commit a0d1a9c
Showing
4 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters