@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | $icon=@$content[0]; |
| 18 | 18 | $title=@$content[1]; |
| 19 | 19 | $desc=@$content[2]; |
| 20 | - }else{ |
|
| 20 | + } else{ |
|
| 21 | 21 | $icon=@$content["icon"]; |
| 22 | 22 | $image=@$content["image"]; |
| 23 | 23 | $title=@$content["title"]; |
@@ -33,13 +33,13 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | if(isset($title)===true){ |
| 35 | 35 | $this->setTitle($title,$desc); |
| 36 | - }elseif (isset($header)===true){ |
|
| 36 | + } elseif (isset($header)===true){ |
|
| 37 | 37 | $this->setTitle($header,$desc,"header"); |
| 38 | 38 | } |
| 39 | 39 | if(isset($items)===true){ |
| 40 | 40 | $this->addList($items); |
| 41 | 41 | } |
| 42 | - }else{ |
|
| 42 | + } else{ |
|
| 43 | 43 | $this->setContent($content); |
| 44 | 44 | } |
| 45 | 45 | } |
@@ -15,10 +15,12 @@ discard block |
||
| 15 | 15 | parent::__construct($identifier, "a"); |
| 16 | 16 | $this->setClass("item"); |
| 17 | 17 | $this->setContent($content); |
| 18 | - if($value!==NULL) |
|
| 19 | - $this->setData($value); |
|
| 20 | - if($image!==NULL) |
|
| 21 | - $this->asMiniAvatar($image); |
|
| 18 | + if($value!==NULL) { |
|
| 19 | + $this->setData($value); |
|
| 20 | + } |
|
| 21 | + if($image!==NULL) { |
|
| 22 | + $this->asMiniAvatar($image); |
|
| 23 | + } |
|
| 22 | 24 | } |
| 23 | 25 | |
| 24 | 26 | public function setDescription($description){ |
@@ -34,8 +36,9 @@ discard block |
||
| 34 | 36 | |
| 35 | 37 | public function asOption(){ |
| 36 | 38 | $this->tagName="option"; |
| 37 | - if($this->getProperty("data-value")!==null) |
|
| 38 | - $this->setProperty("value", $this->getProperty("data-value")); |
|
| 39 | + if($this->getProperty("data-value")!==null) { |
|
| 40 | + $this->setProperty("value", $this->getProperty("data-value")); |
|
| 41 | + } |
|
| 39 | 42 | } |
| 40 | 43 | |
| 41 | 44 | /** |
@@ -53,22 +56,25 @@ discard block |
||
| 53 | 56 | public function asSearchInput($placeholder=NULL,$icon=NULL){ |
| 54 | 57 | $this->setClass("ui icon search input"); |
| 55 | 58 | $input=new HtmlInput("search-".$this->identifier); |
| 56 | - if(isset($placeholder)) |
|
| 57 | - $input->setProperty("placeholder", $placeholder); |
|
| 59 | + if(isset($placeholder)) { |
|
| 60 | + $input->setProperty("placeholder", $placeholder); |
|
| 61 | + } |
|
| 58 | 62 | $this->content=$input; |
| 59 | - if(isset($icon)) |
|
| 60 | - $this->addIcon($icon); |
|
| 63 | + if(isset($icon)) { |
|
| 64 | + $this->addIcon($icon); |
|
| 65 | + } |
|
| 61 | 66 | return $this; |
| 62 | 67 | } |
| 63 | 68 | |
| 64 | 69 | public function setContent($content){ |
| 65 | 70 | if($content==="-"){ |
| 66 | 71 | $this->asDivider(); |
| 67 | - }elseif($content==="-search-"){ |
|
| 72 | + } elseif($content==="-search-"){ |
|
| 68 | 73 | $values=\explode(",",$content,-1); |
| 69 | 74 | $this->asSearchInput(JArray::getDefaultValue($values, 0, "Search..."),JArray::getDefaultValue($values, 1, "search")); |
| 70 | - }else |
|
| 71 | - parent::setContent($content); |
|
| 75 | + } else { |
|
| 76 | + parent::setContent($content); |
|
| 77 | + } |
|
| 72 | 78 | return $this; |
| 73 | 79 | } |
| 74 | 80 | |
@@ -80,8 +86,9 @@ discard block |
||
| 80 | 86 | public function asHeader($caption=NULL,$icon=NULL){ |
| 81 | 87 | $this->setClass("header"); |
| 82 | 88 | $this->content=$caption; |
| 83 | - if(isset($icon)) |
|
| 84 | - $this->addIcon($icon,true); |
|
| 89 | + if(isset($icon)) { |
|
| 90 | + $this->addIcon($icon,true); |
|
| 91 | + } |
|
| 85 | 92 | return $this; |
| 86 | 93 | } |
| 87 | 94 | |
@@ -34,8 +34,9 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | public function addImage($src="", $alt="", $size=NULL) { |
| 36 | 36 | $image=new HtmlImg("img-", $src, $alt); |
| 37 | - if (isset($size)) |
|
| 38 | - $image->setSize($size); |
|
| 37 | + if (isset($size)) { |
|
| 38 | + $image->setSize($size); |
|
| 39 | + } |
|
| 39 | 40 | $this->content["image"]=$image; |
| 40 | 41 | return $image; |
| 41 | 42 | } |
@@ -45,8 +46,9 @@ discard block |
||
| 45 | 46 | foreach ( $metas as $meta ) { |
| 46 | 47 | $this->addMeta($meta); |
| 47 | 48 | } |
| 48 | - } else |
|
| 49 | - $this->addMeta($metas); |
|
| 49 | + } else { |
|
| 50 | + $this->addMeta($metas); |
|
| 51 | + } |
|
| 50 | 52 | return $this; |
| 51 | 53 | } |
| 52 | 54 | |
@@ -73,8 +75,9 @@ discard block |
||
| 73 | 75 | $result=new HtmlSemDoubleElement("", "span", "", $caption); |
| 74 | 76 | $this->addContent($result); |
| 75 | 77 | $result->setFloated($direction); |
| 76 | - } else |
|
| 77 | - $result=$this->addContent($caption); |
|
| 78 | + } else { |
|
| 79 | + $result=$this->addContent($caption); |
|
| 80 | + } |
|
| 78 | 81 | return $result; |
| 79 | 82 | } |
| 80 | 83 | |
@@ -60,8 +60,9 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | public function asLink($href=NULL,$part=NULL){ |
| 62 | 62 | $this->setTagName("a"); |
| 63 | - if(isset($href)) |
|
| 64 | - $this->setProperty("href", $href); |
|
| 63 | + if(isset($href)) { |
|
| 64 | + $this->setProperty("href", $href); |
|
| 65 | + } |
|
| 65 | 66 | return $this; |
| 66 | 67 | } |
| 67 | 68 | |
@@ -72,8 +73,9 @@ discard block |
||
| 72 | 73 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() |
| 73 | 74 | */ |
| 74 | 75 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
| 75 | - if(\is_array($this->content)) |
|
| 76 | - $this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]); |
|
| 76 | + if(\is_array($this->content)) { |
|
| 77 | + $this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]); |
|
| 78 | + } |
|
| 77 | 79 | return parent::compile($js, $view); |
| 78 | 80 | } |
| 79 | 81 | } |
| 80 | 82 | \ No newline at end of file |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | $title=@$content[1]; |
| 18 | 18 | $desc=@$content[2]; |
| 19 | 19 | $status=@$content[3]; |
| 20 | - }else{ |
|
| 20 | + } else{ |
|
| 21 | 21 | $icon=@$content["icon"]; |
| 22 | 22 | $title=@$content["title"]; |
| 23 | 23 | $desc=@$content["description"]; |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | if(isset($title)===true){ |
| 33 | 33 | $this->setTitle($title,$desc); |
| 34 | 34 | } |
| 35 | - }else{ |
|
| 35 | + } else{ |
|
| 36 | 36 | $this->setContent($content); |
| 37 | 37 | } |
| 38 | 38 | } |
@@ -105,17 +105,20 @@ discard block |
||
| 105 | 105 | $max=\min($colIndex, $rows[$i]->count()); |
| 106 | 106 | for($j=0; $j < $max; $j++) { |
| 107 | 107 | $rowspan=$rows[$i]->getItem($j)->getRowspan(); |
| 108 | - if ($rowspan + $i > $this->_row) |
|
| 109 | - $pos++; |
|
| 108 | + if ($rowspan + $i > $this->_row) { |
|
| 109 | + $pos++; |
|
| 110 | + } |
|
| 110 | 111 | } |
| 111 | 112 | } |
| 112 | - if ($pos > $colIndex) |
|
| 113 | - return NULL; |
|
| 113 | + if ($pos > $colIndex) { |
|
| 114 | + return NULL; |
|
| 115 | + } |
|
| 114 | 116 | $count=$this->count(); |
| 115 | 117 | for($i=0; $i < $count; $i++) { |
| 116 | 118 | $pos+=$this->content[$i]->getColspan(); |
| 117 | - if ($pos >= $colIndex + 1) |
|
| 118 | - return $i; |
|
| 119 | + if ($pos >= $colIndex + 1) { |
|
| 120 | + return $i; |
|
| 121 | + } |
|
| 119 | 122 | } |
| 120 | 123 | return null; |
| 121 | 124 | } |
@@ -138,8 +141,9 @@ discard block |
||
| 138 | 141 | public function containsStr($needle) { |
| 139 | 142 | $cells=$this->content; |
| 140 | 143 | foreach ( $cells as $cell ) { |
| 141 | - if (\strpos($cell->getContent(), $needle) !== false) |
|
| 142 | - return true; |
|
| 144 | + if (\strpos($cell->getContent(), $needle) !== false) { |
|
| 145 | + return true; |
|
| 146 | + } |
|
| 143 | 147 | } |
| 144 | 148 | return false; |
| 145 | 149 | } |
@@ -22,8 +22,9 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | public function __construct($identifier, $tagName="tbody", $rowCount=NULL, $colCount=NULL) { |
| 24 | 24 | parent::__construct($identifier, $tagName, ""); |
| 25 | - if (isset($rowCount) && isset($colCount)) |
|
| 26 | - $this->setRowCount($rowCount, $colCount); |
|
| 25 | + if (isset($rowCount) && isset($colCount)) { |
|
| 26 | + $this->setRowCount($rowCount, $colCount); |
|
| 27 | + } |
|
| 27 | 28 | } |
| 28 | 29 | |
| 29 | 30 | /** |
@@ -129,8 +130,9 @@ discard block |
||
| 129 | 130 | $values=\array_fill(0, $count, $values); |
| 130 | 131 | $isArray=false; |
| 131 | 132 | } |
| 132 | - if (JArray::dimension($values) == 1 && $isArray) |
|
| 133 | - $values=[ $values ]; |
|
| 133 | + if (JArray::dimension($values) == 1 && $isArray) { |
|
| 134 | + $values=[ $values ]; |
|
| 135 | + } |
|
| 134 | 136 | |
| 135 | 137 | $count=\min(\sizeof($values), $count); |
| 136 | 138 | |
@@ -174,8 +176,9 @@ discard block |
||
| 174 | 176 | $count=$this->count(); |
| 175 | 177 | for($i=0; $i < $count; $i++) { |
| 176 | 178 | $index=$this->content[$i]->getColPosition($colIndex); |
| 177 | - if ($index !== NULL) |
|
| 178 | - $this->getCell($i, $index)->$function(); |
|
| 179 | + if ($index !== NULL) { |
|
| 180 | + $this->getCell($i, $index)->$function(); |
|
| 181 | + } |
|
| 179 | 182 | } |
| 180 | 183 | return $this; |
| 181 | 184 | } |
@@ -206,8 +209,9 @@ discard block |
||
| 206 | 209 | */ |
| 207 | 210 | public function getColCount() { |
| 208 | 211 | $result=0; |
| 209 | - if ($this->count() > 0) |
|
| 210 | - $result=$this->getItem(0)->getColCount(); |
|
| 212 | + if ($this->count() > 0) { |
|
| 213 | + $result=$this->getItem(0)->getColCount(); |
|
| 214 | + } |
|
| 211 | 215 | return $result; |
| 212 | 216 | } |
| 213 | 217 | |
@@ -66,15 +66,17 @@ |
||
| 66 | 66 | |
| 67 | 67 | public function getColspan() { |
| 68 | 68 | $colspan=1; |
| 69 | - if (\array_key_exists("colspan", $this->properties)) |
|
| 70 | - $colspan=$this->getProperty("colspan"); |
|
| 69 | + if (\array_key_exists("colspan", $this->properties)) { |
|
| 70 | + $colspan=$this->getProperty("colspan"); |
|
| 71 | + } |
|
| 71 | 72 | return $colspan; |
| 72 | 73 | } |
| 73 | 74 | |
| 74 | 75 | public function getRowspan() { |
| 75 | 76 | $rowspan=1; |
| 76 | - if (\array_key_exists("rowspan", $this->properties)) |
|
| 77 | - $rowspan=$this->getProperty("rowspan"); |
|
| 77 | + if (\array_key_exists("rowspan", $this->properties)) { |
|
| 78 | + $rowspan=$this->getProperty("rowspan"); |
|
| 79 | + } |
|
| 78 | 80 | return $rowspan; |
| 79 | 81 | } |
| 80 | 82 | |
@@ -20,8 +20,9 @@ discard block |
||
| 20 | 20 | public function __construct($identifier, $width=NULL) { |
| 21 | 21 | parent::__construct($identifier, "div"); |
| 22 | 22 | $this->setClass("column"); |
| 23 | - if (isset($width)) |
|
| 24 | - $this->setWidth($width); |
|
| 23 | + if (isset($width)) { |
|
| 24 | + $this->setWidth($width); |
|
| 25 | + } |
|
| 25 | 26 | } |
| 26 | 27 | |
| 27 | 28 | /** |
@@ -48,10 +49,11 @@ discard block |
||
| 48 | 49 | |
| 49 | 50 | public function addDivider($vertical=true, $content=NULL) { |
| 50 | 51 | $divider=new HtmlDivider("", $content); |
| 51 | - if ($vertical) |
|
| 52 | - $divider->setVertical(); |
|
| 53 | - else |
|
| 54 | - $divider->setHorizontal(); |
|
| 52 | + if ($vertical) { |
|
| 53 | + $divider->setVertical(); |
|
| 54 | + } else { |
|
| 55 | + $divider->setHorizontal(); |
|
| 56 | + } |
|
| 55 | 57 | $this->wrap("", $divider); |
| 56 | 58 | return $divider; |
| 57 | 59 | } |