Skip to content

Commit f203ba7

Browse files
committed
TASK: initial commit
0 parents  commit f203ba7

File tree

7 files changed

+100
-0
lines changed

7 files changed

+100
-0
lines changed

Configuration/NodeTypes.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'Sandstorm.UploadToSpecificResourceCollection:AssetList':
2+
superTypes:
3+
'Neos.NodeTypes:AssetList': TRUE
4+
ui:
5+
label: Protected Asset List
6+
icon: 'icon-files-o'
7+
position: 700
8+
properties:
9+
assets:
10+
type: array<Neos\Media\Domain\Model\Asset>
11+
ui:
12+
inspector:
13+
editor: Sandstorm.UploadToSpecificResourceCollection/SpecificAssetEditor
14+
group: 'resources'
15+
reloadIfChanged: TRUE

Configuration/Settings.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Neos:
2+
Neos:
3+
userInterface:
4+
requireJsPathMapping:
5+
'Sandstorm.UploadToSpecificResourceCollection': 'resource://Sandstorm.UploadToSpecificResourceCollection/Public/JavaScript/Editors'
6+
7+
fusion:
8+
autoInclude:
9+
'Sandstorm.UploadToSpecificResourceCollection': TRUE
10+
11+
12+
Flow:
13+
resource:
14+
# Definition of resource storages provided by the Flow core.
15+
# Storages are used for storing and retrieving resources.
16+
storages:
17+
18+
protectedPersistentResourcesStorage:
19+
storage: 'Neos\Flow\ResourceManagement\Storage\WritableFileSystemStorage'
20+
storageOptions:
21+
path: '%FLOW_PATH_DATA%Persistent/ProtectedResources/'
22+
23+
collections:
24+
25+
# Collection which contains all persistent resources
26+
protectedPersistent:
27+
storage: 'protectedPersistentResourcesStorage'
28+
target: 'localWebDirectoryPersistentResourcesTarget'

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# an Asset List node type which puts its uploaded files into the "protectedPersistent" resource collection
2+
3+
If you use https://github.com/bwaidelich/Wwwision.PrivateResources, you might need an Asset list which is protected. This code provides an "Asset List"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
prototype(Sandstorm.UploadToSpecificResourceCollection:AssetList) >
2+
prototype(Sandstorm.UploadToSpecificResourceCollection:AssetList) < prototype(Neos.NodeTypes:AssetList)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<div class="neos-inspector-file">
2+
<div>{{view view.assetView contentBinding="view.assets"}}</div>
3+
4+
<div class="neos-inspector-file-upload" id="{{unbound view._containerId}}">
5+
<button id="{{unbound view._browseButtonId}}" class="neos-button neos-inspector-file-upload-files" {{bindAttr disabled="view._uploadInProgress:neos-disabled"}}>
6+
{{view._fileUploadLabel}}
7+
</button>
8+
{{#if view._uploadButtonShown}}
9+
<button class="neos-button neos-inspector-file-upload-button" allowed-file-types="{{unbound view.allowedFileTypes}}" {{bindAttr disabled="view._uploadInProgress"}} {{action "upload" target="view"}}>
10+
{{translate fallbackBinding="view.uploaderLabel" idBinding="view.uploaderLabel"}}
11+
</button>
12+
{{/if}}
13+
</div>
14+
</div>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
define(
2+
[
3+
'emberjs',
4+
'Library/jquery-with-dependencies',
5+
'Content/Inspector/Editors/AssetEditor',
6+
'text!./SpecificAssetEditor.html'
7+
],
8+
function(Ember, $, AssetEditor, template) {
9+
10+
return AssetEditor.extend({
11+
template: Ember.Handlebars.compile(template),
12+
_initializeUploader: function() {
13+
this._super();
14+
15+
this._uploader.bind('BeforeUpload', function(uploader, file) {
16+
uploader.settings.multipart_params['asset[resource][__collectionName]'] = 'protectedPersistent';
17+
});
18+
}
19+
});
20+
});

composer.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"description": "",
3+
"type": "neos-package",
4+
"name": "sandstorm/uploadtospecificresourcecollection",
5+
"require": {
6+
"neos/neos": "*"
7+
},
8+
"autoload": {
9+
"psr-4": {
10+
"Sandstorm\\UploadToSpecificResourceCollection\\": "Classes/"
11+
}
12+
},
13+
"extra": {
14+
"neos": {
15+
"package-key": "Sandstorm.UploadToSpecificResourceCollection"
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)