@@ -17,8 +17,9 @@ |
||
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | public function setInputType($type){ |
| 20 | - if($type==="hidden") |
|
| 21 | - $this->addToProperty("style","display:none;"); |
|
| 20 | + if($type==="hidden") { |
|
| 21 | + $this->addToProperty("style","display:none;"); |
|
| 22 | + } |
|
| 22 | 23 | $this->getDataField()->setInputType($type); |
| 23 | 24 | return $this; |
| 24 | 25 | } |
@@ -62,10 +62,11 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | public function setDismissable($dismiss=true){ |
| 65 | - if($dismiss===true) |
|
| 66 | - $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
| 67 | - else |
|
| 68 | - $this->close=NULL; |
|
| 65 | + if($dismiss===true) { |
|
| 66 | + $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
| 67 | + } else { |
|
| 68 | + $this->close=NULL; |
|
| 69 | + } |
|
| 69 | 70 | return $this; |
| 70 | 71 | } |
| 71 | 72 | |
@@ -100,7 +101,8 @@ discard block |
||
| 100 | 101 | public function setMessage($message){ |
| 101 | 102 | if(\is_array($this->content)){ |
| 102 | 103 | $this->content[\sizeof($this->content)-1]=$message; |
| 103 | - }else |
|
| 104 | - $this->setContent($message); |
|
| 104 | + } else { |
|
| 105 | + $this->setContent($message); |
|
| 106 | + } |
|
| 105 | 107 | } |
| 106 | 108 | } |
| 107 | 109 | \ No newline at end of file |
@@ -52,8 +52,9 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function addHeader($title, $niveau=1, $dividing=true) { |
| 54 | 54 | $header=new HtmlHeader("", $niveau, $title); |
| 55 | - if ($dividing) |
|
| 56 | - $header->setDividing(); |
|
| 55 | + if ($dividing) { |
|
| 56 | + $header->setDividing(); |
|
| 57 | + } |
|
| 57 | 58 | return $this->addItem($header); |
| 58 | 59 | } |
| 59 | 60 | |
@@ -74,14 +75,16 @@ discard block |
||
| 74 | 75 | if (\is_string($end)) { |
| 75 | 76 | $label=$end; |
| 76 | 77 | \array_pop($fields); |
| 77 | - } else |
|
| 78 | - $label=NULL; |
|
| 78 | + } else { |
|
| 79 | + $label=NULL; |
|
| 80 | + } |
|
| 79 | 81 | } |
| 80 | 82 | $this->_fields=\array_merge($this->_fields, $fields); |
| 81 | 83 | $fields=new HtmlFormFields("fields-" . $this->identifier . "-" . $this->count(), $fields); |
| 82 | 84 | } |
| 83 | - if (isset($label)) |
|
| 84 | - $fields=new HtmlFormField("", $fields, $label); |
|
| 85 | + if (isset($label)) { |
|
| 86 | + $fields=new HtmlFormField("", $fields, $label); |
|
| 87 | + } |
|
| 85 | 88 | } else { |
| 86 | 89 | $fields=new HtmlFormFields("fields-" . $this->identifier . "-" . $this->count()); |
| 87 | 90 | } |
@@ -134,12 +137,15 @@ discard block |
||
| 134 | 137 | */ |
| 135 | 138 | public function addMessage($identifier, $content, $header=NULL, $icon=NULL, $type=NULL) { |
| 136 | 139 | $message=new HtmlMessage($identifier, $content); |
| 137 | - if (isset($header)) |
|
| 138 | - $message->addHeader($header); |
|
| 139 | - if (isset($icon)) |
|
| 140 | - $message->setIcon($icon); |
|
| 141 | - if (isset($type)) |
|
| 142 | - $message->setStyle($type); |
|
| 140 | + if (isset($header)) { |
|
| 141 | + $message->addHeader($header); |
|
| 142 | + } |
|
| 143 | + if (isset($icon)) { |
|
| 144 | + $message->setIcon($icon); |
|
| 145 | + } |
|
| 146 | + if (isset($type)) { |
|
| 147 | + $message->setStyle($type); |
|
| 148 | + } |
|
| 143 | 149 | return $this->addItem($message); |
| 144 | 150 | } |
| 145 | 151 | |
@@ -156,23 +162,26 @@ discard block |
||
| 156 | 162 | } |
| 157 | 163 | |
| 158 | 164 | public function compile(JsUtils $js=NULL,&$view=NULL){ |
| 159 | - if(\sizeof($this->_validationParams)>0) |
|
| 160 | - $this->setProperty("novalidate", ""); |
|
| 165 | + if(\sizeof($this->_validationParams)>0) { |
|
| 166 | + $this->setProperty("novalidate", ""); |
|
| 167 | + } |
|
| 161 | 168 | return parent::compile($js,$view); |
| 162 | 169 | } |
| 163 | 170 | |
| 164 | 171 | public function run(JsUtils $js) { |
| 165 | 172 | $compo=NULL; |
| 166 | 173 | foreach ($this->_fields as $field){ |
| 167 | - if($field instanceof HtmlFormField) |
|
| 168 | - $compo=$this->addCompoValidation($js, $compo, $field); |
|
| 174 | + if($field instanceof HtmlFormField) { |
|
| 175 | + $compo=$this->addCompoValidation($js, $compo, $field); |
|
| 176 | + } |
|
| 169 | 177 | } |
| 170 | 178 | foreach ($this->content as $field){ |
| 171 | 179 | if($field instanceof HtmlFormFields){ |
| 172 | 180 | $items=$field->getItems(); |
| 173 | 181 | foreach ($items as $_field){ |
| 174 | - if($_field instanceof HtmlFormField) |
|
| 175 | - $compo=$this->addCompoValidation($js, $compo, $_field); |
|
| 182 | + if($_field instanceof HtmlFormField) { |
|
| 183 | + $compo=$this->addCompoValidation($js, $compo, $_field); |
|
| 184 | + } |
|
| 176 | 185 | } |
| 177 | 186 | } |
| 178 | 187 | } |
@@ -47,9 +47,9 @@ |
||
| 47 | 47 | $rules=$attributes["rules"]; |
| 48 | 48 | if(\is_array($rules)){ |
| 49 | 49 | $element->addRules($rules); |
| 50 | + } else { |
|
| 51 | + $element->addRule($rules); |
|
| 50 | 52 | } |
| 51 | - else |
|
| 52 | - $element->addRule($rules); |
|
| 53 | 53 | unset($attributes["rules"]); |
| 54 | 54 | } |
| 55 | 55 | } |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | if(\sizeof($this->_compileParts)<3){ |
| 233 | 233 | $this->_template="%content%"; |
| 234 | 234 | $this->refresh(); |
| 235 | - }else{ |
|
| 235 | + } else{ |
|
| 236 | 236 | if ($this->propertyContains("class", "sortable")) { |
| 237 | 237 | $this->addEvent("execute", "$('#" . $this->identifier . "').tablesort();"); |
| 238 | 238 | } |
@@ -255,8 +255,9 @@ discard block |
||
| 255 | 255 | $result= $this->getBody()->_addRow($result); |
| 256 | 256 | } |
| 257 | 257 | if(isset($this->_afterCompileEvents["onNewRow"])){ |
| 258 | - if(\is_callable($this->_afterCompileEvents["onNewRow"])) |
|
| 259 | - $this->_afterCompileEvents["onNewRow"]($result,$object); |
|
| 258 | + if(\is_callable($this->_afterCompileEvents["onNewRow"])) { |
|
| 259 | + $this->_afterCompileEvents["onNewRow"]($result,$object); |
|
| 260 | + } |
|
| 260 | 261 | } |
| 261 | 262 | return $result; |
| 262 | 263 | } |
@@ -277,8 +278,9 @@ discard block |
||
| 277 | 278 | |
| 278 | 279 | public function run(JsUtils $js){ |
| 279 | 280 | $result= parent::run($js); |
| 280 | - if(isset($this->_footer)) |
|
| 281 | - $this->_footer->run($js); |
|
| 281 | + if(isset($this->_footer)) { |
|
| 282 | + $this->_footer->run($js); |
|
| 283 | + } |
|
| 282 | 284 | return $result; |
| 283 | 285 | } |
| 284 | 286 | |
@@ -17,8 +17,9 @@ |
||
| 17 | 17 | |
| 18 | 18 | public function setBasic($very=false) { |
| 19 | 19 | $table=$this->getTable(); |
| 20 | - if ($very) |
|
| 21 | - $table->addToPropertyCtrl("class", "very", array ("very" )); |
|
| 20 | + if ($very) { |
|
| 21 | + $table->addToPropertyCtrl("class", "very", array ("very" )); |
|
| 22 | + } |
|
| 22 | 23 | return $table->addToPropertyCtrl("class", "basic", array ("basic" )); |
| 23 | 24 | } |
| 24 | 25 | |
@@ -14,21 +14,24 @@ discard block |
||
| 14 | 14 | return $array[$key]; |
| 15 | 15 | } |
| 16 | 16 | $values=array_values($array); |
| 17 | - if ($pos < sizeof($values)) |
|
| 18 | - return $values[$pos]; |
|
| 17 | + if ($pos < sizeof($values)) { |
|
| 18 | + return $values[$pos]; |
|
| 19 | + } |
|
| 19 | 20 | } |
| 20 | 21 | |
| 21 | 22 | public static function getConditionalValue($array, $key, $condition) { |
| 22 | 23 | $result=NULL; |
| 23 | 24 | if (array_key_exists($key, $array)) { |
| 24 | 25 | $result=$array[$key]; |
| 25 | - if ($condition($result) === true) |
|
| 26 | - return $result; |
|
| 26 | + if ($condition($result) === true) { |
|
| 27 | + return $result; |
|
| 28 | + } |
|
| 27 | 29 | } |
| 28 | 30 | $values=array_values($array); |
| 29 | 31 | foreach ( $values as $val ) { |
| 30 | - if ($condition($val) === true) |
|
| 31 | - return $val; |
|
| 32 | + if ($condition($val) === true) { |
|
| 33 | + return $val; |
|
| 34 | + } |
|
| 32 | 35 | } |
| 33 | 36 | return $result; |
| 34 | 37 | } |
@@ -36,8 +39,9 @@ discard block |
||
| 36 | 39 | public static function getDefaultValue($array, $key, $default=NULL) { |
| 37 | 40 | if (array_key_exists($key, $array)) { |
| 38 | 41 | return $array[$key]; |
| 39 | - } else |
|
| 40 | - return $default; |
|
| 42 | + } else { |
|
| 43 | + return $default; |
|
| 44 | + } |
|
| 41 | 45 | } |
| 42 | 46 | |
| 43 | 47 | public static function implode($glue, $pieces) { |
@@ -84,7 +88,7 @@ discard block |
||
| 84 | 88 | foreach ($objects as $object){ |
| 85 | 89 | $result[]=self::callFunction($object, $modelFunction); |
| 86 | 90 | } |
| 87 | - }else{ |
|
| 91 | + } else{ |
|
| 88 | 92 | foreach ($objects as $object){ |
| 89 | 93 | $result[self::callFunction($object, $identifierFunction)]=self::callFunction($object, $modelFunction); |
| 90 | 94 | } |
@@ -93,9 +97,9 @@ discard block |
||
| 93 | 97 | } |
| 94 | 98 | |
| 95 | 99 | private static function callFunction($object,$callback){ |
| 96 | - if(\is_string($callback)) |
|
| 97 | - return \call_user_func(array($object, $callback),[]); |
|
| 98 | - else if (\is_callable($callback)){ |
|
| 100 | + if(\is_string($callback)) { |
|
| 101 | + return \call_user_func(array($object, $callback),[]); |
|
| 102 | + } else if (\is_callable($callback)){ |
|
| 99 | 103 | return $callback($object); |
| 100 | 104 | } |
| 101 | 105 | } |
@@ -50,8 +50,9 @@ |
||
| 50 | 50 | $comp=$item->compile($js); |
| 51 | 51 | if(isset($js)){ |
| 52 | 52 | $bs=$item->run($js); |
| 53 | - if(isset($bs)) |
|
| 54 | - $this->params['onShow']=$bs->getScript(); |
|
| 53 | + if(isset($bs)) { |
|
| 54 | + $this->params['onShow']=$bs->getScript(); |
|
| 55 | + } |
|
| 55 | 56 | } |
| 56 | 57 | $item=$comp; |
| 57 | 58 | } |
@@ -54,26 +54,29 @@ |
||
| 54 | 54 | for($i=0;$i<$count;$i++){ |
| 55 | 55 | $step=$this->content[$i]; |
| 56 | 56 | $step->removeStatus(); |
| 57 | - if($i<$activestep) |
|
| 58 | - $step->setCompleted(); |
|
| 59 | - elseif ($i===$activestep) |
|
| 60 | - $step->setActive(); |
|
| 61 | - else |
|
| 62 | - $step->setDisabled(); |
|
| 57 | + if($i<$activestep) { |
|
| 58 | + $step->setCompleted(); |
|
| 59 | + } elseif ($i===$activestep) { |
|
| 60 | + $step->setActive(); |
|
| 61 | + } else { |
|
| 62 | + $step->setDisabled(); |
|
| 63 | + } |
|
| 63 | 64 | } |
| 64 | - }else{ |
|
| 65 | + } else{ |
|
| 65 | 66 | foreach ($this->content as $step){ |
| 66 | 67 | $step->removeStatus(); |
| 67 | 68 | } |
| 68 | - if($activestep<$count) |
|
| 69 | - $this->content[$activestep]->setActive(); |
|
| 69 | + if($activestep<$count) { |
|
| 70 | + $this->content[$activestep]->setActive(); |
|
| 71 | + } |
|
| 70 | 72 | } |
| 71 | 73 | return $this; |
| 72 | 74 | } |
| 73 | 75 | |
| 74 | 76 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
| 75 | - if(isset($this->_activeStep) && \is_numeric($this->_activeStep)) |
|
| 76 | - $this->defineActiveStep(); |
|
| 77 | + if(isset($this->_activeStep) && \is_numeric($this->_activeStep)) { |
|
| 78 | + $this->defineActiveStep(); |
|
| 79 | + } |
|
| 77 | 80 | return parent::compile($js,$view); |
| 78 | 81 | } |
| 79 | 82 | |