mirror of
https://github.com/a2nt/silverstripe-elemental-basics.git
synced 2024-10-22 17:05:54 +02:00
IMPR: Bulk slider uploader
This commit is contained in:
parent
0fb2342887
commit
6cbf5ea662
@ -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();
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user