@@ -19,8 +19,9 @@ |
||
| 19 | 19 | if (isset($type)) { |
| 20 | 20 | if ($type == "page") { |
| 21 | 21 | $this->asPageHeader($niveau); |
| 22 | - } else |
|
| 23 | - $this->asContentHeader($niveau); |
|
| 22 | + } else { |
|
| 23 | + $this->asContentHeader($niveau); |
|
| 24 | + } |
|
| 24 | 25 | } |
| 25 | 26 | $this->content=$content; |
| 26 | 27 | } |
@@ -29,10 +29,11 @@ |
||
| 29 | 29 | if(isset($numCols)){ |
| 30 | 30 | $numCols=min(16,$numCols); |
| 31 | 31 | $numCols=max(1,$numCols); |
| 32 | - if($colSizing) |
|
| 33 | - $width=(int)(16/$numCols); |
|
| 34 | - else |
|
| 35 | - $this->_colSize=16/$numCols; |
|
| 32 | + if($colSizing) { |
|
| 33 | + $width=(int)(16/$numCols); |
|
| 34 | + } else { |
|
| 35 | + $this->_colSize=16/$numCols; |
|
| 36 | + } |
|
| 36 | 37 | for ($i=0;$i<$numCols;$i++){ |
| 37 | 38 | $this->addItem($width); |
| 38 | 39 | } |
@@ -33,11 +33,12 @@ discard block |
||
| 33 | 33 | foreach ($this->content as $pb){ |
| 34 | 34 | $pb->setActive($value); |
| 35 | 35 | } |
| 36 | - }else{ |
|
| 37 | - if ($value===true) |
|
| 38 | - $this->active="active"; |
|
| 39 | - else |
|
| 40 | - $this->active=""; |
|
| 36 | + } else{ |
|
| 37 | + if ($value===true) { |
|
| 38 | + $this->active="active"; |
|
| 39 | + } else { |
|
| 40 | + $this->active=""; |
|
| 41 | + } |
|
| 41 | 42 | } |
| 42 | 43 | return $this; |
| 43 | 44 | } |
@@ -47,11 +48,12 @@ discard block |
||
| 47 | 48 | foreach ($this->content as $pb){ |
| 48 | 49 | $pb->setStriped($value); |
| 49 | 50 | } |
| 50 | - }else{ |
|
| 51 | - if ($value===true) |
|
| 52 | - $this->striped="progress-bar-striped"; |
|
| 53 | - else |
|
| 54 | - $this->striped=""; |
|
| 51 | + } else{ |
|
| 52 | + if ($value===true) { |
|
| 53 | + $this->striped="progress-bar-striped"; |
|
| 54 | + } else { |
|
| 55 | + $this->striped=""; |
|
| 56 | + } |
|
| 55 | 57 | } |
| 56 | 58 | return $this; |
| 57 | 59 | } |
@@ -61,11 +63,12 @@ discard block |
||
| 61 | 63 | foreach ($this->content as $pb){ |
| 62 | 64 | $pb->showCaption($value); |
| 63 | 65 | } |
| 64 | - }else{ |
|
| 65 | - if ($value===true) |
|
| 66 | - $this->caption="%value%%"; |
|
| 67 | - else |
|
| 68 | - $this->caption='<span class="sr-only">%value%% Complete (%style%)</span>'; |
|
| 66 | + } else{ |
|
| 67 | + if ($value===true) { |
|
| 68 | + $this->caption="%value%%"; |
|
| 69 | + } else { |
|
| 70 | + $this->caption='<span class="sr-only">%value%% Complete (%style%)</span>'; |
|
| 71 | + } |
|
| 69 | 72 | } |
| 70 | 73 | return $this; |
| 71 | 74 | } |
@@ -137,8 +140,9 @@ discard block |
||
| 137 | 140 | if(isset($this->styleLimits)&& JArray::isAssociative($this->styleLimits)){ |
| 138 | 141 | foreach ($this->styleLimits as $k=>$v){ |
| 139 | 142 | $actualStyle=$k; |
| 140 | - if($v>$this->value) |
|
| 141 | - break; |
|
| 143 | + if($v>$this->value) { |
|
| 144 | + break; |
|
| 145 | + } |
|
| 142 | 146 | } |
| 143 | 147 | } |
| 144 | 148 | $this->style=$actualStyle; |
@@ -99,8 +99,9 @@ |
||
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | public function addGroup($identifier="") { |
| 102 | - if ($identifier==="") |
|
| 103 | - $identifier="form-".$this->identifier; |
|
| 102 | + if ($identifier==="") { |
|
| 103 | + $identifier="form-".$this->identifier; |
|
| 104 | + } |
|
| 104 | 105 | $group=new HtmlBsDoubleElement($identifier); |
| 105 | 106 | $group->setTagName("div"); |
| 106 | 107 | $group->setClass("form-group"); |
@@ -141,18 +141,20 @@ discard block |
||
| 141 | 141 | $this->_bsComponent=$js->bootstrap()->modal("#".$this->identifier, array ( |
| 142 | 142 | "show" => $this->showOnStartup |
| 143 | 143 | )); |
| 144 | - if ($this->draggable) |
|
| 145 | - $this->_bsComponent->setDraggable(true); |
|
| 144 | + if ($this->draggable) { |
|
| 145 | + $this->_bsComponent->setDraggable(true); |
|
| 146 | + } |
|
| 146 | 147 | $this->_bsComponent->setBackdrop($this->backdrop); |
| 147 | 148 | $this->addEventsOnRun($js); |
| 148 | 149 | return $this->_bsComponent; |
| 149 | 150 | } |
| 150 | 151 | |
| 151 | 152 | public function getButton($index) { |
| 152 | - if (is_int($index)) |
|
| 153 | - return $this->buttons [$index]; |
|
| 154 | - else |
|
| 155 | - return $this->getElementById($index, $this->buttons); |
|
| 153 | + if (is_int($index)) { |
|
| 154 | + return $this->buttons [$index]; |
|
| 155 | + } else { |
|
| 156 | + return $this->getElementById($index, $this->buttons); |
|
| 157 | + } |
|
| 156 | 158 | } |
| 157 | 159 | |
| 158 | 160 | public function showOnCreate() { |
@@ -178,8 +180,9 @@ discard block |
||
| 178 | 180 | |
| 179 | 181 | public function jsHideButton($index) { |
| 180 | 182 | $btn=$this->getButton($index); |
| 181 | - if ($btn) |
|
| 182 | - return "$('#".$btn->getIdentifier()."').hide();"; |
|
| 183 | + if ($btn) { |
|
| 184 | + return "$('#".$btn->getIdentifier()."').hide();"; |
|
| 185 | + } |
|
| 183 | 186 | } |
| 184 | 187 | |
| 185 | 188 | /** |
@@ -24,17 +24,19 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | public function attachTo($identifier) { |
| 26 | 26 | $this->element->setProperty("aria-controls", $identifier); |
| 27 | - if ($this->element->getTagName()==="a") |
|
| 28 | - $this->element->setProperty("href", "#".$identifier); |
|
| 29 | - else |
|
| 30 | - $this->element->setProperty("data-target", "#".$identifier); |
|
| 27 | + if ($this->element->getTagName()==="a") { |
|
| 28 | + $this->element->setProperty("href", "#".$identifier); |
|
| 29 | + } else { |
|
| 30 | + $this->element->setProperty("data-target", "#".$identifier); |
|
| 31 | + } |
|
| 31 | 32 | } |
| 32 | 33 | |
| 33 | 34 | public function getAttachedZone() { |
| 34 | 35 | $id=$this->element->getProperty("aria-controls"); |
| 35 | - if (!isset($id)) |
|
| 36 | - if ($this->element->getTagName()==="a") |
|
| 36 | + if (!isset($id)) { |
|
| 37 | + if ($this->element->getTagName()==="a") |
|
| 37 | 38 | $id=$this->element->getProperty("href"); |
| 39 | + } |
|
| 38 | 40 | if (!isset($id)||$id==="#") { |
| 39 | 41 | $id="collapse-".$this->element->getIdentifier(); |
| 40 | 42 | $this->attachTo($id); |
@@ -49,8 +51,9 @@ discard block |
||
| 49 | 51 | } |
| 50 | 52 | |
| 51 | 53 | public function createCollapsedZone($content="", $attachTo=NULL) { |
| 52 | - if (isset($attachTo)) |
|
| 53 | - $this->attachTo($attachTo); |
|
| 54 | + if (isset($attachTo)) { |
|
| 55 | + $this->attachTo($attachTo); |
|
| 56 | + } |
|
| 54 | 57 | $collapsedZone=new HtmlBsDoubleElement($this->getAttachedZone()); |
| 55 | 58 | $collapsedZone->setProperty("class", "collapse"); |
| 56 | 59 | $collapsedZone->setContent($content); |
@@ -35,8 +35,9 @@ discard block |
||
| 35 | 35 | $tab |
| 36 | 36 | ); |
| 37 | 37 | array_splice($this->tabs, $index, 0, $inserted); |
| 38 | - } else |
|
| 39 | - $this->tabs []=$tab; |
|
| 38 | + } else { |
|
| 39 | + $this->tabs []=$tab; |
|
| 40 | + } |
|
| 40 | 41 | } |
| 41 | 42 | |
| 42 | 43 | public function setActive($index){ |
@@ -116,9 +117,9 @@ discard block |
||
| 116 | 117 | public function createTabContents() { |
| 117 | 118 | $tabContent=new HtmlTabContent("tabcontent-".$this->identifier); |
| 118 | 119 | foreach ( $this->tabs as $tab ) { |
| 119 | - if ($tab instanceof HtmlTabItem) |
|
| 120 | - $tabContent->addTabItem($tab->getHref()); |
|
| 121 | - elseif ($tab instanceof HtmlDropdown) { |
|
| 120 | + if ($tab instanceof HtmlTabItem) { |
|
| 121 | + $tabContent->addTabItem($tab->getHref()); |
|
| 122 | + } elseif ($tab instanceof HtmlDropdown) { |
|
| 122 | 123 | foreach ( $tab->getItems() as $dropdownItem ) { |
| 123 | 124 | $tabContent->addTabItem($dropdownItem->getHref()); |
| 124 | 125 | } |
@@ -137,8 +138,9 @@ discard block |
||
| 137 | 138 | |
| 138 | 139 | public function setContentToTab($index, $text) { |
| 139 | 140 | $tabContentItem=$this->content->getTabItem($index); |
| 140 | - if (isset($tabContentItem)) |
|
| 141 | - $tabContentItem->setContent($text); |
|
| 141 | + if (isset($tabContentItem)) { |
|
| 142 | + $tabContentItem->setContent($text); |
|
| 143 | + } |
|
| 142 | 144 | } |
| 143 | 145 | |
| 144 | 146 | public function countTabs() { |
@@ -146,8 +148,9 @@ discard block |
||
| 146 | 148 | } |
| 147 | 149 | |
| 148 | 150 | public function getTabItem($index) { |
| 149 | - if ($index<sizeof($this->content->get)) |
|
| 150 | - return $this->content; |
|
| 151 | + if ($index<sizeof($this->content->get)) { |
|
| 152 | + return $this->content; |
|
| 153 | + } |
|
| 151 | 154 | } |
| 152 | 155 | |
| 153 | 156 | public function fadeEffect() { |
@@ -168,9 +171,11 @@ discard block |
||
| 168 | 171 | } |
| 169 | 172 | |
| 170 | 173 | public function setStacked($stacked=true){ |
| 171 | - if($stacked) |
|
| 172 | - $this->stacked="nav-stacked"; |
|
| 173 | - else $this->stacked=""; |
|
| 174 | + if($stacked) { |
|
| 175 | + $this->stacked="nav-stacked"; |
|
| 176 | + } else { |
|
| 177 | + $this->stacked=""; |
|
| 178 | + } |
|
| 174 | 179 | } |
| 175 | 180 | |
| 176 | 181 | /* (non-PHPdoc) |
@@ -52,10 +52,11 @@ discard block |
||
| 52 | 52 | $this->from=$from; |
| 53 | 53 | $this->to=$to; |
| 54 | 54 | $this->urlMask="%page%"; |
| 55 | - if(!isset($countVisible)) |
|
| 56 | - $this->countVisible=$to-$from+1; |
|
| 57 | - else |
|
| 58 | - $this->countVisible=$countVisible; |
|
| 55 | + if(!isset($countVisible)) { |
|
| 56 | + $this->countVisible=$to-$from+1; |
|
| 57 | + } else { |
|
| 58 | + $this->countVisible=$countVisible; |
|
| 59 | + } |
|
| 59 | 60 | $this->createContent(); |
| 60 | 61 | } |
| 61 | 62 | |
@@ -74,7 +75,7 @@ discard block |
||
| 74 | 75 | $href=new HtmlLink("a-".$this->identifier."-".$count,$url,$content); |
| 75 | 76 | $href->setProperty($this->attr, $url); |
| 76 | 77 | $elem->setContent($href); |
| 77 | - }else{ |
|
| 78 | + } else{ |
|
| 78 | 79 | $elem->setContent($content); |
| 79 | 80 | } |
| 80 | 81 | $this->content[]=$elem; |
@@ -107,8 +108,9 @@ discard block |
||
| 107 | 108 | public function _addEvent($event, $jsCode) { |
| 108 | 109 | foreach ($this->content as $li){ |
| 109 | 110 | $content=$li->getContent(); |
| 110 | - if($content instanceof BaseHtml) |
|
| 111 | - $content->_addEvent($event,$jsCode); |
|
| 111 | + if($content instanceof BaseHtml) { |
|
| 112 | + $content->_addEvent($event,$jsCode); |
|
| 113 | + } |
|
| 112 | 114 | } |
| 113 | 115 | } |
| 114 | 116 | /** |
@@ -146,8 +148,9 @@ discard block |
||
| 146 | 148 | if (is_int($size)) { |
| 147 | 149 | return $this->addToPropertyUnique("class", CssRef::sizes("pagination")[$size], CssRef::sizes("pagination")); |
| 148 | 150 | } |
| 149 | - if(!PhalconUtils::startsWith($size, "pagination-") && $size!=="") |
|
| 150 | - $size="pagination-".$size; |
|
| 151 | + if(!PhalconUtils::startsWith($size, "pagination-") && $size!=="") { |
|
| 152 | + $size="pagination-".$size; |
|
| 153 | + } |
|
| 151 | 154 | return $this->addToPropertyCtrl("class", $size, CssRef::sizes("pagination")); |
| 152 | 155 | } |
| 153 | 156 | |
@@ -48,14 +48,16 @@ |
||
| 48 | 48 | foreach ( $items as $item ) { |
| 49 | 49 | if (is_string($item)) { |
| 50 | 50 | $this->addItem($item); |
| 51 | - } else |
|
| 52 | - $this->content []=$item; |
|
| 51 | + } else { |
|
| 52 | + $this->content []=$item; |
|
| 53 | + } |
|
| 53 | 54 | } |
| 54 | 55 | } |
| 55 | 56 | |
| 56 | 57 | public function getItem($index) { |
| 57 | - if ($index<sizeof($this->content)) |
|
| 58 | - return $this->content [$index]; |
|
| 58 | + if ($index<sizeof($this->content)) { |
|
| 59 | + return $this->content [$index]; |
|
| 60 | + } |
|
| 59 | 61 | } |
| 60 | 62 | |
| 61 | 63 | /* (non-PHPdoc) |