{
$this->_preGetDefinition();
$res = $this->_attributes;
- if ($this->getAttribute('read_only', false)) {
+ if ($this->getAttribute('read_only', false) && $res['type'] !== 'hidden') {
$res['view_namespace'] = CubistBackpackServiceProvider::NAMESPACE . '::fields';
$res['type'] = 'static_value';
}
+ if($this->getAttribute('hidden',false)){
+ $res['view_namespace'] = 'crud::fields';
+ $res['type'] = 'hidden';
+ }
$res['attributes'] = $this->getFieldAttributes();
return $res;
}
protected $_adminType = 'upload';
protected $_disk = 'uploads';
+ protected $_multiple = false;
+
protected function getFieldAttributes()
{
$res = parent::getFieldAttributes();
$res['upload'] = true;
$res['disk'] = $this->_disk;
+ $res['multiple'] = $this->_multiple;
return $res;
}
+
+ protected function _postSetAttributes()
+ {
+ parent::_postSetAttributes();
+ if ($this->getAttribute('multiple', false)) {
+ $this->_adminType = 'upload_multiple';
+ } else {
+ $this->_adminType = 'upload';
+ }
+ }
}