Skip to content
This repository
Browse code

ENHANCEMENT Allow setting folderName to Upload in UploadField using

setFolderName()
  • Loading branch information...
commit 5ce1dc18220de7fd2b6747896202aea5fdc60e37 1 parent 7f60ced
Sean Harvey authored March 14, 2012

Showing 1 changed file with 13 additions and 0 deletions. Show diff stats Hide diff stats

  1. 13  forms/UploadField.php
13  forms/UploadField.php
@@ -47,6 +47,11 @@ class UploadField extends FileField {
47 47
 	/**
48 48
 	 * @var String
49 49
 	 */
  50
+	protected $folderName;
  51
+
  52
+	/**
  53
+	 * @var String
  54
+	 */
50 55
 	protected $template = 'UploadField';
51 56
 
52 57
 	/**
@@ -145,6 +150,14 @@ public function __construct($name, $title = null, SS_List $items = null) {
145 150
 	}
146 151
 
147 152
 	/**
  153
+	 * Set the folder name to upload to (relative to ASSETS_PATH)
  154
+	 * @param string $name Name of folder
  155
+	 */
  156
+	public function setFolderName($name) {
  157
+		$this->folderName = $name;
  158
+	}
  159
+
  160
+	/**
148 161
 	 * Set name of template used for Buttons on each file (replace, edit, remove, delete) (without path or extension)
149 162
 	 * 
150 163
 	 * @param String

3 notes on commit 5ce1dc1

Collaborator

@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.