@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | protected $class="dropdown-toggle"; |
18 | 18 | protected $mClass="dropdown"; |
19 | 19 | protected $mTagName="div"; |
20 | - protected $items=array (); |
|
20 | + protected $items=array(); |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | * @return HtmlDropdownItem |
88 | 88 | */ |
89 | 89 | public function addItem($caption, $href="#") { |
90 | - if($caption instanceof HtmlDropdownItem){ |
|
90 | + if ($caption instanceof HtmlDropdownItem) { |
|
91 | 91 | $item=$caption; |
92 | - }else{ |
|
92 | + } else { |
|
93 | 93 | $iid=$this->getItemsCount()+1; |
94 | 94 | $item=new HtmlDropdownItem($this->identifier."-dropdown-item-".$iid); |
95 | 95 | $item->setCaption($caption)->setHref($href); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | public function addItems($items) { |
110 | 110 | $iid=$this->getItemsCount()+1; |
111 | 111 | if (is_array($items)) { |
112 | - foreach ( $items as $item ) { |
|
112 | + foreach ($items as $item) { |
|
113 | 113 | if (is_string($item)) { |
114 | 114 | $this->addItem($item); |
115 | 115 | } else if (is_array($item)) { |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | } |
137 | 137 | |
138 | 138 | public function setItems($items) { |
139 | - $this->items=array (); |
|
139 | + $this->items=array(); |
|
140 | 140 | $this->addItems($items); |
141 | 141 | } |
142 | 142 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | */ |
172 | 172 | public function run(JsUtils $js) { |
173 | 173 | if ($this->getProperty("role")==="nav") { |
174 | - foreach ( $this->items as $dropdownItem ) { |
|
174 | + foreach ($this->items as $dropdownItem) { |
|
175 | 175 | $dropdownItem->runNav($js); |
176 | 176 | } |
177 | 177 | } |
@@ -263,9 +263,9 @@ discard block |
||
263 | 263 | /* (non-PHPdoc) |
264 | 264 | * @see \Ajax\bootstrap\html\base\BaseHtml::on() |
265 | 265 | */ |
266 | - public function on($event, $jsCode, $stopPropagation = false, $preventDefault = false) { |
|
267 | - foreach ($this->items as $item){ |
|
268 | - $item->on($event, $jsCode,$stopPropagation,$preventDefault); |
|
266 | + public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) { |
|
267 | + foreach ($this->items as $item) { |
|
268 | + $item->on($event, $jsCode, $stopPropagation, $preventDefault); |
|
269 | 269 | } |
270 | 270 | } |
271 | 271 |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function __construct($identifier, $brand="Brand", $brandHref="#") { |
33 | 33 | parent::__construct($identifier); |
34 | 34 | $this->_template=include 'templates/tplNavbar.php'; |
35 | - $this->navZones=array (); |
|
35 | + $this->navZones=array(); |
|
36 | 36 | $this->class="navbar-default"; |
37 | 37 | $this->brand=$brand; |
38 | 38 | $this->brandHref=$brandHref; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | public function setBrandImage($imageSrc) { |
63 | - $this->brandImage=PhalconUtils::image(array ( |
|
63 | + $this->brandImage=PhalconUtils::image(array( |
|
64 | 64 | $imageSrc, |
65 | 65 | "alt" => $this->brand |
66 | 66 | )); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | public function setNavZones($navZones) { |
109 | 109 | if (is_array($navZones)) { |
110 | - foreach ( $navZones as $zoneType => $zoneArray ) { |
|
110 | + foreach ($navZones as $zoneType => $zoneArray) { |
|
111 | 111 | if (is_string($zoneType)) { |
112 | 112 | $zone=$this->addZone($zoneType); |
113 | 113 | $zone->fromArray($zoneArray); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | if ($index<$nb) |
148 | 148 | $zone=$this->navZones [$index]; |
149 | 149 | } else { |
150 | - for($i=0; $i<$nb; $i++) { |
|
150 | + for ($i=0; $i<$nb; $i++) { |
|
151 | 151 | if ($this->navZones [$i]->getIdentifier()===$index) { |
152 | 152 | $zone=$this->navZones [$i]; |
153 | 153 | break; |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | } |
159 | 159 | |
160 | 160 | public function run(JsUtils $js) { |
161 | - foreach ( $this->navZones as $zone ) { |
|
161 | + foreach ($this->navZones as $zone) { |
|
162 | 162 | $zone->run($js); |
163 | 163 | } |
164 | 164 | if ($this->hasScrollspy) { |
@@ -180,9 +180,9 @@ discard block |
||
180 | 180 | } |
181 | 181 | |
182 | 182 | public function setFluid($fluid) { |
183 | - if($fluid===true){ |
|
183 | + if ($fluid===true) { |
|
184 | 184 | $this->fluid="container-fluid"; |
185 | - }else{ |
|
185 | + } else { |
|
186 | 186 | $this->fluid="container"; |
187 | 187 | } |
188 | 188 | return $this; |
@@ -44,13 +44,13 @@ discard block |
||
44 | 44 | |
45 | 45 | public function addCloseButton() { |
46 | 46 | $button=new HtmlButton("close-".$this->identifier); |
47 | - $button->setProperties(array ( |
|
47 | + $button->setProperties(array( |
|
48 | 48 | "class" => "close", |
49 | 49 | "data-dismiss" => "alert", |
50 | 50 | "aria-label" => "close" |
51 | 51 | )); |
52 | 52 | $button->setValue('<span aria-hidden="true">×</span>'); |
53 | - $this->addToPropertyCtrl("class", "alert-dismissible", array ( |
|
53 | + $this->addToPropertyCtrl("class", "alert-dismissible", array( |
|
54 | 54 | "alert-dismissible" |
55 | 55 | )); |
56 | 56 | $this->button=$button; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * @see \Ajax\bootstrap\html\base\BaseHtml::compile() |
80 | 80 | */ |
81 | 81 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
82 | - if ($this->closeable&&$this->button==="") { |
|
82 | + if ($this->closeable && $this->button==="") { |
|
83 | 83 | $this->addCloseButton(); |
84 | 84 | } |
85 | 85 | return parent::compile($js, $view); |
@@ -79,15 +79,15 @@ |
||
79 | 79 | $element=null; |
80 | 80 | $i=0; |
81 | 81 | if (is_int($index)) { |
82 | - $elements=array (); |
|
83 | - foreach ( $this->elements as $group ) { |
|
82 | + $elements=array(); |
|
83 | + foreach ($this->elements as $group) { |
|
84 | 84 | $elements=array_merge($elements, $group->getElements()); |
85 | 85 | } |
86 | 86 | if ($index<sizeof($elements)) { |
87 | 87 | $element=$elements [$index]; |
88 | 88 | } |
89 | 89 | } else { |
90 | - while ( $element==null&&$i<sizeof($this->elements) ) { |
|
90 | + while ($element==null && $i<sizeof($this->elements)) { |
|
91 | 91 | $element=$this->elements [$i]->getElement($index); |
92 | 92 | $i++; |
93 | 93 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * @return HtmlButtongroups default : "" |
36 | 36 | */ |
37 | 37 | public function setSize($size) { |
38 | - foreach ( $this->elements as $element ) { |
|
38 | + foreach ($this->elements as $element) { |
|
39 | 39 | $element->setSize($size); |
40 | 40 | } |
41 | 41 | if (is_int($size)) { |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | public function setStyle($value) { |
48 | - foreach ( $this->elements as $element ) |
|
48 | + foreach ($this->elements as $element) |
|
49 | 49 | $element->setStyle($value); |
50 | 50 | } |
51 | 51 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | public function addElement($element) { |
66 | 66 | $result=$element; |
67 | 67 | $iid=sizeof($this->elements)+1; |
68 | - if (($element instanceof HtmlDropdown)||($element instanceof HtmlSplitbutton)) { |
|
68 | + if (($element instanceof HtmlDropdown) || ($element instanceof HtmlSplitbutton)) { |
|
69 | 69 | $this->addExistingDropDown($element); |
70 | 70 | $this->elements[]=$element; |
71 | 71 | } elseif ($element instanceof HtmlButton) { |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | } |
95 | 95 | |
96 | 96 | public function addElements($elements) { |
97 | - foreach ( $elements as $element ) { |
|
97 | + foreach ($elements as $element) { |
|
98 | 98 | $this->addElement($element); |
99 | 99 | } |
100 | 100 | return $this; |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | } else |
115 | 115 | $value="btn-group-".$value; |
116 | 116 | if (strstr($value, "justified")) { |
117 | - foreach ( $this->elements as $element ) { |
|
117 | + foreach ($this->elements as $element) { |
|
118 | 118 | $element->wrap('<div class="btn-group" role="group">', '</div>'); |
119 | 119 | } |
120 | 120 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | * @see \Ajax\bootstrap\html\base\BaseHtml::on() |
146 | 146 | */ |
147 | 147 | public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) { |
148 | - foreach ( $this->elements as $element ) { |
|
148 | + foreach ($this->elements as $element) { |
|
149 | 149 | $element->on($event, $jsCode, $stopPropagation, $preventDefault); |
150 | 150 | } |
151 | 151 | return $this; |
@@ -70,14 +70,14 @@ discard block |
||
70 | 70 | $span->setTagName("div"); |
71 | 71 | $buttons=array(); |
72 | 72 | $i=1; |
73 | - foreach ($items as $item){ |
|
73 | + foreach ($items as $item) { |
|
74 | 74 | $bt=NULL; |
75 | - if(is_string($item)){ |
|
76 | - $bt=new HtmlButton($this->identifier."-bt-".$i++,$item); |
|
77 | - }elseif ($item instanceof HtmlButton){ |
|
75 | + if (is_string($item)) { |
|
76 | + $bt=new HtmlButton($this->identifier."-bt-".$i++, $item); |
|
77 | + }elseif ($item instanceof HtmlButton) { |
|
78 | 78 | $bt=$item; |
79 | 79 | } |
80 | - if(isset($bt)){ |
|
80 | + if (isset($bt)) { |
|
81 | 81 | $buttons[]=$bt; |
82 | 82 | } |
83 | 83 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function setSize($size) { |
121 | 121 | if (is_int($size)) { |
122 | - return $this->addToMemberCtrl($this->mClass, CssRef::sizes("input-group")[$size],CssRef::sizes("input-group")); |
|
122 | + return $this->addToMemberCtrl($this->mClass, CssRef::sizes("input-group")[$size], CssRef::sizes("input-group")); |
|
123 | 123 | } |
124 | 124 | return $this->addToMemberCtrl($this->mClass, $size, CssRef::sizes("input-group")); |
125 | 125 | } |
@@ -42,7 +42,7 @@ |
||
42 | 42 | */ |
43 | 43 | public function run(JsUtils $js) { |
44 | 44 | if ($this->getProperty("role")==="nav") { |
45 | - foreach ( $this->items as $dropdownItem ) { |
|
45 | + foreach ($this->items as $dropdownItem) { |
|
46 | 46 | $dropdownItem->runNav($js); |
47 | 47 | } |
48 | 48 | } |
@@ -71,7 +71,7 @@ |
||
71 | 71 | $element=new HtmlBsDoubleElement("", "p"); |
72 | 72 | $element->setContent($content); |
73 | 73 | $element->setClass("list-group-item-text"); |
74 | - $this->element->setContent(array ( |
|
74 | + $this->element->setContent(array( |
|
75 | 75 | $elementHeader, |
76 | 76 | $element |
77 | 77 | )); |
@@ -62,15 +62,15 @@ |
||
62 | 62 | */ |
63 | 63 | public function setIdentifier($identifier) { |
64 | 64 | parent::setIdentifier($identifier); |
65 | - if($this->content instanceof HtmlLink){ |
|
65 | + if ($this->content instanceof HtmlLink) { |
|
66 | 66 | $this->content->setIdentifier("link-".$identifier); |
67 | 67 | } |
68 | 68 | } |
69 | - public function setActive($value=true){ |
|
70 | - $this->setProperty("class", ($value)?"active":""); |
|
69 | + public function setActive($value=true) { |
|
70 | + $this->setProperty("class", ($value) ? "active" : ""); |
|
71 | 71 | } |
72 | 72 | |
73 | - public function disable(){ |
|
73 | + public function disable() { |
|
74 | 74 | $this->setProperty("class", "disabled"); |
75 | 75 | } |
76 | 76 | } |
77 | 77 | \ No newline at end of file |