From 842dc986817bf3fe413798fb0b0aa77e3b586783 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 13 May 2013 16:53:02 +0200 Subject: [PATCH] Added "saves into..." label to UploadField template CMS users shouldn't need to guess where their files will end up. --- forms/UploadField.php | 5 +++++ templates/UploadField.ss | 13 ++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/forms/UploadField.php b/forms/UploadField.php index a05dfc28e67..e117f357e51 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 6e4b74da08b..21acf6a2d61 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 %>