@@ -12,11 +12,13 @@ discard block |
||
12 | 12 | |
13 | 13 | public function __construct($identifier, $value=NULL, $label=NULL, $attributes=array()) { |
14 | 14 | parent::__construct($identifier, "div", "ui progress"); |
15 | - if (isset($value)) |
|
16 | - $this->setProperty("data-percent", $value); |
|
15 | + if (isset($value)) { |
|
16 | + $this->setProperty("data-percent", $value); |
|
17 | + } |
|
17 | 18 | $this->createBar(); |
18 | - if (isset($label)) |
|
19 | - $this->setLabel($label); |
|
19 | + if (isset($label)) { |
|
20 | + $this->setLabel($label); |
|
21 | + } |
|
20 | 22 | $this->_states=[ State::SUCCESS,State::WARNING,State::ERROR,State::ACTIVE,State::DISABLED ]; |
21 | 23 | $this->addToProperty("class", $attributes); |
22 | 24 | } |
@@ -111,8 +113,9 @@ discard block |
||
111 | 113 | * @see BaseHtml::run() |
112 | 114 | */ |
113 | 115 | public function run(JsUtils $js) { |
114 | - if (isset($this->_bsComponent) === false) |
|
115 | - $this->_bsComponent=$js->semantic()->progress("#" . $this->identifier, $this->_params); |
|
116 | + if (isset($this->_bsComponent) === false) { |
|
117 | + $this->_bsComponent=$js->semantic()->progress("#" . $this->identifier, $this->_params); |
|
118 | + } |
|
116 | 119 | $this->addEventsOnRun($js); |
117 | 120 | return $this->_bsComponent; |
118 | 121 | } |
@@ -17,17 +17,17 @@ discard block |
||
17 | 17 | $this->createBar(); |
18 | 18 | if (isset($label)) |
19 | 19 | $this->setLabel($label); |
20 | - $this->_states=[ State::SUCCESS,State::WARNING,State::ERROR,State::ACTIVE,State::DISABLED ]; |
|
20 | + $this->_states=[State::SUCCESS, State::WARNING, State::ERROR, State::ACTIVE, State::DISABLED]; |
|
21 | 21 | $this->addToProperty("class", $attributes); |
22 | 22 | } |
23 | 23 | |
24 | 24 | public function setLabel($label) { |
25 | - $this->content["label"]=new HtmlSemDoubleElement("lbl-" . $this->identifier, "div", "label", $label); |
|
25 | + $this->content["label"]=new HtmlSemDoubleElement("lbl-".$this->identifier, "div", "label", $label); |
|
26 | 26 | return $this; |
27 | 27 | } |
28 | 28 | |
29 | 29 | private function createBar() { |
30 | - $bar=new HtmlSemDoubleElement("bar-" . $this->identifier, "div", "bar", new HtmlSemDoubleElement("progress-" . $this->identifier, "div", "progress")); |
|
30 | + $bar=new HtmlSemDoubleElement("bar-".$this->identifier, "div", "bar", new HtmlSemDoubleElement("progress-".$this->identifier, "div", "progress")); |
|
31 | 31 | $this->content["bar"]=$bar; |
32 | 32 | return $this; |
33 | 33 | } |
@@ -63,20 +63,20 @@ discard block |
||
63 | 63 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() |
64 | 64 | */ |
65 | 65 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
66 | - $this->content=JArray::sortAssociative($this->content, [ "bar","label" ]); |
|
66 | + $this->content=JArray::sortAssociative($this->content, ["bar", "label"]); |
|
67 | 67 | return parent::compile($js, $view); |
68 | 68 | } |
69 | 69 | |
70 | 70 | public function jsSetValue($value) { |
71 | - return '$("#' . $this->identifier . '").progress({value:' . $value . '});'; |
|
71 | + return '$("#'.$this->identifier.'").progress({value:'.$value.'});'; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | public function jsIncValue() { |
75 | - return '$("#' . $this->identifier . '").progress("increment");'; |
|
75 | + return '$("#'.$this->identifier.'").progress("increment");'; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | public function jsDecValue() { |
79 | - return '$("#' . $this->identifier . '").progress("decrement");'; |
|
79 | + return '$("#'.$this->identifier.'").progress("decrement");'; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -98,12 +98,12 @@ discard block |
||
98 | 98 | $percent=JArray::getDefaultValue($array, "percent", $percent); |
99 | 99 | $ratio=JArray::getDefaultValue($array, "ratio", $ratio); |
100 | 100 | } |
101 | - $this->_params["text"]="%{active : " . \var_export($active, true) . ",error: " . \var_export($error, true) . ",success : " . \var_export($success, true) . ",warning : " . \var_export($warning, true) . ",percent : " . \var_export($percent, true) . ",ratio : " . \var_export($ratio, true) . "}%"; |
|
101 | + $this->_params["text"]="%{active : ".\var_export($active, true).",error: ".\var_export($error, true).",success : ".\var_export($success, true).",warning : ".\var_export($warning, true).",percent : ".\var_export($percent, true).",ratio : ".\var_export($ratio, true)."}%"; |
|
102 | 102 | return $this; |
103 | 103 | } |
104 | 104 | |
105 | 105 | public function onChange($jsCode) { |
106 | - $this->addBehavior($this->_params, "onChange", $jsCode,"%function(percent, value, total){","}%"); |
|
106 | + $this->addBehavior($this->_params, "onChange", $jsCode, "%function(percent, value, total){", "}%"); |
|
107 | 107 | return $this; |
108 | 108 | } |
109 | 109 | |
@@ -112,8 +112,8 @@ discard block |
||
112 | 112 | * @see BaseHtml::run() |
113 | 113 | */ |
114 | 114 | public function run(JsUtils $js) { |
115 | - if (isset($this->_bsComponent) === false) |
|
116 | - $this->_bsComponent=$js->semantic()->progress("#" . $this->identifier, $this->_params); |
|
115 | + if (isset($this->_bsComponent)===false) |
|
116 | + $this->_bsComponent=$js->semantic()->progress("#".$this->identifier, $this->_params); |
|
117 | 117 | $this->addEventsOnRun($js); |
118 | 118 | return $this->_bsComponent; |
119 | 119 | } |
@@ -15,18 +15,18 @@ discard block |
||
15 | 15 | private $_hasIcon=false; |
16 | 16 | |
17 | 17 | abstract protected function addToPropertyCtrl($name, $value, $typeCtrl); |
18 | - abstract public function addContent($content,$before=false); |
|
18 | + abstract public function addContent($content, $before=false); |
|
19 | 19 | |
20 | - public function addIcon($icon,$direction=Direction::LEFT){ |
|
21 | - if($this->_hasIcon===false){ |
|
20 | + public function addIcon($icon, $direction=Direction::LEFT) { |
|
21 | + if ($this->_hasIcon===false) { |
|
22 | 22 | $iconO=$icon; |
23 | - if(\is_string($icon)){ |
|
23 | + if (\is_string($icon)) { |
|
24 | 24 | $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
25 | 25 | } |
26 | 26 | $this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon")); |
27 | - $this->addContent($iconO,$direction===Direction::LEFT); |
|
27 | + $this->addContent($iconO, $direction===Direction::LEFT); |
|
28 | 28 | $this->_hasIcon=true; |
29 | - }else{ |
|
29 | + } else { |
|
30 | 30 | $iconO=$this->getIcon(); |
31 | 31 | $iconO->setIcon($icon); |
32 | 32 | $this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon")); |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | return $iconO; |
35 | 35 | } |
36 | 36 | |
37 | - public function getIcon(){ |
|
38 | - if(\is_array($this->content)){ |
|
39 | - foreach ($this->content as $item){ |
|
40 | - if($item instanceof HtmlIcon) |
|
37 | + public function getIcon() { |
|
38 | + if (\is_array($this->content)) { |
|
39 | + foreach ($this->content as $item) { |
|
40 | + if ($item instanceof HtmlIcon) |
|
41 | 41 | return $item; |
42 | 42 | } |
43 | 43 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon")); |
27 | 27 | $this->addContent($iconO,$direction===Direction::LEFT); |
28 | 28 | $this->_hasIcon=true; |
29 | - }else{ |
|
29 | + } else{ |
|
30 | 30 | $iconO=$this->getIcon(); |
31 | 31 | $iconO->setIcon($icon); |
32 | 32 | $this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon")); |
@@ -37,8 +37,9 @@ discard block |
||
37 | 37 | public function getIcon(){ |
38 | 38 | if(\is_array($this->content)){ |
39 | 39 | foreach ($this->content as $item){ |
40 | - if($item instanceof HtmlIcon) |
|
41 | - return $item; |
|
40 | + if($item instanceof HtmlIcon) { |
|
41 | + return $item; |
|
42 | + } |
|
42 | 43 | } |
43 | 44 | } |
44 | 45 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | } |
26 | 26 | |
27 | 27 | public function setDisabled($disable=true) { |
28 | - if($disable) |
|
28 | + if ($disable) |
|
29 | 29 | $this->addState(State::DISABLED); |
30 | 30 | return $this; |
31 | 31 | } |
@@ -25,8 +25,9 @@ |
||
25 | 25 | } |
26 | 26 | |
27 | 27 | public function setDisabled($disable=true) { |
28 | - if($disable) |
|
29 | - $this->addState(State::DISABLED); |
|
28 | + if($disable) { |
|
29 | + $this->addState(State::DISABLED); |
|
30 | + } |
|
30 | 31 | return $this; |
31 | 32 | } |
32 | 33 | } |
@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | if (\is_array($elements)) { |
62 | 62 | foreach ( $elements as $key => $element ) { |
63 | 63 | $iid=$this->getElementsCount()+1; |
64 | - if ($element instanceof HtmlDropdownItem) |
|
65 | - $this->elements []=$element; |
|
66 | - else if (\is_array($element)) { |
|
64 | + if ($element instanceof HtmlDropdownItem) { |
|
65 | + $this->elements []=$element; |
|
66 | + } else if (\is_array($element)) { |
|
67 | 67 | if (is_string($key)===true) { |
68 | 68 | $dropdown=new HtmlDropdown($this->identifier."-dropdown-".$iid); |
69 | 69 | $dropdown->addItems($element); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $li=new HtmlBsDoubleElement($this->identifier."-li-".$iid, "li"); |
90 | 90 | if($caption instanceof HtmlLink){ |
91 | 91 | $link=$caption; |
92 | - }else{ |
|
92 | + } else{ |
|
93 | 93 | $link=new HtmlLink($this->identifier."-link-".$iid, $href, $caption); |
94 | 94 | } |
95 | 95 | $li->setContent($link); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | parent::__construct($identifier); |
28 | 28 | $this->tagName="ul"; |
29 | 29 | $this->_template='<%tagName% id="%identifier%" class="nav navbar-nav %class%">%elements%</%tagName%>'; |
30 | - $this->elements=array (); |
|
30 | + $this->elements=array(); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | public function setClass($value) { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | public function addElement($element) { |
42 | - if($element instanceof HtmlLink){ |
|
42 | + if ($element instanceof HtmlLink) { |
|
43 | 43 | $this->addLink($element); |
44 | 44 | } else if (is_object($element)) { |
45 | 45 | $this->elements []=$element; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | public function addElements($elements) { |
61 | 61 | if (\is_array($elements)) { |
62 | - foreach ( $elements as $key => $element ) { |
|
62 | + foreach ($elements as $key => $element) { |
|
63 | 63 | $iid=$this->getElementsCount()+1; |
64 | 64 | if ($element instanceof HtmlDropdownItem) |
65 | 65 | $this->elements []=$element; |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | public function addLink($caption, $href="#") { |
88 | 88 | $iid=$this->getElementsCount()+1; |
89 | 89 | $li=new HtmlBsDoubleElement($this->identifier."-li-".$iid, "li"); |
90 | - if($caption instanceof HtmlLink){ |
|
90 | + if ($caption instanceof HtmlLink) { |
|
91 | 91 | $link=$caption; |
92 | - }else{ |
|
92 | + } else { |
|
93 | 93 | $link=new HtmlLink($this->identifier."-link-".$iid, $href, $caption); |
94 | 94 | } |
95 | 95 | $li->setContent($link); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | } |
123 | 123 | |
124 | 124 | public function run(JsUtils $js) { |
125 | - foreach ( $this->elements as $element ) { |
|
125 | + foreach ($this->elements as $element) { |
|
126 | 126 | $element->run($js); |
127 | 127 | } |
128 | 128 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @param int $index |
144 | 144 | * @return BaseHtml |
145 | 145 | */ |
146 | - public function getElement($index){ |
|
146 | + public function getElement($index) { |
|
147 | 147 | return $this->elements[$index]; |
148 | 148 | } |
149 | 149 | } |
@@ -97,10 +97,11 @@ |
||
97 | 97 | |
98 | 98 | protected function setDivider($divider,$index){ |
99 | 99 | if(isset($index)){ |
100 | - if(!\is_array($this->_contentSeparator)) |
|
101 | - $this->_contentSeparator=array_fill (0, $this->count()-1,$this->_contentSeparator); |
|
100 | + if(!\is_array($this->_contentSeparator)) { |
|
101 | + $this->_contentSeparator=array_fill (0, $this->count()-1,$this->_contentSeparator); |
|
102 | + } |
|
102 | 103 | $this->_contentSeparator[$index]=$divider; |
103 | - }else{ |
|
104 | + } else{ |
|
104 | 105 | $this->_contentSeparator=$divider; |
105 | 106 | } |
106 | 107 | return $this; |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | protected $_contentSeparator=""; |
27 | 27 | |
28 | 28 | |
29 | - public function __construct($identifier,$tagName,$baseClass){ |
|
30 | - parent::__construct($identifier,$tagName,$baseClass); |
|
29 | + public function __construct($identifier, $tagName, $baseClass) { |
|
30 | + parent::__construct($identifier, $tagName, $baseClass); |
|
31 | 31 | $this->root=""; |
32 | 32 | $this->attr="data-ajax"; |
33 | 33 | } |
@@ -37,37 +37,37 @@ discard block |
||
37 | 37 | * @param string $targetSelector the target of the get |
38 | 38 | * @return HtmlNavElement |
39 | 39 | */ |
40 | - public function autoGetOnClick($targetSelector){ |
|
41 | - return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr)); |
|
40 | + public function autoGetOnClick($targetSelector) { |
|
41 | + return $this->getOnClick($this->root, $targetSelector, array("attr"=>$this->attr)); |
|
42 | 42 | } |
43 | 43 | |
44 | - public function contentAsString(){ |
|
44 | + public function contentAsString() { |
|
45 | 45 | return JArray::implode($this->_contentSeparator, $this->content); |
46 | 46 | } |
47 | 47 | |
48 | - public function setContentDivider($divider,$index=NULL) { |
|
48 | + public function setContentDivider($divider, $index=NULL) { |
|
49 | 49 | $divider="<div class='divider'> {$divider} </div>"; |
50 | 50 | return $this->setDivider($divider, $index); |
51 | 51 | } |
52 | 52 | |
53 | - public function setIconContentDivider($iconContentDivider,$index=NULL) { |
|
53 | + public function setIconContentDivider($iconContentDivider, $index=NULL) { |
|
54 | 54 | $contentDivider="<i class='".$iconContentDivider." icon divider'></i>"; |
55 | 55 | return $this->setDivider($contentDivider, $index); |
56 | 56 | } |
57 | 57 | |
58 | - protected function setDivider($divider,$index){ |
|
59 | - if(isset($index)){ |
|
60 | - if(!\is_array($this->_contentSeparator)) |
|
61 | - $this->_contentSeparator=array_fill (0, $this->count()-1,$this->_contentSeparator); |
|
58 | + protected function setDivider($divider, $index) { |
|
59 | + if (isset($index)) { |
|
60 | + if (!\is_array($this->_contentSeparator)) |
|
61 | + $this->_contentSeparator=array_fill(0, $this->count()-1, $this->_contentSeparator); |
|
62 | 62 | $this->_contentSeparator[$index]=$divider; |
63 | - }else{ |
|
63 | + } else { |
|
64 | 64 | $this->_contentSeparator=$divider; |
65 | 65 | } |
66 | 66 | return $this; |
67 | 67 | } |
68 | 68 | |
69 | - protected function getContentDivider($index){ |
|
70 | - if(\is_array($this->_contentSeparator)){ |
|
69 | + protected function getContentDivider($index) { |
|
70 | + if (\is_array($this->_contentSeparator)) { |
|
71 | 71 | return @$this->_contentSeparator[$index]; |
72 | 72 | } |
73 | 73 | return $this->_contentSeparator; |
@@ -20,6 +20,9 @@ |
||
20 | 20 | $this->params["fields"]=[]; |
21 | 21 | } |
22 | 22 | |
23 | + /** |
|
24 | + * @param string $identifier |
|
25 | + */ |
|
23 | 26 | public function addField($identifier){ |
24 | 27 | $this->params["fields"][$identifier]=new FieldValidation($identifier); |
25 | 28 | } |
@@ -20,15 +20,15 @@ discard block |
||
20 | 20 | $this->params["fields"]=[]; |
21 | 21 | } |
22 | 22 | |
23 | - public function addField($identifier){ |
|
23 | + public function addField($identifier) { |
|
24 | 24 | $this->params["fields"][$identifier]=new FieldValidation($identifier); |
25 | 25 | } |
26 | 26 | |
27 | - public function setInline($value){ |
|
27 | + public function setInline($value) { |
|
28 | 28 | return $this->setParam("inline", true); |
29 | 29 | } |
30 | 30 | |
31 | - public function setOn($value){ |
|
31 | + public function setOn($value) { |
|
32 | 32 | return $this->setParam("on", $value); |
33 | 33 | } |
34 | 34 | |
@@ -40,33 +40,33 @@ discard block |
||
40 | 40 | * @param mixed $value |
41 | 41 | * @param string|NULL $prompt |
42 | 42 | */ |
43 | - public function addFieldRule($identifier,$type,$prompt=NULL,$value=NULL){ |
|
44 | - if(isset($this->params["fields"][$identifier])===false){ |
|
43 | + public function addFieldRule($identifier, $type, $prompt=NULL, $value=NULL) { |
|
44 | + if (isset($this->params["fields"][$identifier])===false) { |
|
45 | 45 | $this->addField($identifier); |
46 | 46 | } |
47 | - $this->params["fields"][$identifier]->addRule($type,$prompt,$value); |
|
47 | + $this->params["fields"][$identifier]->addRule($type, $prompt, $value); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
51 | 51 | * @param FieldValidation $fieldValidation |
52 | 52 | */ |
53 | - public function addFieldValidation($fieldValidation){ |
|
53 | + public function addFieldValidation($fieldValidation) { |
|
54 | 54 | $this->params["fields"][$fieldValidation->getIdentifier()]=$fieldValidation; |
55 | 55 | } |
56 | 56 | |
57 | - public function setJs(JsUtils $js){ |
|
57 | + public function setJs(JsUtils $js) { |
|
58 | 58 | $this->js=$js; |
59 | 59 | } |
60 | 60 | |
61 | 61 | public function getScript() { |
62 | 62 | $allParams=$this->params; |
63 | - $this->jquery_code_for_compile=array (); |
|
63 | + $this->jquery_code_for_compile=array(); |
|
64 | 64 | $this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).{$this->uiName}(".$this->getParamsAsJSON($allParams).");"; |
65 | 65 | $this->compileEvents(); |
66 | 66 | return $this->compileJQueryCode(); |
67 | 67 | } |
68 | 68 | |
69 | - public function onValid($jsCode){ |
|
69 | + public function onValid($jsCode) { |
|
70 | 70 | $this->addComponentEvent("onValid", $jsCode); |
71 | 71 | } |
72 | 72 | } |
@@ -158,8 +158,8 @@ discard block |
||
158 | 158 | * @param string $tagName |
159 | 159 | * @return HtmlLabel |
160 | 160 | */ |
161 | - public function htmlLabel($identifier, $content="", $icon=NULL,$tagName="div") { |
|
162 | - return $this->addHtmlComponent(new HtmlLabel($identifier, $content,$icon, $tagName)); |
|
161 | + public function htmlLabel($identifier, $content="", $icon=NULL, $tagName="div") { |
|
162 | + return $this->addHtmlComponent(new HtmlLabel($identifier, $content, $icon, $tagName)); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
@@ -168,8 +168,8 @@ discard block |
||
168 | 168 | * @param array $attributes |
169 | 169 | * @return HtmlLabelGroups |
170 | 170 | */ |
171 | - public function htmlLabelGroups($identifier,$labels=array(),$attributes=array()){ |
|
172 | - return $this->addHtmlComponent(new HtmlLabelGroups($identifier,$labels,$attributes)); |
|
171 | + public function htmlLabelGroups($identifier, $labels=array(), $attributes=array()) { |
|
172 | + return $this->addHtmlComponent(new HtmlLabelGroups($identifier, $labels, $attributes)); |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | /** |
@@ -49,8 +49,9 @@ discard block |
||
49 | 49 | |
50 | 50 | public function getDataField(){ |
51 | 51 | $field= $this->getField(); |
52 | - if($field instanceof AbstractCheckbox) |
|
53 | - $field=$field->getField(); |
|
52 | + if($field instanceof AbstractCheckbox) { |
|
53 | + $field=$field->getField(); |
|
54 | + } |
|
54 | 55 | return $field; |
55 | 56 | } |
56 | 57 | |
@@ -62,7 +63,7 @@ discard block |
||
62 | 63 | public function setChecked($value=true){ |
63 | 64 | if($value===true){ |
64 | 65 | $this->getDataField()->setProperty("checked", "checked"); |
65 | - }else{ |
|
66 | + } else{ |
|
66 | 67 | $this->getDataField()->removeProperty("checked"); |
67 | 68 | } |
68 | 69 | return $this; |
@@ -38,22 +38,22 @@ discard block |
||
38 | 38 | return $this->getHtmlCk()->attachEvents($events); |
39 | 39 | } |
40 | 40 | |
41 | - public function getField(){ |
|
41 | + public function getField() { |
|
42 | 42 | return $this->content["field"]; |
43 | 43 | } |
44 | 44 | |
45 | - public function getHtmlCk(){ |
|
45 | + public function getHtmlCk() { |
|
46 | 46 | return $this->content["field"]; |
47 | 47 | } |
48 | 48 | |
49 | - public function setName($name){ |
|
49 | + public function setName($name) { |
|
50 | 50 | $this->getDataField()->setProperty("name", $name); |
51 | 51 | return $this; |
52 | 52 | } |
53 | 53 | |
54 | - public function getDataField(){ |
|
55 | - $field= $this->getField(); |
|
56 | - if($field instanceof AbstractCheckbox) |
|
54 | + public function getDataField() { |
|
55 | + $field=$this->getField(); |
|
56 | + if ($field instanceof AbstractCheckbox) |
|
57 | 57 | $field=$field->getField(); |
58 | 58 | return $field; |
59 | 59 | } |
@@ -63,10 +63,10 @@ discard block |
||
63 | 63 | * @param boolean $value |
64 | 64 | * @return HtmlFormField |
65 | 65 | */ |
66 | - public function setChecked($value=true){ |
|
67 | - if($value===true){ |
|
66 | + public function setChecked($value=true) { |
|
67 | + if ($value===true) { |
|
68 | 68 | $this->getDataField()->setProperty("checked", "checked"); |
69 | - }else{ |
|
69 | + } else { |
|
70 | 70 | $this->getDataField()->removeProperty("checked"); |
71 | 71 | } |
72 | 72 | return $this; |
@@ -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 | } |
@@ -30,10 +30,10 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function setWidth($width) { |
32 | 32 | if (\is_int($width)) { |
33 | - $width=Wide::getConstants()["W" . $width]; |
|
33 | + $width=Wide::getConstants()["W".$width]; |
|
34 | 34 | } |
35 | 35 | $this->addToPropertyCtrl("class", $width, Wide::getConstants()); |
36 | - return $this->addToPropertyCtrl("class", "wide", array ("wide" )); |
|
36 | + return $this->addToPropertyCtrl("class", "wide", array("wide")); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | public function setValue($value) { |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $divider->setVertical(); |
52 | 52 | else |
53 | 53 | $divider->setHorizontal(); |
54 | - $this->wrap($divider,""); |
|
54 | + $this->wrap($divider, ""); |
|
55 | 55 | return $divider; |
56 | 56 | } |
57 | 57 | } |