@@ -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 | |
@@ -87,6 +87,9 @@ |
||
| 87 | 87 | return $result; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | + /** |
|
| 91 | + * @return string |
|
| 92 | + */ |
|
| 90 | 93 | private function getPrefix($element) { |
| 91 | 94 | $result="input_text"; |
| 92 | 95 | foreach ( $this->formElementsPrefix as $k => $v ) { |
@@ -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"); |
@@ -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 | } |
@@ -20,6 +20,9 @@ |
||
| 20 | 20 | protected $_tabsType="tabs"; |
| 21 | 21 | protected $stacked=""; |
| 22 | 22 | |
| 23 | + /** |
|
| 24 | + * @param string $identifier |
|
| 25 | + */ |
|
| 23 | 26 | public function __construct($identifier, $tagName="ul") { |
| 24 | 27 | parent::__construct($identifier, $tagName); |
| 25 | 28 | $this->_template="<%tagName% %properties%>%tabs%</%tagName%>%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) |
@@ -84,6 +84,9 @@ discard block |
||
| 84 | 84 | return $this; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | + /** |
|
| 88 | + * @param integer $index |
|
| 89 | + */ |
|
| 87 | 90 | public function removeItem($index){ |
| 88 | 91 | return array_splice($this->content, $index, 1); |
| 89 | 92 | } |
@@ -99,6 +102,9 @@ discard block |
||
| 99 | 102 | return $this->addItem($function($object)); |
| 100 | 103 | } |
| 101 | 104 | |
| 105 | + /** |
|
| 106 | + * @param \Closure $callBack |
|
| 107 | + */ |
|
| 102 | 108 | public function apply($callBack){ |
| 103 | 109 | foreach ($this->content as $item){ |
| 104 | 110 | $callBack($item); |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | foreach ($items as $k=>$v){ |
| 23 | 23 | $this->addItem([$k,$v]); |
| 24 | 24 | } |
| 25 | - }else{ |
|
| 25 | + } else{ |
|
| 26 | 26 | foreach ($items as $item){ |
| 27 | 27 | $this->addItem($item); |
| 28 | 28 | } |
@@ -70,9 +70,9 @@ discard block |
||
| 70 | 70 | * @return \Ajax\common\html\HtmlDoubleElement |
| 71 | 71 | */ |
| 72 | 72 | public function getItem($index) { |
| 73 | - if (is_int($index)) |
|
| 74 | - return $this->content[$index]; |
|
| 75 | - else { |
|
| 73 | + if (is_int($index)) { |
|
| 74 | + return $this->content[$index]; |
|
| 75 | + } else { |
|
| 76 | 76 | $elm=$this->getElementById($index, $this->content); |
| 77 | 77 | return $elm; |
| 78 | 78 | } |
@@ -134,10 +134,11 @@ discard block |
||
| 134 | 134 | $i=0; |
| 135 | 135 | foreach ($properties as $k=>$v){ |
| 136 | 136 | $c=$this->content[$i++]; |
| 137 | - if(isset($c)) |
|
| 138 | - $c->setProperty($k,$v); |
|
| 139 | - else |
|
| 140 | - return $this; |
|
| 137 | + if(isset($c)) { |
|
| 138 | + $c->setProperty($k,$v); |
|
| 139 | + } else { |
|
| 140 | + return $this; |
|
| 141 | + } |
|
| 141 | 142 | } |
| 142 | 143 | return $this; |
| 143 | 144 | } |
@@ -151,8 +152,7 @@ discard block |
||
| 151 | 152 | $c=$this->content[$i++]; |
| 152 | 153 | if(isset($c)){ |
| 153 | 154 | $c->setProperty($property,$value); |
| 154 | - } |
|
| 155 | - else{ |
|
| 155 | + } else{ |
|
| 156 | 156 | return $this; |
| 157 | 157 | } |
| 158 | 158 | } |
@@ -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 | |
@@ -124,8 +129,9 @@ discard block |
||
| 124 | 129 | $fields[]=$itemO; |
| 125 | 130 | } |
| 126 | 131 | $radios=new HtmlFormFields("fields-".$name, $fields); |
| 127 | - if (isset($label)) |
|
| 128 | - $radios->setLabel($label)->setProperty("for", $name); |
|
| 132 | + if (isset($label)) { |
|
| 133 | + $radios->setLabel($label)->setProperty("for", $name); |
|
| 134 | + } |
|
| 129 | 135 | return $radios; |
| 130 | 136 | } |
| 131 | 137 | |
@@ -22,6 +22,9 @@ discard block |
||
| 22 | 22 | private $_colSizing=true; |
| 23 | 23 | private $_implicitRows=false; |
| 24 | 24 | |
| 25 | + /** |
|
| 26 | + * @param string $identifier |
|
| 27 | + */ |
|
| 25 | 28 | public function __construct($identifier, $numRows=1, $numCols=NULL, $createCols=true, $implicitRows=false) { |
| 26 | 29 | parent::__construct($identifier, "div", "ui grid"); |
| 27 | 30 | $this->_implicitRows=$implicitRows; |
@@ -158,7 +161,7 @@ discard block |
||
| 158 | 161 | /** |
| 159 | 162 | * return the row at $index |
| 160 | 163 | * @param int $index |
| 161 | - * @return \Ajax\semantic\html\collections\HtmlGridRow |
|
| 164 | + * @return \Ajax\common\html\HtmlDoubleElement |
|
| 162 | 165 | */ |
| 163 | 166 | public function getRow($index) { |
| 164 | 167 | return $this->getItem($index); |
@@ -297,7 +300,7 @@ discard block |
||
| 297 | 300 | |
| 298 | 301 | /** |
| 299 | 302 | * stretch the row contents to take up the entire column height |
| 300 | - * @return \Ajax\semantic\html\content\HtmlGridRow |
|
| 303 | + * @return HtmlGrid |
|
| 301 | 304 | */ |
| 302 | 305 | public function setStretched() { |
| 303 | 306 | return $this->addToProperty("class", "stretched"); |
@@ -32,8 +32,9 @@ discard block |
||
| 32 | 32 | // } |
| 33 | 33 | $this->setWide($numCols); |
| 34 | 34 | } |
| 35 | - if($createCols) |
|
| 36 | - $this->setRowsCount($numRows, $numCols); |
|
| 35 | + if($createCols) { |
|
| 36 | + $this->setRowsCount($numRows, $numCols); |
|
| 37 | + } |
|
| 37 | 38 | } |
| 38 | 39 | |
| 39 | 40 | public function asSegment() { |
@@ -85,8 +86,9 @@ discard block |
||
| 85 | 86 | public function addCol($width=NULL) { |
| 86 | 87 | $colCount=$this->colCount() + 1; |
| 87 | 88 | $this->setColsCount($colCount, true, $width); |
| 88 | - if ($this->hasOnlyCols($this->count())) |
|
| 89 | - return $this->content[$colCount - 1]; |
|
| 89 | + if ($this->hasOnlyCols($this->count())) { |
|
| 90 | + return $this->content[$colCount - 1]; |
|
| 91 | + } |
|
| 90 | 92 | return $this; |
| 91 | 93 | } |
| 92 | 94 | |
@@ -174,8 +176,9 @@ discard block |
||
| 174 | 176 | */ |
| 175 | 177 | public function rowCount() { |
| 176 | 178 | $count=$this->count(); |
| 177 | - if ($this->hasOnlyCols($count)) |
|
| 178 | - return 0; |
|
| 179 | + if ($this->hasOnlyCols($count)) { |
|
| 180 | + return 0; |
|
| 181 | + } |
|
| 179 | 182 | return $count; |
| 180 | 183 | } |
| 181 | 184 | |
@@ -185,10 +188,12 @@ discard block |
||
| 185 | 188 | */ |
| 186 | 189 | public function colCount() { |
| 187 | 190 | $count=$this->count(); |
| 188 | - if ($this->hasOnlyCols($count)) |
|
| 189 | - return $count; |
|
| 190 | - if ($count > 0) |
|
| 191 | - return $this->getItem(0)->count(); |
|
| 191 | + if ($this->hasOnlyCols($count)) { |
|
| 192 | + return $count; |
|
| 193 | + } |
|
| 194 | + if ($count > 0) { |
|
| 195 | + return $this->getItem(0)->count(); |
|
| 196 | + } |
|
| 192 | 197 | return 0; |
| 193 | 198 | } |
| 194 | 199 | |
@@ -199,8 +204,9 @@ discard block |
||
| 199 | 204 | * @return \Ajax\semantic\html\collections\HtmlGridCol |
| 200 | 205 | */ |
| 201 | 206 | public function getCell($row, $col) { |
| 202 | - if ($row < 2 && $this->hasOnlyCols($this->count())) |
|
| 203 | - return $this->getItem($col); |
|
| 207 | + if ($row < 2 && $this->hasOnlyCols($this->count())) { |
|
| 208 | + return $this->getItem($col); |
|
| 209 | + } |
|
| 204 | 210 | $row=$this->getItem($row); |
| 205 | 211 | if (isset($row)) { |
| 206 | 212 | $col=$row->getItem($col); |
@@ -249,8 +255,9 @@ discard block |
||
| 249 | 255 | * @return \Ajax\semantic\html\collections\HtmlGrid |
| 250 | 256 | */ |
| 251 | 257 | public function setPadded($value=NULL) { |
| 252 | - if (isset($value)) |
|
| 253 | - $this->addToPropertyCtrl("class", $value, array ("vertically","horizontally" )); |
|
| 258 | + if (isset($value)) { |
|
| 259 | + $this->addToPropertyCtrl("class", $value, array ("vertically","horizontally" )); |
|
| 260 | + } |
|
| 254 | 261 | return $this->addToProperty("class", "padded"); |
| 255 | 262 | } |
| 256 | 263 | |
@@ -275,8 +282,9 @@ discard block |
||
| 275 | 282 | * @see \Ajax\common\html\HtmlCollection::createItem() |
| 276 | 283 | */ |
| 277 | 284 | protected function createItem($value) { |
| 278 | - if ($this->_createCols === false) |
|
| 279 | - $value=null; |
|
| 285 | + if ($this->_createCols === false) { |
|
| 286 | + $value=null; |
|
| 287 | + } |
|
| 280 | 288 | $item=new HtmlGridRow($this->identifier . "-row-" . ($this->count() + 1), $value, $this->_colSizing, $this->_implicitRows); |
| 281 | 289 | return $item; |
| 282 | 290 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | /** |
| 34 | 34 | * Sets the menu type |
| 35 | 35 | * @param string $type one of text,item |
| 36 | - * @return \Ajax\semantic\html\collections\HtmlMenu |
|
| 36 | + * @return HtmlMenu |
|
| 37 | 37 | */ |
| 38 | 38 | public function setType($type="") { |
| 39 | 39 | return $this->addToPropertyCtrl("class", $type, array ("","item","text" )); |
@@ -81,6 +81,7 @@ discard block |
||
| 81 | 81 | * {@inheritDoc} |
| 82 | 82 | * |
| 83 | 83 | * @see \Ajax\common\html\HtmlCollection::insertItem() |
| 84 | + * @param HtmlIcon $item |
|
| 84 | 85 | */ |
| 85 | 86 | public function insertItem($item, $position=0) { |
| 86 | 87 | $item=parent::insertItem($this->getItemToInsert($item), $position); |
@@ -58,9 +58,9 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | private function afterInsert($item) { |
| 61 | - if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false) |
|
| 62 | - $item->addToPropertyCtrl("class", "item", array ("item" )); |
|
| 63 | - else { |
|
| 61 | + if (!$item instanceof HtmlMenu && $item->propertyContains("class", "header")===false) { |
|
| 62 | + $item->addToPropertyCtrl("class", "item", array ("item" )); |
|
| 63 | + } else { |
|
| 64 | 64 | $this->setSecondary(); |
| 65 | 65 | } |
| 66 | 66 | return $item; |
@@ -75,8 +75,9 @@ discard block |
||
| 75 | 75 | public function addItem($item) { |
| 76 | 76 | $number=$item; |
| 77 | 77 | $item=parent::addItem($this->getItemToInsert($item)); |
| 78 | - if(\is_int($number)) |
|
| 79 | - $item->setProperty("data-page", $number); |
|
| 78 | + if(\is_int($number)) { |
|
| 79 | + $item->setProperty("data-page", $number); |
|
| 80 | + } |
|
| 80 | 81 | return $this->afterInsert($item); |
| 81 | 82 | } |
| 82 | 83 | |
@@ -149,10 +150,11 @@ discard block |
||
| 149 | 150 | } |
| 150 | 151 | |
| 151 | 152 | public function setSecondary($value=true) { |
| 152 | - if($value) |
|
| 153 | - $this->addToProperty("class", "secondary"); |
|
| 154 | - else |
|
| 155 | - $this->removePropertyValue("class", "secondary"); |
|
| 153 | + if($value) { |
|
| 154 | + $this->addToProperty("class", "secondary"); |
|
| 155 | + } else { |
|
| 156 | + $this->removePropertyValue("class", "secondary"); |
|
| 157 | + } |
|
| 156 | 158 | return $this; |
| 157 | 159 | } |
| 158 | 160 | |
@@ -172,8 +174,9 @@ discard block |
||
| 172 | 174 | $this->apply(function (HtmlDoubleElement &$item) { |
| 173 | 175 | $item->setTagName("a"); |
| 174 | 176 | }); |
| 175 | - if ($vertical === true) |
|
| 176 | - $this->setVertical(); |
|
| 177 | + if ($vertical === true) { |
|
| 178 | + $this->setVertical(); |
|
| 179 | + } |
|
| 177 | 180 | return $this->addToProperty("class", "tabular"); |
| 178 | 181 | } |
| 179 | 182 | |
@@ -202,10 +205,11 @@ discard block |
||
| 202 | 205 | */ |
| 203 | 206 | public function fromDatabaseObject($object, $function) { |
| 204 | 207 | $return=$function($object); |
| 205 | - if (\is_array($return)) |
|
| 206 | - $this->addItems($return); |
|
| 207 | - else |
|
| 208 | - $this->addItem($return); |
|
| 208 | + if (\is_array($return)) { |
|
| 209 | + $this->addItems($return); |
|
| 210 | + } else { |
|
| 211 | + $this->addItem($return); |
|
| 212 | + } |
|
| 209 | 213 | } |
| 210 | 214 | |
| 211 | 215 | /** |
@@ -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(); |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $this->setTagName("div"); |
| 58 | 58 | $this->removeProperty("href"); |
| 59 | 59 | $this->addToPropertyCtrl("class", "active", array("active")); |
| 60 | - }else{ |
|
| 60 | + } else{ |
|
| 61 | 61 | $this->removePropertyValue("class", "active"); |
| 62 | 62 | } |
| 63 | 63 | return $this; |
@@ -65,8 +65,9 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | public function asLink($href=NULL,$part=NULL){ |
| 67 | 67 | $this->setTagName("a"); |
| 68 | - if(isset($href)) |
|
| 69 | - $this->setProperty("href", $href); |
|
| 68 | + if(isset($href)) { |
|
| 69 | + $this->setProperty("href", $href); |
|
| 70 | + } |
|
| 70 | 71 | return $this; |
| 71 | 72 | } |
| 72 | 73 | |
@@ -77,8 +78,9 @@ discard block |
||
| 77 | 78 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() |
| 78 | 79 | */ |
| 79 | 80 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
| 80 | - if(\is_array($this->content) && JArray::isAssociative($this->content)) |
|
| 81 | - $this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]); |
|
| 81 | + if(\is_array($this->content) && JArray::isAssociative($this->content)) { |
|
| 82 | + $this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]); |
|
| 83 | + } |
|
| 82 | 84 | return parent::compile($js, $view); |
| 83 | 85 | } |
| 84 | 86 | } |
| 85 | 87 | \ No newline at end of file |