From 5ce1dc18220de7fd2b6747896202aea5fdc60e37 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Wed, 14 Mar 2012 15:49:08 +1300 Subject: [PATCH] ENHANCEMENT Allow setting folderName to Upload in UploadField using setFolderName() --- forms/UploadField.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/forms/UploadField.php b/forms/UploadField.php index 85f643462..cdbbf1966 100644 --- a/forms/UploadField.php +++ b/forms/UploadField.php @@ -44,6 +44,11 @@ class UploadField extends FileField { '$Action!' => '$Action', ); + /** + * @var String + */ + protected $folderName; + /** * @var String */ @@ -144,6 +149,14 @@ class UploadField extends FileField { $this->getValidator()->setAllowedMaxFileSize(min(File::ini2bytes(ini_get('upload_max_filesize')), File::ini2bytes(ini_get('post_max_size')))); // get the lower max size } + /** + * Set the folder name to upload to (relative to ASSETS_PATH) + * @param string $name Name of folder + */ + public function setFolderName($name) { + $this->folderName = $name; + } + /** * Set name of template used for Buttons on each file (replace, edit, remove, delete) (without path or extension) *