IMPR: Bulk slider uploader

This commit is contained in:
Tony Air 2022-04-19 15:19:49 +02:00
parent 0fb2342887
commit 6cbf5ea662
2 changed files with 5 additions and 9 deletions

View File

@ -90,10 +90,11 @@ class SliderElement extends ElementSlideshow
if ($grid) { if ($grid) {
$config = $grid->getConfig(); $config = $grid->getConfig();
/*$bulk = new BulkUploader('Image', Image::class, true); $bulk = new BulkUploader('Image', SlideImage::class, false);
$bulk $bulk
->setUfSetup('setFolderName', 'Uploads/SlideImages'); ->setUfSetup('setFolderName', 'Uploads/SlideImages')
$config->addComponent($bulk);*/ ->setUfSetup('getValidator.setAllowedExtensions', ['jpg', 'jpeg', 'png', 'gif']);
$config->addComponent($bulk);
$columns = new GridFieldEditableColumns(); $columns = new GridFieldEditableColumns();

View File

@ -18,15 +18,10 @@ use SilverStripe\ORM\ValidationResult;
class SlideImageEx extends DataExtension class SlideImageEx extends DataExtension
{ {
/*public function onBulkUpload()
{
die('saadsadssdsda2222');
}
public function validate(ValidationResult $validationResult) public function validate(ValidationResult $validationResult)
{ {
if (!$this->owner->Name) { if (!$this->owner->Name) {
$this->owner->Name = rand(); $this->owner->Name = rand();
} }
}*/ }
} }