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) {
$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();

View File

@ -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();
}
}*/
}
}