]> _ Git - cubist_cms-back.git/commitdiff
#2810
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 11 Jun 2019 14:03:27 +0000 (16:03 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 11 Jun 2019 14:03:27 +0000 (16:03 +0200)
src/app/Magic/Fields/Files.php
src/app/Magic/Fields/Images.php

index ed1c2bda821ece8a9b829f5ee29af5c3072d049a..071a22bb154d926a02168bf9e7f10256cc87e953 100644 (file)
@@ -19,22 +19,12 @@ class Files extends Field
     protected function _postSetAttributes()
     {
         if ($this->_multiple) {
-            $this->setAttribute('type', 'upload_multiple');
+            $this->setAttribute('type', 'browse_multiple');
         } else {
-            $this->setAttribute('type', 'upload');
+            $this->setAttribute('type', 'browse');
         }
 
-        return parent::_postSetAttributes();
-    }
-
-    public function setMutator($value)
-    {
-        $model = $this->getModelInstance();
-
-        $function = $this->_multiple ? 'uploadMultipleToDisk' : 'uploadToDisk';
-        $path = $model->getAttribute('name') . '/' . $model->getPrimaryKey();
-
-        $model->$function($value, $this->getAttribute('name'), $this->getAttribute('disk'), $path);
+        parent::_postSetAttributes();
     }
 
 }
index 4c54636b8da776cfa01341f57dc8d608863af673..580386b69f619f5f6fefbf2fa8c617d2688d27db 100644 (file)
@@ -7,15 +7,4 @@ namespace Cubist\Backpack\app\Magic\Fields;
 class Images extends Files
 {
     protected $_mimeTypes = ['image/png', 'image/jpeg', 'image/svg+xml', 'image/webp', 'image/gif'];
-
-    protected function _postSetAttributes()
-    {
-        if ($this->_multiple) {
-            $this->setAttribute('type', 'upload_multiple');
-        } else {
-            $this->setAttribute('type', 'image');
-        }
-
-        return parent::_postSetAttributes();
-    }
 }