@@ -12,8 +12,9 @@ discard block |
||
| 12 | 12 | $image=new HtmlImg("img-", $src, $alt); |
| 13 | 13 | $image->setClass(""); |
| 14 | 14 | parent::__construct($identifier, "div", "ui image", $image); |
| 15 | - if (isset($size)) |
|
| 16 | - $this->setSize($size); |
|
| 15 | + if (isset($size)) { |
|
| 16 | + $this->setSize($size); |
|
| 17 | + } |
|
| 17 | 18 | } |
| 18 | 19 | |
| 19 | 20 | public function setCircular() { |
@@ -21,8 +22,9 @@ discard block |
||
| 21 | 22 | } |
| 22 | 23 | |
| 23 | 24 | public function asAvatar($caption=NULL) { |
| 24 | - if (isset($caption)) |
|
| 25 | - $this->wrap("", $caption); |
|
| 25 | + if (isset($caption)) { |
|
| 26 | + $this->wrap("", $caption); |
|
| 27 | + } |
|
| 26 | 28 | return $this->addToProperty("class", "avatar"); |
| 27 | 29 | } |
| 28 | 30 | |
@@ -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 |
@@ -55,9 +55,9 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | public function setFocusable($value=true) { |
| 58 | - if ($value === true) |
|
| 59 | - $this->setProperty("tabindex", "0"); |
|
| 60 | - else { |
|
| 58 | + if ($value === true) { |
|
| 59 | + $this->setProperty("tabindex", "0"); |
|
| 60 | + } else { |
|
| 61 | 61 | $this->removeProperty("tabindex"); |
| 62 | 62 | } |
| 63 | 63 | return $this; |
@@ -109,8 +109,9 @@ discard block |
||
| 109 | 109 | $this->content=new HtmlButton("button-" . $this->identifier, $this->content); |
| 110 | 110 | $this->content->setTagName("div"); |
| 111 | 111 | $label=new HtmlLabel("label-" . $this->identifier, $label, "a"); |
| 112 | - if(isset($icon)) |
|
| 113 | - $label->addIcon($icon); |
|
| 112 | + if(isset($icon)) { |
|
| 113 | + $label->addIcon($icon); |
|
| 114 | + } |
|
| 114 | 115 | $label->setBasic(); |
| 115 | 116 | $this->addContent($label, $before); |
| 116 | 117 | return $label; |
@@ -185,8 +186,9 @@ discard block |
||
| 185 | 186 | } |
| 186 | 187 | |
| 187 | 188 | public static function social($identifier, $social, $value=NULL) { |
| 188 | - if ($value === NULL) |
|
| 189 | - $value=\ucfirst($social); |
|
| 189 | + if ($value === NULL) { |
|
| 190 | + $value=\ucfirst($social); |
|
| 191 | + } |
|
| 190 | 192 | $return=new HtmlButton($identifier, $value); |
| 191 | 193 | $return->addIcon($social); |
| 192 | 194 | return $return->addToPropertyCtrl("class", $social, Social::getConstants()); |
@@ -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"); |
@@ -54,26 +54,29 @@ |
||
| 54 | 54 | for($i=0;$i<$count;$i++){ |
| 55 | 55 | $step=$this->content[$i]; |
| 56 | 56 | $step->removeStatus(); |
| 57 | - if($i<$activestep) |
|
| 58 | - $step->setCompleted(); |
|
| 59 | - elseif ($i===$activestep) |
|
| 60 | - $step->setActive(); |
|
| 61 | - else |
|
| 62 | - $step->setDisabled(); |
|
| 57 | + if($i<$activestep) { |
|
| 58 | + $step->setCompleted(); |
|
| 59 | + } elseif ($i===$activestep) { |
|
| 60 | + $step->setActive(); |
|
| 61 | + } else { |
|
| 62 | + $step->setDisabled(); |
|
| 63 | + } |
|
| 63 | 64 | } |
| 64 | - }else{ |
|
| 65 | + } else{ |
|
| 65 | 66 | foreach ($this->content as $step){ |
| 66 | 67 | $step->removeStatus(); |
| 67 | 68 | } |
| 68 | - if($activestep<$count) |
|
| 69 | - $this->content[$activestep]->setActive(); |
|
| 69 | + if($activestep<$count) { |
|
| 70 | + $this->content[$activestep]->setActive(); |
|
| 71 | + } |
|
| 70 | 72 | } |
| 71 | 73 | return $this; |
| 72 | 74 | } |
| 73 | 75 | |
| 74 | 76 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
| 75 | - if(isset($this->_activeStep)===true && \is_numeric($this->_activeStep)) |
|
| 76 | - $this->defineActiveStep(); |
|
| 77 | + if(isset($this->_activeStep)===true && \is_numeric($this->_activeStep)) { |
|
| 78 | + $this->defineActiveStep(); |
|
| 79 | + } |
|
| 77 | 80 | return parent::compile($js,$view); |
| 78 | 81 | } |
| 79 | 82 | |
@@ -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 | } |
@@ -15,8 +15,9 @@ discard block |
||
| 15 | 15 | public function __construct($identifier, $elements=array(), $asIcons=false) { |
| 16 | 16 | parent::__construct($identifier, "div", "ui buttons"); |
| 17 | 17 | $this->content=array (); |
| 18 | - if ($asIcons === true) |
|
| 19 | - $this->asIcons(); |
|
| 18 | + if ($asIcons === true) { |
|
| 19 | + $this->asIcons(); |
|
| 20 | + } |
|
| 20 | 21 | $this->addElements($elements, $asIcons); |
| 21 | 22 | } |
| 22 | 23 | |
@@ -26,8 +27,9 @@ discard block |
||
| 26 | 27 | if ($asIcon) { |
| 27 | 28 | $elementO=new HtmlButton("button-" . $this->identifier . "-" . \sizeof($this->content)); |
| 28 | 29 | $elementO->asIcon($element); |
| 29 | - } else |
|
| 30 | - $elementO=new HtmlButton("button-" . $this->identifier . "-" . \sizeof($this->content), $element); |
|
| 30 | + } else { |
|
| 31 | + $elementO=new HtmlButton("button-" . $this->identifier . "-" . \sizeof($this->content), $element); |
|
| 32 | + } |
|
| 31 | 33 | } |
| 32 | 34 | $this->addContent($elementO); |
| 33 | 35 | } |
@@ -75,9 +77,9 @@ discard block |
||
| 75 | 77 | * @return HtmlButton |
| 76 | 78 | */ |
| 77 | 79 | public function getElement($index) { |
| 78 | - if (is_int($index)) |
|
| 79 | - return $this->content[$index]; |
|
| 80 | - else { |
|
| 80 | + if (is_int($index)) { |
|
| 81 | + return $this->content[$index]; |
|
| 82 | + } else { |
|
| 81 | 83 | $elm=$this->getElementById($index, $this->content); |
| 82 | 84 | return $elm; |
| 83 | 85 | } |