diff --git a/forms/FileField.php b/forms/FileField.php index d63e7217f..ce53ceab7 100644 --- a/forms/FileField.php +++ b/forms/FileField.php @@ -101,15 +101,13 @@ class FileField extends FormField { * @param string $name The internal field name, passed to forms. * @param string $title The field label. * @param int $value The value of the field. - * @param Form $form Reference to the container form - * @param string $rightTitle Used in SmallFieldHolder() to force a right-aligned label - * @param string $folderName Folder to upload files to */ - function __construct($name, $title = null, $value = null, $form = null, $rightTitle = null, $folderName = null) { - if(isset($folderName)) $this->folderName = $folderName; + function __construct($name, $title = null, $value = null) { + if(count(func_get_args()) > 3) Deprecation::notice('3.0', 'Use setRightTitle() and setFolderName() instead of constructor arguments'); + $this->upload = new Upload(); - parent::__construct($name, $title, $value, $form, $rightTitle); + parent::__construct($name, $title, $value); } public function Field($properties = array()) { diff --git a/forms/SimpleImageField.php b/forms/SimpleImageField.php index 279a9f8c4..6f22e4014 100644 --- a/forms/SimpleImageField.php +++ b/forms/SimpleImageField.php @@ -65,8 +65,10 @@ class SimpleImageField extends FileField { - function __construct($name, $title = null, $value = null, $form = null, $rightTitle = null, $folderName = null) { - parent::__construct($name, $title, $value, $form, $rightTitle, $folderName); + function __construct($name, $title = null, $value = null) { + if(count(func_get_args()) > 3) Deprecation::notice('3.0', 'Use setRightTitle() and setFolderName() instead of constructor arguments'); + + parent::__construct($name, $title, $value); $this->getValidator()->setAllowedExtensions(array('jpg','gif','png')); }