diff --git a/forms/UploadField.php b/forms/UploadField.php index a05dfc28e..e117f357e 100644 --- a/forms/UploadField.php +++ b/forms/UploadField.php @@ -93,6 +93,11 @@ class UploadField extends FileField { * String values are interpreted as permission codes. */ 'canAttachExisting' => "CMS_ACCESS_AssetAdmin", + /** + * @var boolean Shows the target folder for new uploads in the field UI. + * Disable to keep the internal filesystem structure hidden from users. + */ + 'canPreviewFolder' => true, /** * @var boolean If a second file is uploaded, should it replace the existing one rather than throwing an errror? * This only applies for has_one relationships, and only replaces the association diff --git a/templates/UploadField.ss b/templates/UploadField.ss index 6e4b74da0..21acf6a2d 100644 --- a/templates/UploadField.ss +++ b/templates/UploadField.ss @@ -44,13 +44,16 @@ <% end_if %>
- + <% if getConfig('canPreviewFolder') %> + (<%t UploadField.UPLOADSINTO 'saves into /{path}' path=$FolderName %>) + <% end_if %> + <% if canUpload %>
<% end_if %> -<% if Description %>$Description<% end_if %> \ No newline at end of file +<% if Description %>$Description<% end_if %>