@@ -10,64 +10,64 @@ |
||
10 | 10 | |
11 | 11 | class HtmlReveal extends HtmlSemDoubleElement { |
12 | 12 | |
13 | - public function __construct($identifier, $visibleContent,$hiddenContent,$type=RevealType::FADE,$attributeType=NULL) { |
|
13 | + public function __construct($identifier, $visibleContent, $hiddenContent, $type=RevealType::FADE, $attributeType=NULL) { |
|
14 | 14 | parent::__construct($identifier, "div", "ui reveal"); |
15 | 15 | $this->setElement(0, $visibleContent); |
16 | 16 | $this->setElement(1, $hiddenContent); |
17 | - $this->setType($type,$attributeType); |
|
17 | + $this->setType($type, $attributeType); |
|
18 | 18 | } |
19 | 19 | |
20 | - private function setElement($index,$content){ |
|
21 | - if(!$content instanceof HtmlSingleElement){ |
|
22 | - $content=new HtmlLabel("",$content); |
|
20 | + private function setElement($index, $content) { |
|
21 | + if (!$content instanceof HtmlSingleElement) { |
|
22 | + $content=new HtmlLabel("", $content); |
|
23 | 23 | } |
24 | - if($content instanceof HtmlSemDoubleElement){ |
|
25 | - $content=new HtmlSemDoubleElement($this->identifier."-".$index,"div","",$content); |
|
26 | - }elseif ($content instanceof HtmlImg){ |
|
24 | + if ($content instanceof HtmlSemDoubleElement) { |
|
25 | + $content=new HtmlSemDoubleElement($this->identifier."-".$index, "div", "", $content); |
|
26 | + }elseif ($content instanceof HtmlImg) { |
|
27 | 27 | $this->addToPropertyCtrl("class", "image", array("image")); |
28 | 28 | } |
29 | - $content->addToProperty("class",(($index===0)?"visible":"hidden")." content"); |
|
29 | + $content->addToProperty("class", (($index===0) ? "visible" : "hidden")." content"); |
|
30 | 30 | $this->content[$index]=$content; |
31 | 31 | return $this; |
32 | 32 | } |
33 | 33 | |
34 | - public function setVisibleContent($visibleContent){ |
|
34 | + public function setVisibleContent($visibleContent) { |
|
35 | 35 | return $this->setElement(0, $visibleContent); |
36 | 36 | } |
37 | 37 | |
38 | - public function setHiddenContent($hiddenContent){ |
|
38 | + public function setHiddenContent($hiddenContent) { |
|
39 | 39 | return $this->setElement(1, $hiddenContent); |
40 | 40 | } |
41 | 41 | |
42 | - public function getVisibleContent(){ |
|
42 | + public function getVisibleContent() { |
|
43 | 43 | return $this->content[0]; |
44 | 44 | } |
45 | 45 | |
46 | - public function getHiddenContent(){ |
|
46 | + public function getHiddenContent() { |
|
47 | 47 | return $this->content[1]; |
48 | 48 | } |
49 | 49 | |
50 | - public function setType($type,$attribute=NULL){ |
|
50 | + public function setType($type, $attribute=NULL) { |
|
51 | 51 | $this->addToPropertyCtrl("class", $type, RevealType::getConstants()); |
52 | - if(isset($attribute)){ |
|
52 | + if (isset($attribute)) { |
|
53 | 53 | $this->addToPropertyCtrl("class", $attribute, Direction::getConstants()); |
54 | 54 | } |
55 | 55 | return $this; |
56 | 56 | } |
57 | 57 | |
58 | - public function setFade($attribute=NULL){ |
|
59 | - return $this->setType(RevealType::FADE,$attribute); |
|
58 | + public function setFade($attribute=NULL) { |
|
59 | + return $this->setType(RevealType::FADE, $attribute); |
|
60 | 60 | } |
61 | 61 | |
62 | - public function setMove($attribute=NULL){ |
|
63 | - return $this->setType(RevealType::MOVE,$attribute); |
|
62 | + public function setMove($attribute=NULL) { |
|
63 | + return $this->setType(RevealType::MOVE, $attribute); |
|
64 | 64 | } |
65 | 65 | |
66 | - public function setRotate($attribute=NULL){ |
|
67 | - return $this->setType(RevealType::ROTATE,$attribute); |
|
66 | + public function setRotate($attribute=NULL) { |
|
67 | + return $this->setType(RevealType::ROTATE, $attribute); |
|
68 | 68 | } |
69 | 69 | |
70 | - public function setCircular(){ |
|
70 | + public function setCircular() { |
|
71 | 71 | return $this->addToProperty("class", "circular"); |
72 | 72 | } |
73 | 73 |
@@ -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"); |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | use Ajax\common\html\HtmlDoubleElement; |
10 | 10 | use Ajax\semantic\html\base\constants\Side; |
11 | 11 | |
12 | -class HtmlStep extends HtmlSemCollection{ |
|
12 | +class HtmlStep extends HtmlSemCollection { |
|
13 | 13 | protected $_activeStep; |
14 | 14 | |
15 | - public function __construct( $identifier,$steps=array()){ |
|
16 | - parent::__construct( $identifier,"div", "ui steps"); |
|
15 | + public function __construct($identifier, $steps=array()) { |
|
16 | + parent::__construct($identifier, "div", "ui steps"); |
|
17 | 17 | $this->addItems($steps); |
18 | 18 | } |
19 | 19 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * @see \Ajax\common\html\html5\HtmlCollection::createItem() |
24 | 24 | */ |
25 | 25 | protected function createItem($value) { |
26 | - $itemO=new HtmlStepItem("item-".\sizeof($this->content),$value); |
|
26 | + $itemO=new HtmlStepItem("item-".\sizeof($this->content), $value); |
|
27 | 27 | return $itemO; |
28 | 28 | } |
29 | 29 | |
@@ -31,50 +31,50 @@ discard block |
||
31 | 31 | * @param string|array $step |
32 | 32 | * @return HtmlStepItem |
33 | 33 | */ |
34 | - public function addStep($step){ |
|
34 | + public function addStep($step) { |
|
35 | 35 | return $this->addItem($step); |
36 | 36 | } |
37 | 37 | |
38 | - public function setOrdered(){ |
|
38 | + public function setOrdered() { |
|
39 | 39 | return $this->addToProperty("class", "ordered"); |
40 | 40 | } |
41 | 41 | |
42 | - public function isOrdered(){ |
|
42 | + public function isOrdered() { |
|
43 | 43 | return $this->propertyContains("class", "ordered"); |
44 | 44 | } |
45 | 45 | |
46 | - public function setVertical(){ |
|
46 | + public function setVertical() { |
|
47 | 47 | return $this->addToProperty("class", "vertical"); |
48 | 48 | } |
49 | 49 | |
50 | - protected function defineActiveStep(){ |
|
50 | + protected function defineActiveStep() { |
|
51 | 51 | $activestep=$this->_activeStep; |
52 | 52 | $count=$this->count(); |
53 | - if($this->isOrdered()){ |
|
54 | - for($i=0;$i<$count;$i++){ |
|
53 | + if ($this->isOrdered()) { |
|
54 | + for ($i=0; $i<$count; $i++) { |
|
55 | 55 | $step=$this->content[$i]; |
56 | 56 | $step->removeStatus(); |
57 | - if($i<$activestep) |
|
57 | + if ($i<$activestep) |
|
58 | 58 | $step->setCompleted(); |
59 | 59 | elseif ($i===$activestep) |
60 | 60 | $step->setActive(); |
61 | 61 | else |
62 | 62 | $step->setDisabled(); |
63 | 63 | } |
64 | - }else{ |
|
65 | - foreach ($this->content as $step){ |
|
64 | + }else { |
|
65 | + foreach ($this->content as $step) { |
|
66 | 66 | $step->removeStatus(); |
67 | 67 | } |
68 | - if($activestep<$count) |
|
68 | + if ($activestep<$count) |
|
69 | 69 | $this->content[$activestep]->setActive(); |
70 | 70 | } |
71 | 71 | return $this; |
72 | 72 | } |
73 | 73 | |
74 | 74 | public function compile(JsUtils $js=NULL, View $view=NULL) { |
75 | - if(isset($this->_activeStep)===true && \is_numeric($this->_activeStep)) |
|
75 | + if (isset($this->_activeStep)===true && \is_numeric($this->_activeStep)) |
|
76 | 76 | $this->defineActiveStep(); |
77 | - return parent::compile($js,$view); |
|
77 | + return parent::compile($js, $view); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | public function setActiveStep($_activeStep) { |
@@ -82,15 +82,15 @@ discard block |
||
82 | 82 | return $this; |
83 | 83 | } |
84 | 84 | |
85 | - public function setAttached($side="",HtmlDoubleElement $toElement=NULL){ |
|
86 | - if(isset($toElement)){ |
|
87 | - $toElement->addToPropertyCtrl("class", "attached",array("attached")); |
|
85 | + public function setAttached($side="", HtmlDoubleElement $toElement=NULL) { |
|
86 | + if (isset($toElement)) { |
|
87 | + $toElement->addToPropertyCtrl("class", "attached", array("attached")); |
|
88 | 88 | } |
89 | - return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached")); |
|
89 | + return $this->addToPropertyCtrl("class", $side." attached", Side::getConstantValues("attached")); |
|
90 | 90 | } |
91 | 91 | |
92 | - public function asLink(){ |
|
93 | - foreach ($this->content as $step){ |
|
92 | + public function asLink() { |
|
93 | + foreach ($this->content as $step) { |
|
94 | 94 | $step->asLink(); |
95 | 95 | } |
96 | 96 | return $this; |
@@ -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 $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 |
@@ -7,24 +7,24 @@ |
||
7 | 7 | use Ajax\semantic\html\base\constants\Size; |
8 | 8 | |
9 | 9 | class HtmlImage extends HtmlSemDoubleElement { |
10 | - public function __construct($identifier, $src="", $alt="",$size=NULL) { |
|
11 | - $image=new HtmlImg("img-",$src,$alt); |
|
12 | - parent::__construct($identifier, "div","ui image",$image); |
|
13 | - if(isset($size)) |
|
10 | + public function __construct($identifier, $src="", $alt="", $size=NULL) { |
|
11 | + $image=new HtmlImg("img-", $src, $alt); |
|
12 | + parent::__construct($identifier, "div", "ui image", $image); |
|
13 | + if (isset($size)) |
|
14 | 14 | $this->setSize($size); |
15 | 15 | } |
16 | 16 | |
17 | - public function setCircular(){ |
|
17 | + public function setCircular() { |
|
18 | 18 | return $this->addToProperty("class", "circular"); |
19 | 19 | } |
20 | 20 | |
21 | - public function asAvatar($caption=NULL){ |
|
22 | - if(isset($caption)) |
|
23 | - $this->wrap("",$caption); |
|
21 | + public function asAvatar($caption=NULL) { |
|
22 | + if (isset($caption)) |
|
23 | + $this->wrap("", $caption); |
|
24 | 24 | return $this->addToProperty("class", "avatar"); |
25 | 25 | } |
26 | 26 | |
27 | - public static function small($identifier, $src="", $alt=""){ |
|
28 | - return new HtmlImage($identifier,$src,$alt,Size::SMALL); |
|
27 | + public static function small($identifier, $src="", $alt="") { |
|
28 | + return new HtmlImage($identifier, $src, $alt, Size::SMALL); |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 | \ No newline at end of file |
@@ -10,8 +10,9 @@ discard block |
||
10 | 10 | public function __construct($identifier, $src="", $alt="",$size=NULL) { |
11 | 11 | $image=new HtmlImg("img-",$src,$alt); |
12 | 12 | parent::__construct($identifier, "div","ui image",$image); |
13 | - if(isset($size)) |
|
14 | - $this->setSize($size); |
|
13 | + if(isset($size)) { |
|
14 | + $this->setSize($size); |
|
15 | + } |
|
15 | 16 | } |
16 | 17 | |
17 | 18 | public function setCircular(){ |
@@ -19,8 +20,9 @@ discard block |
||
19 | 20 | } |
20 | 21 | |
21 | 22 | public function asAvatar($caption=NULL){ |
22 | - if(isset($caption)) |
|
23 | - $this->wrap("",$caption); |
|
23 | + if(isset($caption)) { |
|
24 | + $this->wrap("",$caption); |
|
25 | + } |
|
24 | 26 | return $this->addToProperty("class", "avatar"); |
25 | 27 | } |
26 | 28 |
@@ -5,5 +5,5 @@ |
||
5 | 5 | use Ajax\common\BaseEnum; |
6 | 6 | |
7 | 7 | abstract class StepStatus extends BaseEnum { |
8 | - const ACTIVE="active",COMPLETED="completed",DISABLED="disabled",NONE=""; |
|
8 | + const ACTIVE="active", COMPLETED="completed", DISABLED="disabled", NONE=""; |
|
9 | 9 | } |
10 | 10 | \ No newline at end of file |
@@ -2,5 +2,5 @@ |
||
2 | 2 | namespace Ajax\semantic\html\base\constants; |
3 | 3 | use Ajax\common\BaseEnum; |
4 | 4 | abstract class Direction extends BaseEnum { |
5 | - const RIGHT="right", LEFT="left",DOWN="down",UP="up",NONE=""; |
|
5 | + const RIGHT="right", LEFT="left", DOWN="down", UP="up", NONE=""; |
|
6 | 6 | } |
7 | 7 | \ No newline at end of file |
@@ -5,5 +5,5 @@ |
||
5 | 5 | use Ajax\common\BaseEnum; |
6 | 6 | |
7 | 7 | abstract class RevealType extends BaseEnum { |
8 | - const FADE="fade",MOVE="move",ROTATE="rotate"; |
|
8 | + const FADE="fade", MOVE="move", ROTATE="rotate"; |
|
9 | 9 | } |
10 | 10 | \ No newline at end of file |
@@ -13,20 +13,20 @@ discard block |
||
13 | 13 | protected abstract function addToPropertyCtrl($name, $value, $typeCtrl); |
14 | 14 | public abstract function addToProperty($name, $value, $separator=" "); |
15 | 15 | |
16 | - public function addVariation($variation){ |
|
16 | + public function addVariation($variation) { |
|
17 | 17 | return $this->addToPropertyCtrl("class", $variation, $this->_variations); |
18 | 18 | } |
19 | 19 | |
20 | - public function addState($state){ |
|
20 | + public function addState($state) { |
|
21 | 21 | return $this->addToPropertyCtrl("class", $state, $this->_states); |
22 | 22 | } |
23 | 23 | |
24 | - public function setVariation($variation){ |
|
24 | + public function setVariation($variation) { |
|
25 | 25 | $this->setPropertyCtrl("class", $variation, $this->_variations); |
26 | 26 | return $this->addToProperty("class", $this->_baseClass); |
27 | 27 | } |
28 | 28 | |
29 | - public function setState($state){ |
|
29 | + public function setState($state) { |
|
30 | 30 | $this->setPropertyCtrl("class", $state, $this->_states); |
31 | 31 | return $this->addToProperty("class", $this->_baseClass); |
32 | 32 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * {@inheritDoc} |
36 | 36 | * @see \Ajax\common\html\HtmlSingleElement::setSize() |
37 | 37 | */ |
38 | - public function setSize($size){ |
|
38 | + public function setSize($size) { |
|
39 | 39 | return $this->addToPropertyCtrl("class", $size, Size::getConstants()); |
40 | 40 | } |
41 | 41 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * show it is currently unable to be interacted with |
44 | 44 | * @return \Ajax\semantic\html\elements\HtmlSemDoubleElement |
45 | 45 | */ |
46 | - public function setDisabled(){ |
|
46 | + public function setDisabled() { |
|
47 | 47 | return $this->addToProperty("class", "disabled"); |
48 | 48 | } |
49 | 49 | |
@@ -51,25 +51,25 @@ discard block |
||
51 | 51 | * @param string $color |
52 | 52 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
53 | 53 | */ |
54 | - public function setColor($color){ |
|
55 | - return $this->addToPropertyCtrl("class", $color,Color::getConstants()); |
|
54 | + public function setColor($color) { |
|
55 | + return $this->addToPropertyCtrl("class", $color, Color::getConstants()); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
59 | 59 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
60 | 60 | */ |
61 | - public function setFluid(){ |
|
61 | + public function setFluid() { |
|
62 | 62 | return $this->addToProperty("class", "fluid"); |
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
66 | 66 | * can be formatted to appear on dark backgrounds |
67 | 67 | */ |
68 | - public function setInverted(){ |
|
68 | + public function setInverted() { |
|
69 | 69 | return $this->addToProperty("class", "inverted"); |
70 | 70 | } |
71 | 71 | |
72 | - public function setCircular(){ |
|
72 | + public function setCircular() { |
|
73 | 73 | return $this->addToProperty("class", "circular"); |
74 | 74 | } |
75 | 75 | } |
76 | 76 | \ No newline at end of file |
@@ -13,20 +13,20 @@ discard block |
||
13 | 13 | protected $_input; |
14 | 14 | protected $_params=array(); |
15 | 15 | |
16 | - public function __construct($identifier, $name=NULL,$label=NULL,$value=NULL,$type=NULL) { |
|
17 | - $input=new HtmlFormInput($identifier,$label,"checkbox",$value); |
|
16 | + public function __construct($identifier, $name=NULL, $label=NULL, $value=NULL, $type=NULL) { |
|
17 | + $input=new HtmlFormInput($identifier, $label, "checkbox", $value); |
|
18 | 18 | parent::__construct("ck-field-".$identifier, $input); |
19 | - if(isset($label)){ |
|
19 | + if (isset($label)) { |
|
20 | 20 | $input->swapLabel(); |
21 | 21 | $label=$input->getLabel(); |
22 | 22 | $label->setClass="hidden"; |
23 | - $label->setProperty("tabindex",0); |
|
23 | + $label->setProperty("tabindex", 0); |
|
24 | 24 | } |
25 | 25 | $this->_input=$input; |
26 | - $input->getField()->addToProperty("class","hidden"); |
|
26 | + $input->getField()->addToProperty("class", "hidden"); |
|
27 | 27 | } |
28 | 28 | |
29 | - public function setType($checkboxType){ |
|
29 | + public function setType($checkboxType) { |
|
30 | 30 | return $this->_input->addToPropertyCtrl("class", $checkboxType, CheckboxType::getConstants()); |
31 | 31 | } |
32 | 32 | |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | return $this; |
40 | 40 | } |
41 | 41 | |
42 | - public function setReadonly(){ |
|
43 | - $this->_input->getField()->setProperty("disabled","disabled"); |
|
44 | - return $this->_input->addToProperty("class","read-only"); |
|
42 | + public function setReadonly() { |
|
43 | + $this->_input->getField()->setProperty("disabled", "disabled"); |
|
44 | + return $this->_input->addToProperty("class", "read-only"); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | * @param string $action action to execute : check, uncheck or NULL for toggle |
51 | 51 | * @return \Ajax\semantic\html\collections\form\AbstractHtmlFormRadioCheckbox |
52 | 52 | */ |
53 | - public function attachEvent($selector,$action=NULL){ |
|
54 | - if(isset($action)!==false || \is_numeric($action)===true){ |
|
53 | + public function attachEvent($selector, $action=NULL) { |
|
54 | + if (isset($action)!==false || \is_numeric($action)===true) { |
|
55 | 55 | $js='$("#%identifier%").checkbox("attach events", "'.$selector.'", "'.$action.'");'; |
56 | - }else{ |
|
56 | + }else { |
|
57 | 57 | $js='$("#%identifier%").checkbox("attach events", "'.$selector.'");'; |
58 | 58 | } |
59 | 59 | $js=\str_replace("%identifier%", $this->_input->getIdentifier(), $js); |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | * @param array $events associative array of events to attach ex : ["#bt-toggle","check"=>"#bt-check","uncheck"=>"#bt-uncheck"] |
66 | 66 | * @return \Ajax\semantic\html\collections\form\AbstractHtmlFormRadioCheckbox |
67 | 67 | */ |
68 | - public function attachEvents($events=array()){ |
|
69 | - if(\is_array($events)){ |
|
70 | - foreach ($events as $action=>$selector){ |
|
71 | - $this->attachEvent($selector,$action); |
|
68 | + public function attachEvents($events=array()) { |
|
69 | + if (\is_array($events)) { |
|
70 | + foreach ($events as $action=>$selector) { |
|
71 | + $this->attachEvent($selector, $action); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | return $this; |
@@ -36,7 +36,7 @@ |
||
36 | 36 | foreach ($icons as $icon=>$size){ |
37 | 37 | $group->addIcon($icon,$size); |
38 | 38 | } |
39 | - }else{ |
|
39 | + } else{ |
|
40 | 40 | foreach ($icons as $icon){ |
41 | 41 | $group->addIcon($icon); |
42 | 42 | } |
@@ -12,70 +12,70 @@ |
||
12 | 12 | public function __construct($identifier, $content) { |
13 | 13 | parent::__construct($identifier, "div", "step"); |
14 | 14 | $this->content=array(); |
15 | - if(\is_array($content)){ |
|
16 | - if(JArray::isAssociative($content)===false){ |
|
17 | - $icon=JArray::getValue($content, "icon",0); |
|
18 | - $title=JArray::getValue($content, "title",1); |
|
19 | - $desc=JArray::getValue($content, "description",2); |
|
20 | - $status=JArray::getValue($content, "status",3); |
|
21 | - }else{ |
|
15 | + if (\is_array($content)) { |
|
16 | + if (JArray::isAssociative($content)===false) { |
|
17 | + $icon=JArray::getValue($content, "icon", 0); |
|
18 | + $title=JArray::getValue($content, "title", 1); |
|
19 | + $desc=JArray::getValue($content, "description", 2); |
|
20 | + $status=JArray::getValue($content, "status", 3); |
|
21 | + }else { |
|
22 | 22 | $icon=@$content["icon"]; |
23 | 23 | $title=@$content["title"]; |
24 | 24 | $desc=@$content["description"]; |
25 | 25 | $status=@$content["status"]; |
26 | 26 | } |
27 | - if(isset($icon)===true){ |
|
27 | + if (isset($icon)===true) { |
|
28 | 28 | $this->setIcon($icon); |
29 | 29 | } |
30 | - if(isset($status)===true){ |
|
30 | + if (isset($status)===true) { |
|
31 | 31 | $this->setStatus($status); |
32 | 32 | } |
33 | - if(isset($title)===true){ |
|
34 | - $this->setTitle($title,$desc); |
|
33 | + if (isset($title)===true) { |
|
34 | + $this->setTitle($title, $desc); |
|
35 | 35 | } |
36 | - }else{ |
|
36 | + }else { |
|
37 | 37 | $this->setContent($content); |
38 | 38 | } |
39 | 39 | } |
40 | 40 | |
41 | - public function setIcon($icon){ |
|
41 | + public function setIcon($icon) { |
|
42 | 42 | $this->content["icon"]=new HtmlIcon("icon-".$this->identifier, $icon); |
43 | 43 | } |
44 | 44 | |
45 | - private function createContent(){ |
|
46 | - $this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier,"div","content"); |
|
45 | + private function createContent() { |
|
46 | + $this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content"); |
|
47 | 47 | return $this->content["content"]; |
48 | 48 | } |
49 | 49 | |
50 | - public function setTitle($title,$description=NULL){ |
|
51 | - $title=new HtmlSemDoubleElement("","div","title",$title); |
|
52 | - if(\array_key_exists("content", $this->content)===false){ |
|
50 | + public function setTitle($title, $description=NULL) { |
|
51 | + $title=new HtmlSemDoubleElement("", "div", "title", $title); |
|
52 | + if (\array_key_exists("content", $this->content)===false) { |
|
53 | 53 | $this->createContent(); |
54 | 54 | } |
55 | 55 | $this->content["content"]->addContent($title); |
56 | - if(isset($description)){ |
|
57 | - $description=new HtmlSemDoubleElement("","div","description",$description); |
|
56 | + if (isset($description)) { |
|
57 | + $description=new HtmlSemDoubleElement("", "div", "description", $description); |
|
58 | 58 | $this->content["content"]->addContent($description); |
59 | 59 | } |
60 | 60 | return $this; |
61 | 61 | } |
62 | 62 | |
63 | - public function setActive(){ |
|
63 | + public function setActive() { |
|
64 | 64 | return $this->setStatus(StepStatus::ACTIVE); |
65 | 65 | } |
66 | 66 | |
67 | - public function setCompleted(){ |
|
67 | + public function setCompleted() { |
|
68 | 68 | return $this->setStatus(StepStatus::COMPLETED); |
69 | 69 | } |
70 | 70 | |
71 | - public function setStatus($status){ |
|
71 | + public function setStatus($status) { |
|
72 | 72 | return $this->addToPropertyCtrl("class", $status, StepStatus::getConstants()); |
73 | 73 | } |
74 | 74 | |
75 | - public function asLink(){ |
|
75 | + public function asLink() { |
|
76 | 76 | return $this->setTagName("a"); |
77 | 77 | } |
78 | - public function removeStatus(){ |
|
78 | + public function removeStatus() { |
|
79 | 79 | $this->removePropertyValues("class", StepStatus::getConstants()); |
80 | 80 | } |
81 | 81 | } |
82 | 82 | \ No newline at end of file |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $title=JArray::getValue($content, "title",1); |
19 | 19 | $desc=JArray::getValue($content, "description",2); |
20 | 20 | $status=JArray::getValue($content, "status",3); |
21 | - }else{ |
|
21 | + } else{ |
|
22 | 22 | $icon=@$content["icon"]; |
23 | 23 | $title=@$content["title"]; |
24 | 24 | $desc=@$content["description"]; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | if(isset($title)===true){ |
34 | 34 | $this->setTitle($title,$desc); |
35 | 35 | } |
36 | - }else{ |
|
36 | + } else{ |
|
37 | 37 | $this->setContent($content); |
38 | 38 | } |
39 | 39 | } |