@@ -14,8 +14,9 @@ |
||
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | public function asAvatar($caption=NULL) { |
| 17 | - if (isset($caption)) |
|
| 18 | - $this->wrap("", $caption); |
|
| 17 | + if (isset($caption)) { |
|
| 18 | + $this->wrap("", $caption); |
|
| 19 | + } |
|
| 19 | 20 | return $this->addToProperty("class", "avatar"); |
| 20 | 21 | } |
| 21 | 22 | } |
| 22 | 23 | \ No newline at end of file |
@@ -14,8 +14,9 @@ discard block |
||
| 14 | 14 | public function __construct($identifier, $caption="", $icon=NULL, $tagName="div") { |
| 15 | 15 | parent::__construct($identifier, $tagName, "ui label"); |
| 16 | 16 | $this->content=$caption; |
| 17 | - if (isset($icon)===true) |
|
| 18 | - $this->addIcon($icon); |
|
| 17 | + if (isset($icon)===true) { |
|
| 18 | + $this->addIcon($icon); |
|
| 19 | + } |
|
| 19 | 20 | } |
| 20 | 21 | |
| 21 | 22 | /** |
@@ -24,10 +25,11 @@ discard block |
||
| 24 | 25 | * @return \Ajax\semantic\html\elements\HtmlLabel |
| 25 | 26 | */ |
| 26 | 27 | public function setPointing($value=Direction::NONE) { |
| 27 | - if($value==="left" || $value==="right") |
|
| 28 | - return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
|
| 29 | - else |
|
| 30 | - return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true)); |
|
| 28 | + if($value==="left" || $value==="right") { |
|
| 29 | + return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
|
| 30 | + } else { |
|
| 31 | + return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true)); |
|
| 32 | + } |
|
| 31 | 33 | } |
| 32 | 34 | |
| 33 | 35 | /** |
@@ -121,10 +123,11 @@ discard block |
||
| 121 | 123 | } |
| 122 | 124 | |
| 123 | 125 | public function setAttached($side=Side::TOP,$direction=Direction::NONE){ |
| 124 | - if($direction!==Direction::NONE) |
|
| 125 | - return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached")); |
|
| 126 | - else |
|
| 127 | - return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached")); |
|
| 126 | + if($direction!==Direction::NONE) { |
|
| 127 | + return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached")); |
|
| 128 | + } else { |
|
| 129 | + return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached")); |
|
| 130 | + } |
|
| 128 | 131 | } |
| 129 | 132 | |
| 130 | 133 | public static function ribbon($identifier, $caption) { |
@@ -102,8 +102,9 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function setBordered($inverted=false) { |
| 104 | 104 | $invertedStr=""; |
| 105 | - if ($inverted !== false) |
|
| 106 | - $invertedStr=" inverted"; |
|
| 105 | + if ($inverted !== false) { |
|
| 106 | + $invertedStr=" inverted"; |
|
| 107 | + } |
|
| 107 | 108 | return $this->addToProperty("class", "bordered" . $invertedStr); |
| 108 | 109 | } |
| 109 | 110 | |
@@ -116,12 +117,14 @@ discard block |
||
| 116 | 117 | } |
| 117 | 118 | |
| 118 | 119 | public function addLabel($label, $before=false, $icon=NULL) { |
| 119 | - if($before) |
|
| 120 | - $this->wrap($label); |
|
| 121 | - else |
|
| 122 | - $this->wrap("", $label); |
|
| 123 | - if(isset($icon)) |
|
| 124 | - $this->addToIcon($icon); |
|
| 120 | + if($before) { |
|
| 121 | + $this->wrap($label); |
|
| 122 | + } else { |
|
| 123 | + $this->wrap("", $label); |
|
| 124 | + } |
|
| 125 | + if(isset($icon)) { |
|
| 126 | + $this->addToIcon($icon); |
|
| 127 | + } |
|
| 125 | 128 | return $this; |
| 126 | 129 | } |
| 127 | 130 | |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | } |
| 24 | 24 | if($content instanceof HtmlSemDoubleElement){ |
| 25 | 25 | $content=new HtmlSemDoubleElement($this->identifier."-".$index,"div","",$content); |
| 26 | - }elseif ($content instanceof HtmlImg){ |
|
| 26 | + } elseif ($content instanceof HtmlImg){ |
|
| 27 | 27 | $this->addToPropertyCtrl("class", "image", array("image")); |
| 28 | 28 | } |
| 29 | 29 | $content->addToProperty("class",(($index===0)?"visible":"hidden")." content"); |
@@ -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 | } |
@@ -31,8 +31,9 @@ discard block |
||
| 31 | 31 | protected function createTitleElement(){ |
| 32 | 32 | $element=new HtmlSemDoubleElement("title-".$this->identifier,"div","title"); |
| 33 | 33 | $element->setContent(array(new HtmlIcon("", $this->_icon),$this->_title)); |
| 34 | - if($this->_active===true) |
|
| 35 | - $element->addToProperty("class", "active"); |
|
| 34 | + if($this->_active===true) { |
|
| 35 | + $element->addToProperty("class", "active"); |
|
| 36 | + } |
|
| 36 | 37 | return $element; |
| 37 | 38 | } |
| 38 | 39 | |
@@ -43,10 +44,11 @@ discard block |
||
| 43 | 44 | |
| 44 | 45 | public function setActive($value=true){ |
| 45 | 46 | $this->_active=$value; |
| 46 | - if($value===true) |
|
| 47 | - $this->addToPropertyCtrl("class", "active", array("active")); |
|
| 48 | - else |
|
| 49 | - $this->removePropertyValue("class", "active"); |
|
| 47 | + if($value===true) { |
|
| 48 | + $this->addToPropertyCtrl("class", "active", array("active")); |
|
| 49 | + } else { |
|
| 50 | + $this->removePropertyValue("class", "active"); |
|
| 51 | + } |
|
| 50 | 52 | return $this; |
| 51 | 53 | } |
| 52 | 54 | } |
| 53 | 55 | \ No newline at end of file |
@@ -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 | } |
@@ -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 | |
@@ -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 | } |