mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
API CHANGE Removed $rightTitle and $folderName constructor arguments for FileField and SimpleImageField, use setRightTitle() and setFolderName() instead
This commit is contained in:
parent
1a10e8bcf5
commit
27ec98cfce
@ -101,15 +101,13 @@ class FileField extends FormField {
|
|||||||
* @param string $name The internal field name, passed to forms.
|
* @param string $name The internal field name, passed to forms.
|
||||||
* @param string $title The field label.
|
* @param string $title The field label.
|
||||||
* @param int $value The value of the field.
|
* @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) {
|
function __construct($name, $title = null, $value = null) {
|
||||||
if(isset($folderName)) $this->folderName = $folderName;
|
if(count(func_get_args()) > 3) Deprecation::notice('3.0', 'Use setRightTitle() and setFolderName() instead of constructor arguments');
|
||||||
|
|
||||||
$this->upload = new Upload();
|
$this->upload = new Upload();
|
||||||
|
|
||||||
parent::__construct($name, $title, $value, $form, $rightTitle);
|
parent::__construct($name, $title, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Field($properties = array()) {
|
public function Field($properties = array()) {
|
||||||
|
@ -65,8 +65,10 @@
|
|||||||
|
|
||||||
class SimpleImageField extends FileField {
|
class SimpleImageField extends FileField {
|
||||||
|
|
||||||
function __construct($name, $title = null, $value = null, $form = null, $rightTitle = null, $folderName = null) {
|
function __construct($name, $title = null, $value = null) {
|
||||||
parent::__construct($name, $title, $value, $form, $rightTitle, $folderName);
|
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'));
|
$this->getValidator()->setAllowedExtensions(array('jpg','gif','png'));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user