@@ -43,10 +43,11 @@ discard block |
||
| 43 | 43 | protected function _addRules($element,$attributes){ |
| 44 | 44 | if(isset($attributes["rules"])){ |
| 45 | 45 | $rules=$attributes["rules"]; |
| 46 | - if(\is_array($rules)) |
|
| 47 | - $element->addRules($rules); |
|
| 48 | - else |
|
| 49 | - $element->addRule($rules); |
|
| 46 | + if(\is_array($rules)) { |
|
| 47 | + $element->addRules($rules); |
|
| 48 | + } else { |
|
| 49 | + $element->addRule($rules); |
|
| 50 | + } |
|
| 50 | 51 | unset($attributes["rules"]); |
| 51 | 52 | } |
| 52 | 53 | } |
@@ -56,8 +57,9 @@ discard block |
||
| 56 | 57 | $caption=$this->_instanceViewer->getCaption($index); |
| 57 | 58 | $name=$this->_instanceViewer->getFieldName($index); |
| 58 | 59 | $element=$elementCallback($name,$caption,$value); |
| 59 | - if(\is_array($attributes)) |
|
| 60 | - $this->_applyAttributes($element, $attributes,$index); |
|
| 60 | + if(\is_array($attributes)) { |
|
| 61 | + $this->_applyAttributes($element, $attributes,$index); |
|
| 62 | + } |
|
| 61 | 63 | return $element; |
| 62 | 64 | }); |
| 63 | 65 | return $this; |
@@ -34,8 +34,9 @@ discard block |
||
| 34 | 34 | $name=$attributes["name"]; |
| 35 | 35 | } |
| 36 | 36 | $element=$elementCallback($this->_getFieldIdentifier($prefix),$value,$name); |
| 37 | - if(\is_array($attributes)) |
|
| 38 | - $this->_applyAttributes($element, $attributes,$index); |
|
| 37 | + if(\is_array($attributes)) { |
|
| 38 | + $this->_applyAttributes($element, $attributes,$index); |
|
| 39 | + } |
|
| 39 | 40 | return $element; |
| 40 | 41 | }); |
| 41 | 42 | return $this; |
@@ -68,7 +69,9 @@ discard block |
||
| 68 | 69 | |
| 69 | 70 | public function fieldAsImage($index,$size=Size::SMALL,$circular=false){ |
| 70 | 71 | $this->setValueFunction($index,function($img) use($size,$circular){ |
| 71 | - $image=new HtmlImage($this->_getFieldIdentifier("image"),$img);$image->setSize($size);if($circular)$image->setCircular(); |
|
| 72 | + $image=new HtmlImage($this->_getFieldIdentifier("image"),$img);$image->setSize($size);if($circular) { |
|
| 73 | + $image->setCircular(); |
|
| 74 | + } |
|
| 72 | 75 | return $image; |
| 73 | 76 | }); |
| 74 | 77 | return $this; |