@@ -12,6 +12,11 @@ discard block |
||
12 | 12 | |
13 | 13 | class HtmlButtontoolbar extends HtmlButtongroups { |
14 | 14 | |
15 | + /** |
|
16 | + * @param string $identifier |
|
17 | + * @param string $cssStyle |
|
18 | + * @param string $size |
|
19 | + */ |
|
15 | 20 | public function __construct($identifier, $elements=array(), $cssStyle=NULL, $size=NULL, $tagName="div") { |
16 | 21 | parent::__construct($identifier, $elements, $cssStyle, $size, $tagName); |
17 | 22 | $this->setClass("btn-toolbar"); |
@@ -57,7 +62,7 @@ discard block |
||
57 | 62 | |
58 | 63 | /** |
59 | 64 | * return the Buttongroups at position $index |
60 | - * @return \Ajax\bootstrap\html\HtmlButtongroups |
|
65 | + * @return HtmlButton |
|
61 | 66 | */ |
62 | 67 | public function getGroup($index) { |
63 | 68 | return parent::getElement($index); |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | */ |
47 | 47 | private function getLastButtonGroup() { |
48 | 48 | $nb=sizeof($this->elements); |
49 | - if ($nb>0) |
|
50 | - $bg=$this->elements [$nb-1]; |
|
51 | - else { |
|
49 | + if ($nb>0) { |
|
50 | + $bg=$this->elements [$nb-1]; |
|
51 | + } else { |
|
52 | 52 | $bg=new HtmlButtongroups($this->identifier."-buttongroups-".$nb); |
53 | 53 | $this->elements []=$bg; |
54 | 54 | } |
@@ -66,8 +66,9 @@ discard block |
||
66 | 66 | public function getLastGroup() { |
67 | 67 | $bg=null; |
68 | 68 | $nb=sizeof($this->elements); |
69 | - if ($nb>0) |
|
70 | - $bg=$this->elements [$nb-1]; |
|
69 | + if ($nb>0) { |
|
70 | + $bg=$this->elements [$nb-1]; |
|
71 | + } |
|
71 | 72 | return $bg; |
72 | 73 | } |
73 | 74 |
@@ -16,6 +16,10 @@ |
||
16 | 16 | class HtmlGridSystem extends HtmlBsDoubleElement { |
17 | 17 | private $rows; |
18 | 18 | |
19 | + /** |
|
20 | + * @param string $identifier |
|
21 | + * @param integer $numCols |
|
22 | + */ |
|
19 | 23 | public function __construct($identifier,$numRows=1,$numCols=NULL){ |
20 | 24 | parent::__construct($identifier,"div"); |
21 | 25 | $this->setProperty("class", "container-fluid"); |
@@ -43,7 +43,7 @@ |
||
43 | 43 | public function getRow($index,$force=true){ |
44 | 44 | if($index<sizeof($this->rows)){ |
45 | 45 | $result=$this->rows[$index-1]; |
46 | - }else if ($force){ |
|
46 | + } else if ($force){ |
|
47 | 47 | $this->setNumRows($index); |
48 | 48 | $result=$this->rows[$index-1]; |
49 | 49 | } |
@@ -15,6 +15,9 @@ |
||
15 | 15 | protected $_equalWidth; |
16 | 16 | protected $_name; |
17 | 17 | |
18 | + /** |
|
19 | + * @param string $identifier |
|
20 | + */ |
|
18 | 21 | public function __construct($identifier, $fields=array(), $equalWidth=true) { |
19 | 22 | parent::__construct($identifier, "div"); |
20 | 23 | $this->_equalWidth=$equalWidth; |
@@ -29,12 +29,14 @@ discard block |
||
29 | 29 | if (\is_string($end)) { |
30 | 30 | $label=$end; |
31 | 31 | \array_pop($fields); |
32 | - } else |
|
33 | - $label=NULL; |
|
32 | + } else { |
|
33 | + $label=NULL; |
|
34 | + } |
|
34 | 35 | } |
35 | 36 | } |
36 | - if (isset($label)) |
|
37 | - $this->setLabel($label); |
|
37 | + if (isset($label)) { |
|
38 | + $this->setLabel($label); |
|
39 | + } |
|
38 | 40 | foreach ( $fields as $field ) { |
39 | 41 | $this->addItem($field); |
40 | 42 | } |
@@ -57,8 +59,9 @@ discard block |
||
57 | 59 | |
58 | 60 | public function addItem($item) { |
59 | 61 | $item=parent::addItem($item); |
60 | - if($item instanceof HtmlFormField) |
|
61 | - $item->setContainer($this); |
|
62 | + if($item instanceof HtmlFormField) { |
|
63 | + $item->setContainer($this); |
|
64 | + } |
|
62 | 65 | return $item; |
63 | 66 | } |
64 | 67 | |
@@ -66,8 +69,9 @@ discard block |
||
66 | 69 | if ($this->_equalWidth) { |
67 | 70 | $count=$this->count(); |
68 | 71 | $this->addToProperty("class", Wide::getConstants()["W".$count]." fields"); |
69 | - } else |
|
70 | - $this->addToProperty("class", "fields"); |
|
72 | + } else { |
|
73 | + $this->addToProperty("class", "fields"); |
|
74 | + } |
|
71 | 75 | return parent::compile($js, $view); |
72 | 76 | } |
73 | 77 | |
@@ -108,8 +112,9 @@ discard block |
||
108 | 112 | $fields[]=$itemO; |
109 | 113 | } |
110 | 114 | $radios=new HtmlFormFields("fields-".$name, $fields); |
111 | - if (isset($label)) |
|
112 | - $radios->setLabel($label)->setProperty("for", $name); |
|
115 | + if (isset($label)) { |
|
116 | + $radios->setLabel($label)->setProperty("for", $name); |
|
117 | + } |
|
113 | 118 | return $radios; |
114 | 119 | } |
115 | 120 | |
@@ -125,8 +130,9 @@ discard block |
||
125 | 130 | $fields[]=$itemO; |
126 | 131 | } |
127 | 132 | $checkeds=new HtmlFormFields("fields-".$name, $fields); |
128 | - if (isset($label)) |
|
129 | - $checkeds->setLabel($label)->setProperty("for", $name); |
|
133 | + if (isset($label)) { |
|
134 | + $checkeds->setLabel($label)->setProperty("for", $name); |
|
135 | + } |
|
130 | 136 | return $checkeds; |
131 | 137 | } |
132 | 138 |
@@ -11,6 +11,9 @@ |
||
11 | 11 | |
12 | 12 | abstract class HtmlAbsractItem extends HtmlSemDoubleElement { |
13 | 13 | |
14 | + /** |
|
15 | + * @param string $baseClass |
|
16 | + */ |
|
14 | 17 | public function __construct($identifier, $baseClass,$content=NULL) { |
15 | 18 | parent::__construct($identifier, "div", $baseClass); |
16 | 19 | $this->content=array(); |
@@ -24,8 +24,9 @@ discard block |
||
24 | 24 | } |
25 | 25 | |
26 | 26 | public function removeIcon(){ |
27 | - if(isset($this->content["icon"])) |
|
28 | - unset($this->content["icon"]); |
|
27 | + if(isset($this->content["icon"])) { |
|
28 | + unset($this->content["icon"]); |
|
29 | + } |
|
29 | 30 | return $this; |
30 | 31 | } |
31 | 32 | |
@@ -63,7 +64,7 @@ discard block |
||
63 | 64 | $this->setTagName("div"); |
64 | 65 | $this->removeProperty("href"); |
65 | 66 | $this->addToPropertyCtrl("class", "active", array("active")); |
66 | - }else{ |
|
67 | + } else{ |
|
67 | 68 | $this->removePropertyValue("class", "active"); |
68 | 69 | } |
69 | 70 | return $this; |
@@ -71,8 +72,9 @@ discard block |
||
71 | 72 | |
72 | 73 | public function asLink($href=NULL,$part=NULL){ |
73 | 74 | $this->setTagName("a"); |
74 | - if(isset($href)) |
|
75 | - $this->setProperty("href", $href); |
|
75 | + if(isset($href)) { |
|
76 | + $this->setProperty("href", $href); |
|
77 | + } |
|
76 | 78 | return $this; |
77 | 79 | } |
78 | 80 | |
@@ -83,8 +85,9 @@ discard block |
||
83 | 85 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() |
84 | 86 | */ |
85 | 87 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
86 | - if(\is_array($this->content) && JArray::isAssociative($this->content)) |
|
87 | - $this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]); |
|
88 | + if(\is_array($this->content) && JArray::isAssociative($this->content)) { |
|
89 | + $this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]); |
|
90 | + } |
|
88 | 91 | return parent::compile($js, $view); |
89 | 92 | } |
90 | 93 | } |
@@ -13,6 +13,9 @@ |
||
13 | 13 | */ |
14 | 14 | class HtmlIconGroups extends HtmlSemCollection { |
15 | 15 | |
16 | + /** |
|
17 | + * @param string $identifier |
|
18 | + */ |
|
16 | 19 | public function __construct($identifier, $icons=array(), $size="") { |
17 | 20 | parent::__construct($identifier, "i", "icons"); |
18 | 21 | $this->addItems($icons); |
@@ -10,6 +10,9 @@ discard block |
||
10 | 10 | class HtmlList extends HtmlSemCollection { |
11 | 11 | protected $_hasCheckedList; |
12 | 12 | |
13 | + /** |
|
14 | + * @param string $identifier |
|
15 | + */ |
|
13 | 16 | public function __construct($identifier, $items=array()) { |
14 | 17 | parent::__construct($identifier, "div", "ui list"); |
15 | 18 | $this->addItems($items); |
@@ -22,6 +25,9 @@ discard block |
||
22 | 25 | return $item; |
23 | 26 | } |
24 | 27 | |
28 | + /** |
|
29 | + * @param integer $niveau |
|
30 | + */ |
|
25 | 31 | public function addHeader($niveau, $content) { |
26 | 32 | $header=new HtmlHeader("header-" . $this->identifier, $niveau, $content, "page"); |
27 | 33 | $this->wrap($header); |
@@ -10,6 +10,9 @@ discard block |
||
10 | 10 | |
11 | 11 | protected $params=array(); |
12 | 12 | |
13 | + /** |
|
14 | + * @param string $identifier |
|
15 | + */ |
|
13 | 16 | public function __construct( $identifier, $tagName="div", $baseClass="ui"){ |
14 | 17 | parent::__construct( $identifier, "div", "ui accordion"); |
15 | 18 | } |
@@ -29,6 +32,9 @@ discard block |
||
29 | 32 | return ($value instanceof HtmlAccordionItem)===false; |
30 | 33 | } |
31 | 34 | |
35 | + /** |
|
36 | + * @param string $title |
|
37 | + */ |
|
32 | 38 | public function addPanel($title,$content){ |
33 | 39 | return $this->addItem([$title,$content]); |
34 | 40 | } |
@@ -34,8 +34,9 @@ |
||
34 | 34 | * @see BaseHtml::run() |
35 | 35 | */ |
36 | 36 | public function run(JsUtils $js) { |
37 | - if(isset($this->_bsComponent)===false) |
|
38 | - $this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params); |
|
37 | + if(isset($this->_bsComponent)===false) { |
|
38 | + $this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params); |
|
39 | + } |
|
39 | 40 | $this->addEventsOnRun($js); |
40 | 41 | return $this->_bsComponent; |
41 | 42 | } |
@@ -74,8 +74,9 @@ |
||
74 | 74 | protected function setParamCtrl($key, $value, $typeCtrl) { |
75 | 75 | if (!$typeCtrl($value)) { |
76 | 76 | throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." à la position"); |
77 | - } else |
|
78 | - $this->setParam($key, $value); |
|
77 | + } else { |
|
78 | + $this->setParam($key, $value); |
|
79 | + } |
|
79 | 80 | } |
80 | 81 | |
81 | 82 | /* |
@@ -49,9 +49,9 @@ |
||
49 | 49 | * @return $this |
50 | 50 | */ |
51 | 51 | public function setAnimate($value) { |
52 | - if ($value instanceof Animation) |
|
53 | - $value=$value->getParams(); |
|
54 | - else if (is_string($value)) { |
|
52 | + if ($value instanceof Animation) { |
|
53 | + $value=$value->getParams(); |
|
54 | + } else if (is_string($value)) { |
|
55 | 55 | $animation=new Animation(); |
56 | 56 | $animation->setEasing($value); |
57 | 57 | } |