@@ -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) |
@@ -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) |
@@ -86,8 +86,9 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | public function addElement($element, HtmlNavzone $zone=NULL) { |
| 88 | 88 | $zone=$this->getZoneToInsertIn($zone); |
| 89 | - if ($element instanceof HtmlDropdown) |
|
| 90 | - $element->setMTagName("li"); |
|
| 89 | + if ($element instanceof HtmlDropdown) { |
|
| 90 | + $element->setMTagName("li"); |
|
| 91 | + } |
|
| 91 | 92 | $zone->addElement($element); |
| 92 | 93 | } |
| 93 | 94 | |
@@ -111,10 +112,11 @@ discard block |
||
| 111 | 112 | if (is_string($zoneType)) { |
| 112 | 113 | $zone=$this->addZone($zoneType); |
| 113 | 114 | $zone->fromArray($zoneArray); |
| 114 | - } else if (is_string($zoneArray)) |
|
| 115 | - $this->addElement($zoneArray); |
|
| 116 | - else |
|
| 117 | - $this->addElements($zoneArray); |
|
| 115 | + } else if (is_string($zoneArray)) { |
|
| 116 | + $this->addElement($zoneArray); |
|
| 117 | + } else { |
|
| 118 | + $this->addElements($zoneArray); |
|
| 119 | + } |
|
| 118 | 120 | } |
| 119 | 121 | } |
| 120 | 122 | } |
@@ -127,10 +129,11 @@ discard block |
||
| 127 | 129 | public function getZoneToInsertIn($zone=NULL) { |
| 128 | 130 | if (!isset($zone)) { |
| 129 | 131 | $nb=sizeof($this->navZones); |
| 130 | - if ($nb<1) |
|
| 131 | - $zone=$this->addZone(); |
|
| 132 | - else |
|
| 133 | - $zone=$this->navZones [$nb-1]; |
|
| 132 | + if ($nb<1) { |
|
| 133 | + $zone=$this->addZone(); |
|
| 134 | + } else { |
|
| 135 | + $zone=$this->navZones [$nb-1]; |
|
| 136 | + } |
|
| 134 | 137 | } |
| 135 | 138 | return $zone; |
| 136 | 139 | } |
@@ -144,8 +147,9 @@ discard block |
||
| 144 | 147 | $zone=null; |
| 145 | 148 | $nb=sizeof($this->navZones); |
| 146 | 149 | if (is_int($index)) { |
| 147 | - if ($index<$nb) |
|
| 148 | - $zone=$this->navZones [$index]; |
|
| 150 | + if ($index<$nb) { |
|
| 151 | + $zone=$this->navZones [$index]; |
|
| 152 | + } |
|
| 149 | 153 | } else { |
| 150 | 154 | for($i=0; $i<$nb; $i++) { |
| 151 | 155 | if ($this->navZones [$i]->getIdentifier()===$index) { |
@@ -182,7 +186,7 @@ discard block |
||
| 182 | 186 | public function setFluid($fluid) { |
| 183 | 187 | if($fluid===true){ |
| 184 | 188 | $this->fluid="container-fluid"; |
| 185 | - }else{ |
|
| 189 | + } else{ |
|
| 186 | 190 | $this->fluid="container"; |
| 187 | 191 | } |
| 188 | 192 | return $this; |
@@ -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 | |
@@ -23,8 +23,9 @@ |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public function getTabItem($index) { |
| 26 | - if ($index<sizeof($this->content)) |
|
| 27 | - return $this->content [$index]; |
|
| 26 | + if ($index<sizeof($this->content)) { |
|
| 27 | + return $this->content [$index]; |
|
| 28 | + } |
|
| 28 | 29 | } |
| 29 | 30 | |
| 30 | 31 | public function getTabItems() { |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | $result=null; |
| 44 | 44 | if($index<sizeof($this->cols)+1){ |
| 45 | 45 | $result=$this->cols[$index-1]; |
| 46 | - }else if ($force){ |
|
| 46 | + } else if ($force){ |
|
| 47 | 47 | $result=$this->addColAt(CssSize::SIZE_MD,1,$index); |
| 48 | 48 | } |
| 49 | 49 | return $result; |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $this->cols = array_values($this->cols); |
| 97 | 97 | $width=$width-$widthCol; |
| 98 | 98 | } |
| 99 | - }else{ |
|
| 99 | + } else{ |
|
| 100 | 100 | $width=0; |
| 101 | 101 | } |
| 102 | 102 | } |
@@ -24,14 +24,14 @@ |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | public static function getConstantValues($postFix="",$prefixBefore=false) { |
| 27 | - if ($postFix == "") |
|
| 28 | - return \array_values(self::getConstants()); |
|
| 29 | - else { |
|
| 27 | + if ($postFix == "") { |
|
| 28 | + return \array_values(self::getConstants()); |
|
| 29 | + } else { |
|
| 30 | 30 | if($prefixBefore===false){ |
| 31 | 31 | return \array_map(function ($elem) use($postFix) { |
| 32 | 32 | return $elem . " " . $postFix; |
| 33 | 33 | }, \array_values(self::getConstants())); |
| 34 | - }else{ |
|
| 34 | + } else{ |
|
| 35 | 35 | return \array_map(function ($elem) use($postFix) { |
| 36 | 36 | return $postFix." ".$elem; |
| 37 | 37 | }, \array_values(self::getConstants())); |