diff --git a/src/Elements/SliderElement.php b/src/Elements/SliderElement.php index 58ee7e1..b3fca98 100755 --- a/src/Elements/SliderElement.php +++ b/src/Elements/SliderElement.php @@ -90,10 +90,11 @@ class SliderElement extends ElementSlideshow if ($grid) { $config = $grid->getConfig(); - /*$bulk = new BulkUploader('Image', Image::class, true); + $bulk = new BulkUploader('Image', SlideImage::class, false); $bulk - ->setUfSetup('setFolderName', 'Uploads/SlideImages'); - $config->addComponent($bulk);*/ + ->setUfSetup('setFolderName', 'Uploads/SlideImages') + ->setUfSetup('getValidator.setAllowedExtensions', ['jpg', 'jpeg', 'png', 'gif']); + $config->addComponent($bulk); $columns = new GridFieldEditableColumns(); diff --git a/src/Extensions/SlideImageEx.php b/src/Extensions/SlideImageEx.php index f429691..c044efe 100755 --- a/src/Extensions/SlideImageEx.php +++ b/src/Extensions/SlideImageEx.php @@ -18,15 +18,10 @@ use SilverStripe\ORM\ValidationResult; class SlideImageEx extends DataExtension { - /*public function onBulkUpload() - { - die('saadsadssdsda2222'); - } - public function validate(ValidationResult $validationResult) { if (!$this->owner->Name) { $this->owner->Name = rand(); } - }*/ + } }