Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ENHANCEMENT Allow setting folderName to Upload in UploadField using

setFolderName()
  • Loading branch information...
commit 5ce1dc18220de7fd2b6747896202aea5fdc60e37 1 parent 7f60ced
Sean Harvey halkyon authored
Showing with 13 additions and 0 deletions.
  1. +13 −0 forms/UploadField.php
13 forms/UploadField.php
View
@@ -47,6 +47,11 @@ class UploadField extends FileField {
/**
* @var String
*/
+ protected $folderName;
+
+ /**
+ * @var String
+ */
protected $template = 'UploadField';
/**
@@ -145,6 +150,14 @@ public function __construct($name, $title = null, SS_List $items = null) {
}
/**
+ * 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)
*
* @param String

3 comments on commit 5ce1dc1

Zauberfisch

@halkyon why would we add this here?
both, the variable and the setter are already defined in the parent class.
Also, by adding protected $folderName; without a default value the UploadField if you don't explicitly set a foldername

(cc @chillu)

Ingo Schommer
Owner

@halkyon @Zauberfisch agreed, we should remove it.

Sean Harvey
Owner

@Zauberfisch You're right. I'll remove it.

Please sign in to comment.
Something went wrong with that request. Please try again.