@@ -39,8 +39,9 @@ discard block |
||
39 | 39 | |
40 | 40 | public function getParam($key) { |
41 | 41 | $value=null; |
42 | - if (array_key_exists($key, $this->params)) |
|
43 | - $value=$this->params [$key]; |
|
42 | + if (array_key_exists($key, $this->params)) { |
|
43 | + $value=$this->params [$key]; |
|
44 | + } |
|
44 | 45 | return $value; |
45 | 46 | } |
46 | 47 | |
@@ -49,16 +50,18 @@ discard block |
||
49 | 50 | } |
50 | 51 | |
51 | 52 | public function compile(JsUtils $js=NULL) { |
52 | - if ($js==NULL) |
|
53 | - $js=$this->js; |
|
53 | + if ($js==NULL) { |
|
54 | + $js=$this->js; |
|
55 | + } |
|
54 | 56 | $script=$this->getScript(); |
55 | 57 | $js->addToCompile($script); |
56 | 58 | } |
57 | 59 | |
58 | 60 | protected function setParamCtrl($key, $value, $typeCtrl) { |
59 | 61 | if (is_array($typeCtrl)) { |
60 | - if (array_search($value, $typeCtrl)===false) |
|
61 | - throw new \Exception("La valeur passée a propriété `".$key."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}"); |
|
62 | + if (array_search($value, $typeCtrl)===false) { |
|
63 | + throw new \Exception("La valeur passée a propriété `".$key."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}"); |
|
64 | + } |
|
62 | 65 | } else { |
63 | 66 | if (!$typeCtrl($value)) { |
64 | 67 | throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key); |
@@ -70,9 +73,9 @@ discard block |
||
70 | 73 | public function setParams($params) { |
71 | 74 | foreach ( $params as $k => $v ) { |
72 | 75 | $method="set".ucfirst($k); |
73 | - if (method_exists($this, $method)) |
|
74 | - $this->$method($v); |
|
75 | - else { |
|
76 | + if (method_exists($this, $method)) { |
|
77 | + $this->$method($v); |
|
78 | + } else { |
|
76 | 79 | $this->setParam($k, $v); |
77 | 80 | trigger_error("`".$k."` property n'existe pas", E_USER_NOTICE); |
78 | 81 | } |
@@ -64,8 +64,9 @@ |
||
64 | 64 | |
65 | 65 | protected function setParamCtrl($key, $value, $typeCtrl) { |
66 | 66 | if (is_array($typeCtrl)) { |
67 | - if (array_search($value, $typeCtrl)===false) |
|
68 | - throw new \Exception("La valeur passée a propriété `".$key."` pour le composant `".$this->uiName."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}"); |
|
67 | + if (array_search($value, $typeCtrl)===false) { |
|
68 | + throw new \Exception("La valeur passée a propriété `".$key."` pour le composant `".$this->uiName."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}"); |
|
69 | + } |
|
69 | 70 | } else { |
70 | 71 | if (!$typeCtrl($value)) { |
71 | 72 | throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." au composant ".$this->uiName); |
@@ -41,8 +41,9 @@ discard block |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | public function setPopupAttributes($variation=NULL,$popupEvent=NULL){ |
44 | - if(isset($this->_popup)) |
|
45 | - $this->_popup->setAttributes($variation,$popupEvent); |
|
44 | + if(isset($this->_popup)) { |
|
45 | + $this->_popup->setAttributes($variation,$popupEvent); |
|
46 | + } |
|
46 | 47 | } |
47 | 48 | |
48 | 49 | public function addPopup($title="",$content="",$variation=NULL,$params=array()){ |
@@ -82,8 +83,9 @@ discard block |
||
82 | 83 | } |
83 | 84 | |
84 | 85 | public function compile(JsUtils $js=NULL, View $view=NULL){ |
85 | - if(isset($this->_popup)) |
|
86 | - $this->_popup->compile(); |
|
86 | + if(isset($this->_popup)) { |
|
87 | + $this->_popup->compile(); |
|
88 | + } |
|
87 | 89 | return parent::compile($js,$view); |
88 | 90 | } |
89 | 91 | public function run(JsUtils $js){ |
@@ -14,10 +14,12 @@ discard block |
||
14 | 14 | parent::__construct($identifier, "div"); |
15 | 15 | $this->setClass("item"); |
16 | 16 | $this->setContent($content); |
17 | - if($value!==NULL) |
|
18 | - $this->setData($value); |
|
19 | - if($image!==NULL) |
|
20 | - $this->asMiniAvatar($image); |
|
17 | + if($value!==NULL) { |
|
18 | + $this->setData($value); |
|
19 | + } |
|
20 | + if($image!==NULL) { |
|
21 | + $this->asMiniAvatar($image); |
|
22 | + } |
|
21 | 23 | } |
22 | 24 | |
23 | 25 | public function setDescription($description){ |
@@ -33,8 +35,9 @@ discard block |
||
33 | 35 | |
34 | 36 | public function asOption(){ |
35 | 37 | $this->tagName="option"; |
36 | - if($this->getProperty("data-value")!==null) |
|
37 | - $this->setProperty("value", $this->getProperty("data-value")); |
|
38 | + if($this->getProperty("data-value")!==null) { |
|
39 | + $this->setProperty("value", $this->getProperty("data-value")); |
|
40 | + } |
|
38 | 41 | } |
39 | 42 | |
40 | 43 | /** |
@@ -52,22 +55,25 @@ discard block |
||
52 | 55 | public function asSearchInput($placeholder=NULL,$icon=NULL){ |
53 | 56 | $this->setClass("ui icon search input"); |
54 | 57 | $input=new HtmlInput("search-".$this->identifier); |
55 | - if(isset($placeholder)) |
|
56 | - $input->setProperty("placeholder", $placeholder); |
|
58 | + if(isset($placeholder)) { |
|
59 | + $input->setProperty("placeholder", $placeholder); |
|
60 | + } |
|
57 | 61 | $this->content=$input; |
58 | - if(isset($icon)) |
|
59 | - $this->addIcon($icon); |
|
62 | + if(isset($icon)) { |
|
63 | + $this->addIcon($icon); |
|
64 | + } |
|
60 | 65 | return $this; |
61 | 66 | } |
62 | 67 | |
63 | 68 | public function setContent($content){ |
64 | 69 | if($content==="-"){ |
65 | 70 | $this->asDivider(); |
66 | - }elseif($content==="-search-"){ |
|
71 | + } elseif($content==="-search-"){ |
|
67 | 72 | $values=\explode(",",$content,-1); |
68 | 73 | $this->asSearchInput(JArray::getDefaultValue($values, 0, "Search..."),JArray::getDefaultValue($values, 1, "search")); |
69 | - }else |
|
70 | - parent::setContent($content); |
|
74 | + } else { |
|
75 | + parent::setContent($content); |
|
76 | + } |
|
71 | 77 | return $this; |
72 | 78 | } |
73 | 79 | |
@@ -79,8 +85,9 @@ discard block |
||
79 | 85 | public function asHeader($caption=NULL,$icon=NULL){ |
80 | 86 | $this->setClass("header"); |
81 | 87 | $this->content=$caption; |
82 | - if(isset($icon)) |
|
83 | - $this->addIcon($icon,true); |
|
88 | + if(isset($icon)) { |
|
89 | + $this->addIcon($icon,true); |
|
90 | + } |
|
84 | 91 | return $this; |
85 | 92 | } |
86 | 93 |
@@ -55,10 +55,11 @@ |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | public function setDismissable($dismiss=true){ |
58 | - if($dismiss===true) |
|
59 | - $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
60 | - else |
|
61 | - $this->close=NULL; |
|
58 | + if($dismiss===true) { |
|
59 | + $this->close=new HtmlIcon("close-".$this->identifier, "close"); |
|
60 | + } else { |
|
61 | + $this->close=NULL; |
|
62 | + } |
|
62 | 63 | return $this; |
63 | 64 | } |
64 | 65 |
@@ -9,8 +9,9 @@ |
||
9 | 9 | public function __construct($identifier,$width){ |
10 | 10 | parent::__construct($identifier,"div"); |
11 | 11 | $this->setClass("column"); |
12 | - if(isset($width)) |
|
13 | - $this->setWidth($width); |
|
12 | + if(isset($width)) { |
|
13 | + $this->setWidth($width); |
|
14 | + } |
|
14 | 15 | } |
15 | 16 | |
16 | 17 | public function setWidth($width){ |
@@ -14,10 +14,11 @@ |
||
14 | 14 | if(isset($numCols)){ |
15 | 15 | $numCols=min(16,$numCols); |
16 | 16 | $numCols=max(1,$numCols); |
17 | - if($colSizing) |
|
18 | - $width=(int)(16/$numCols); |
|
19 | - else |
|
20 | - $this->_colSize=16/$numCols; |
|
17 | + if($colSizing) { |
|
18 | + $width=(int)(16/$numCols); |
|
19 | + } else { |
|
20 | + $this->_colSize=16/$numCols; |
|
21 | + } |
|
21 | 22 | for ($i=0;$i<$numCols;$i++){ |
22 | 23 | $this->addItem($width); |
23 | 24 | } |
@@ -101,8 +101,9 @@ discard block |
||
101 | 101 | * @return \Ajax\semantic\html\collections\HtmlGrid |
102 | 102 | */ |
103 | 103 | public function setPadded($value=NULL){ |
104 | - if(isset($value)) |
|
105 | - $this->addToPropertyCtrl("class", $value,array("vertically","horizontally")); |
|
104 | + if(isset($value)) { |
|
105 | + $this->addToPropertyCtrl("class", $value,array("vertically","horizontally")); |
|
106 | + } |
|
106 | 107 | return $this->addToProperty("class", "padded"); |
107 | 108 | } |
108 | 109 | |
@@ -124,8 +125,9 @@ discard block |
||
124 | 125 | * @see \Ajax\common\html\HtmlCollection::createItem() |
125 | 126 | */ |
126 | 127 | protected function createItem($value){ |
127 | - if($this->_createCols===false) |
|
128 | - $value=null; |
|
128 | + if($this->_createCols===false) { |
|
129 | + $value=null; |
|
130 | + } |
|
129 | 131 | $item=new HtmlGridRow($this->identifier."-row-".($this->count()+1),$value,$this->_colSizing); |
130 | 132 | return $item; |
131 | 133 | } |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | foreach ($items as $k=>$v){ |
18 | 18 | $this->addItem([$k,$v]); |
19 | 19 | } |
20 | - }else{ |
|
20 | + } else{ |
|
21 | 21 | foreach ($items as $item){ |
22 | 22 | $this->addItem($item); |
23 | 23 | } |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | * @return \Ajax\common\html\HtmlDoubleElement |
54 | 54 | */ |
55 | 55 | public function getItem($index) { |
56 | - if (is_int($index)) |
|
57 | - return $this->content[$index]; |
|
58 | - else { |
|
56 | + if (is_int($index)) { |
|
57 | + return $this->content[$index]; |
|
58 | + } else { |
|
59 | 59 | $elm=$this->getElementById($index, $this->content); |
60 | 60 | return $elm; |
61 | 61 | } |