File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
core/components/awss3mediasource Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
$ _lang ['source_type.awss3mediasource ' ] = 'AWS S3 Media Source 3.0 ' ;
4
- $ _lang ['source_type.awss3mediasource_desc ' ] = 'AWS S3 Media Source ' ;
4
+ $ _lang ['source_type.awss3mediasource_desc ' ] = 'AWS S3 Media Source ' ;
5
+ $ _lang ['prop_s3.baseDir_desc ' ] = 'S3 folder path, if set will limit Media Source to set folder path. ' ;
Original file line number Diff line number Diff line change @@ -92,6 +92,11 @@ public function getTypeDescription()
92
92
*/
93
93
public function getContainerList ($ path )
94
94
{
95
+ /** Need to check for the root or first loaded Media Source to add the proper baseDir if set. */
96
+ if ( empty (trim ($ path , '/ ' ))) {
97
+ $ base_dir = $ this ->xpdo ->getOption ('baseDir ' , $ this ->properties , '' );
98
+ $ path = trim ($ base_dir , '/ ' ) . '/ ' . ltrim ($ path , '/ ' );
99
+ }
95
100
list ($ listFiles , $ listDirectories ) = $ this ->listDirectory ($ path );
96
101
$ editAction = $ this ->getEditActionId ();
97
102
@@ -1140,6 +1145,14 @@ public function getDefaultProperties()
1140
1145
'value ' => '' ,
1141
1146
'lexicon ' => 'core:source ' ,
1142
1147
),
1148
+ 'baseDir ' => array (
1149
+ 'name ' => 'baseDir ' ,
1150
+ 'desc ' => 'prop_s3.baseDir_desc ' ,
1151
+ 'type ' => 'textfield ' ,
1152
+ 'options ' => '' ,
1153
+ 'value ' => '' ,
1154
+ 'lexicon ' => 'awss3mediasource:source ' ,
1155
+ ),
1143
1156
'key ' => array (
1144
1157
'name ' => 'key ' ,
1145
1158
'desc ' => 'prop_s3.key_desc ' ,
You can’t perform that action at this time.
0 commit comments