@@ -5,5 +5,5 @@ |
||
5 | 5 | use Ajax\common\BaseEnum; |
6 | 6 | |
7 | 7 | class TextAlignment extends BaseEnum { |
8 | - const LEFT="left aligned",CENTER="center aligned",RIGHT="right aligned",JUSTIFIED="justified"; |
|
8 | + const LEFT="left aligned", CENTER="center aligned", RIGHT="right aligned", JUSTIFIED="justified"; |
|
9 | 9 | } |
10 | 10 | \ No newline at end of file |
@@ -5,5 +5,5 @@ |
||
5 | 5 | use Ajax\common\BaseEnum; |
6 | 6 | |
7 | 7 | abstract class CheckboxType extends BaseEnum { |
8 | - const STANDARD="",TOGGLE="toggle",SLIDER="slider"; |
|
8 | + const STANDARD="", TOGGLE="toggle", SLIDER="slider"; |
|
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 Wide extends BaseEnum { |
5 | - const W1="one", W2="two", W3="three", W4="four",W5="five", W6="six", W7="seven", W8="eight",W9="nine",W10="ten",W11="eleven",W12="twelve",W13="thirteen",W14="fourteen",W15="fifteen",W16="sixteen"; |
|
5 | + const W1="one", W2="two", W3="three", W4="four", W5="five", W6="six", W7="seven", W8="eight", W9="nine", W10="ten", W11="eleven", W12="twelve", W13="thirteen", W14="fourteen", W15="fifteen", W16="sixteen"; |
|
6 | 6 | } |
7 | 7 | \ 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="",BELOW="below"; |
|
5 | + const RIGHT="right", LEFT="left", DOWN="down", UP="up", NONE="", BELOW="below"; |
|
6 | 6 | } |
7 | 7 | \ 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 Social extends BaseEnum { |
5 | - const FACEBOOK="facebook", TWITTER="twitter",GOOGLEPLUS="google plus",VK="vk",LINKEDIN="linkedin",INSTAGRAM="instagram",YOUTUBE="youtube"; |
|
5 | + const FACEBOOK="facebook", TWITTER="twitter", GOOGLEPLUS="google plus", VK="vk", LINKEDIN="linkedin", INSTAGRAM="instagram", YOUTUBE="youtube"; |
|
6 | 6 | } |
7 | 7 | \ No newline at end of file |
@@ -10,10 +10,10 @@ |
||
10 | 10 | * @author jc |
11 | 11 | * @version 1.001 |
12 | 12 | */ |
13 | -abstract class HtmlSemCollection extends HtmlCollection{ |
|
13 | +abstract class HtmlSemCollection extends HtmlCollection { |
|
14 | 14 | use BaseTrait; |
15 | - public function __construct( $identifier, $tagName="div",$baseClass=""){ |
|
16 | - parent::__construct( $identifier, $tagName); |
|
15 | + public function __construct($identifier, $tagName="div", $baseClass="") { |
|
16 | + parent::__construct($identifier, $tagName); |
|
17 | 17 | $this->_baseClass=$baseClass; |
18 | 18 | $this->setClass($baseClass); |
19 | 19 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | class HtmlPopup extends HtmlSemDoubleElement { |
13 | 13 | private $_params; |
14 | 14 | private $_container; |
15 | - public function __construct(BaseHtml $container,$identifier, $content="") { |
|
15 | + public function __construct(BaseHtml $container, $identifier, $content="") { |
|
16 | 16 | parent::__construct($identifier, "div"); |
17 | 17 | $this->_container=$container; |
18 | 18 | $this->setClass("ui popup"); |
@@ -20,9 +20,9 @@ discard block |
||
20 | 20 | $this->_params=array("on"=>"hover"); |
21 | 21 | } |
22 | 22 | |
23 | - public function addList($items=array(),$header=NULL){ |
|
24 | - if(!$this->content instanceof HtmlGrid){ |
|
25 | - $this->content=new HtmlGrid("Grid-".$this->identifier,0); |
|
23 | + public function addList($items=array(), $header=NULL) { |
|
24 | + if (!$this->content instanceof HtmlGrid) { |
|
25 | + $this->content=new HtmlGrid("Grid-".$this->identifier, 0); |
|
26 | 26 | } |
27 | 27 | $grid=$this->content; |
28 | 28 | |
@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | $colCount++; |
31 | 31 | $grid->setColsCount($colCount); |
32 | 32 | |
33 | - $list=new HtmlList("",$items); |
|
33 | + $list=new HtmlList("", $items); |
|
34 | 34 | $list->asLink(); |
35 | - if(isset($header)){ |
|
36 | - $list->addHeader(4,$header); |
|
35 | + if (isset($header)) { |
|
36 | + $list->addHeader(4, $header); |
|
37 | 37 | } |
38 | - $grid->getCell(0,$colCount-1)->setContent($list); |
|
38 | + $grid->getCell(0, $colCount-1)->setContent($list); |
|
39 | 39 | $grid->setDivided()->setRelaxed(true); |
40 | 40 | return $list; |
41 | 41 | } |
@@ -43,14 +43,14 @@ discard block |
||
43 | 43 | /** |
44 | 44 | * A popup can have no maximum width and continue to flow to fit its content |
45 | 45 | */ |
46 | - public function setFlowing(){ |
|
46 | + public function setFlowing() { |
|
47 | 47 | return $this->addToProperty("class", "flowing"); |
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
51 | 51 | * A popup can provide more basic formatting |
52 | 52 | */ |
53 | - public function setBasic(){ |
|
53 | + public function setBasic() { |
|
54 | 54 | return $this->addToProperty("class", "basic"); |
55 | 55 | } |
56 | 56 | |
@@ -58,22 +58,22 @@ discard block |
||
58 | 58 | * {@inheritDoc} |
59 | 59 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run() |
60 | 60 | */ |
61 | - public function run(JsUtils $js){ |
|
61 | + public function run(JsUtils $js) { |
|
62 | 62 | $this->_params["popup"]="#".$this->identifier; |
63 | - $js->semantic()->popup("#".$this->_container->getIdentifier(),$this->_params); |
|
63 | + $js->semantic()->popup("#".$this->_container->getIdentifier(), $this->_params); |
|
64 | 64 | } |
65 | 65 | |
66 | - public function setOn($event="click"){ |
|
66 | + public function setOn($event="click") { |
|
67 | 67 | $this->_params["on"]=$event; |
68 | 68 | return $this; |
69 | 69 | } |
70 | 70 | |
71 | - public function setInline($value=true){ |
|
71 | + public function setInline($value=true) { |
|
72 | 72 | $this->_params["inline"]=$value; |
73 | 73 | return $this; |
74 | 74 | } |
75 | 75 | |
76 | - public function setPosition($position){ |
|
76 | + public function setPosition($position) { |
|
77 | 77 | $this->_params["position"]=$position; |
78 | 78 | return $this; |
79 | 79 | } |
@@ -17,31 +17,31 @@ discard block |
||
17 | 17 | } |
18 | 18 | protected $mClass="menu"; |
19 | 19 | protected $mTagName="div"; |
20 | - protected $items=array (); |
|
21 | - protected $_params=array("action"=>"nothing","on"=>"hover"); |
|
20 | + protected $items=array(); |
|
21 | + protected $_params=array("action"=>"nothing", "on"=>"hover"); |
|
22 | 22 | protected $input; |
23 | 23 | |
24 | 24 | public function __construct($identifier, $value="", $items=array()) { |
25 | 25 | parent::__construct($identifier, "div"); |
26 | 26 | $this->_template=include dirname(__FILE__).'/../templates/tplDropdown.php'; |
27 | 27 | $this->setProperty("class", "ui dropdown"); |
28 | - $content=new HtmlSemDoubleElement("text-".$this->identifier,"div"); |
|
28 | + $content=new HtmlSemDoubleElement("text-".$this->identifier, "div"); |
|
29 | 29 | $content->setClass("text"); |
30 | 30 | $content->setContent($value); |
31 | - $content->wrap("",new HtmlIcon("", "dropdown")); |
|
31 | + $content->wrap("", new HtmlIcon("", "dropdown")); |
|
32 | 32 | $this->content=array($content); |
33 | 33 | $this->tagName="div"; |
34 | 34 | $this->addItems($items); |
35 | 35 | } |
36 | 36 | |
37 | - public function addItem($item,$value=NULL,$image=NULL){ |
|
38 | - $itemO=$this->beforeAddItem($item,$value,$image); |
|
37 | + public function addItem($item, $value=NULL, $image=NULL) { |
|
38 | + $itemO=$this->beforeAddItem($item, $value, $image); |
|
39 | 39 | $this->items[]=$itemO; |
40 | 40 | return $itemO; |
41 | 41 | } |
42 | 42 | |
43 | - public function addIcon($icon,$before=true,$labeled=false){ |
|
44 | - $this->addIconP($icon,$before,$labeled); |
|
43 | + public function addIcon($icon, $before=true, $labeled=false) { |
|
44 | + $this->addIconP($icon, $before, $labeled); |
|
45 | 45 | return $this->getElementById("text-".$this->identifier, $this->content)->setWrapAfter(""); |
46 | 46 | } |
47 | 47 | /** |
@@ -50,25 +50,25 @@ discard block |
||
50 | 50 | * @param number $position |
51 | 51 | * @return \Ajax\semantic\html\content\HtmlDropdownItem|unknown |
52 | 52 | */ |
53 | - public function insertItem($item,$position=0){ |
|
53 | + public function insertItem($item, $position=0) { |
|
54 | 54 | $itemO=$this->beforeAddItem($item); |
55 | - $start = array_slice($this->items, 0, $position); |
|
56 | - $end = array_slice($this->items, $position); |
|
57 | - $start[] = $item; |
|
55 | + $start=array_slice($this->items, 0, $position); |
|
56 | + $end=array_slice($this->items, $position); |
|
57 | + $start[]=$item; |
|
58 | 58 | $this->items=array_merge($start, $end); |
59 | 59 | return $itemO; |
60 | 60 | } |
61 | 61 | |
62 | - protected function beforeAddItem($item,$value=NULL,$image=NULL){ |
|
62 | + protected function beforeAddItem($item, $value=NULL, $image=NULL) { |
|
63 | 63 | $itemO=$item; |
64 | - if(\is_array($item)){ |
|
64 | + if (\is_array($item)) { |
|
65 | 65 | $value=JArray::getValue($item, "value", 1); |
66 | 66 | $image=JArray::getValue($item, "image", 2); |
67 | 67 | $item=JArray::getValue($item, "item", 0); |
68 | 68 | } |
69 | - if(!$item instanceof HtmlDropdownItem){ |
|
70 | - $itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items),$item,$value,$image); |
|
71 | - }elseif($itemO instanceof HtmlDropdownItem){ |
|
69 | + if (!$item instanceof HtmlDropdownItem) { |
|
70 | + $itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items), $item, $value, $image); |
|
71 | + }elseif ($itemO instanceof HtmlDropdownItem) { |
|
72 | 72 | $this->addToProperty("class", "vertical"); |
73 | 73 | } |
74 | 74 | return $itemO; |
@@ -81,76 +81,76 @@ discard block |
||
81 | 81 | $this->addItem($function($object)); |
82 | 82 | } |
83 | 83 | |
84 | - public function addInput($name){ |
|
85 | - if(!isset($name)) |
|
84 | + public function addInput($name) { |
|
85 | + if (!isset($name)) |
|
86 | 86 | $name="input-".$this->identifier; |
87 | 87 | $this->setAction("activate"); |
88 | - $this->input=new HtmlInput($name,"hidden"); |
|
88 | + $this->input=new HtmlInput($name, "hidden"); |
|
89 | 89 | } |
90 | 90 | |
91 | - public function addItems($items){ |
|
92 | - if(JArray::isAssociative($items)){ |
|
93 | - foreach ($items as $k=>$v){ |
|
91 | + public function addItems($items) { |
|
92 | + if (JArray::isAssociative($items)) { |
|
93 | + foreach ($items as $k=>$v) { |
|
94 | 94 | $this->addItem($v)->setData($k); |
95 | 95 | } |
96 | - }else{ |
|
97 | - foreach ($items as $item){ |
|
96 | + } else { |
|
97 | + foreach ($items as $item) { |
|
98 | 98 | $this->addItem($item); |
99 | 99 | } |
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
103 | - public function count(){ |
|
103 | + public function count() { |
|
104 | 104 | return \sizeof($this->items); |
105 | 105 | } |
106 | 106 | /** |
107 | 107 | * @param boolean $dropdown |
108 | 108 | */ |
109 | - public function asDropdown($dropdown){ |
|
110 | - if($dropdown===false){ |
|
109 | + public function asDropdown($dropdown) { |
|
110 | + if ($dropdown===false) { |
|
111 | 111 | $this->_template=include dirname(__FILE__).'/../templates/tplDropdownMenu.php'; |
112 | 112 | $dropdown="menu"; |
113 | - }else{ |
|
113 | + } else { |
|
114 | 114 | $dropdown="dropdown"; |
115 | 115 | $this->mClass="menu"; |
116 | 116 | } |
117 | - return $this->addToPropertyCtrl("class", $dropdown,array("menu","dropdown")); |
|
117 | + return $this->addToPropertyCtrl("class", $dropdown, array("menu", "dropdown")); |
|
118 | 118 | } |
119 | 119 | |
120 | - public function setVertical(){ |
|
121 | - return $this->addToPropertyCtrl("class", "vertical",array("vertical")); |
|
120 | + public function setVertical() { |
|
121 | + return $this->addToPropertyCtrl("class", "vertical", array("vertical")); |
|
122 | 122 | } |
123 | 123 | |
124 | - public function setSimple(){ |
|
125 | - return $this->addToPropertyCtrl("class", "simple",array("simple")); |
|
124 | + public function setSimple() { |
|
125 | + return $this->addToPropertyCtrl("class", "simple", array("simple")); |
|
126 | 126 | } |
127 | 127 | |
128 | - public function asButton($floating=false){ |
|
129 | - if($floating) |
|
128 | + public function asButton($floating=false) { |
|
129 | + if ($floating) |
|
130 | 130 | $this->addToProperty("class", "floating"); |
131 | 131 | return $this->addToProperty("class", "button"); |
132 | 132 | } |
133 | 133 | |
134 | - public function asSelect($name=NULL,$multiple=false,$selection=true){ |
|
135 | - if(isset($name)) |
|
134 | + public function asSelect($name=NULL, $multiple=false, $selection=true) { |
|
135 | + if (isset($name)) |
|
136 | 136 | $this->addInput($name); |
137 | - if($multiple) |
|
137 | + if ($multiple) |
|
138 | 138 | $this->addToProperty("class", "multiple"); |
139 | 139 | if ($selection) |
140 | - $this->addToPropertyCtrl("class", "selection",array("selection")); |
|
140 | + $this->addToPropertyCtrl("class", "selection", array("selection")); |
|
141 | 141 | return $this; |
142 | 142 | } |
143 | 143 | |
144 | - public function asSearch($name=NULL,$multiple=false,$selection=false){ |
|
145 | - $this->asSelect($name,$multiple,$selection); |
|
144 | + public function asSearch($name=NULL, $multiple=false, $selection=false) { |
|
145 | + $this->asSelect($name, $multiple, $selection); |
|
146 | 146 | return $this->addToProperty("class", "search"); |
147 | 147 | } |
148 | 148 | |
149 | - public function setSelect($name=NULL,$multiple=false){ |
|
150 | - if(!isset($name)) |
|
149 | + public function setSelect($name=NULL, $multiple=false) { |
|
150 | + if (!isset($name)) |
|
151 | 151 | $name="select-".$this->identifier; |
152 | 152 | $this->input=null; |
153 | - if($multiple){ |
|
153 | + if ($multiple) { |
|
154 | 154 | $this->setProperty("multiple", true); |
155 | 155 | $this->addToProperty("class", "multiple"); |
156 | 156 | } |
@@ -158,32 +158,32 @@ discard block |
||
158 | 158 | $this->tagName="select"; |
159 | 159 | $this->setProperty("name", $name); |
160 | 160 | $this->content=null; |
161 | - foreach ($this->items as $item){ |
|
161 | + foreach ($this->items as $item) { |
|
162 | 162 | $item->asOption(); |
163 | 163 | } |
164 | 164 | return $this; |
165 | 165 | } |
166 | 166 | |
167 | - public function asSubmenu($pointing=NULL){ |
|
167 | + public function asSubmenu($pointing=NULL) { |
|
168 | 168 | $this->setClass("ui dropdown link item"); |
169 | - if(isset($pointing)){ |
|
169 | + if (isset($pointing)) { |
|
170 | 170 | $this->setPointing($pointing); |
171 | 171 | } |
172 | 172 | return $this; |
173 | 173 | } |
174 | 174 | |
175 | - public function setPointing($value=Direction::NONE){ |
|
176 | - return $this->addToPropertyCtrl("class", $value." pointing",Direction::getConstantValues("pointing")); |
|
175 | + public function setPointing($value=Direction::NONE) { |
|
176 | + return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
|
177 | 177 | } |
178 | 178 | |
179 | - public function setValue($value){ |
|
180 | - if(isset($this->input)){ |
|
179 | + public function setValue($value) { |
|
180 | + if (isset($this->input)) { |
|
181 | 181 | $this->input->setProperty("value", $value); |
182 | - }else{ |
|
182 | + } else { |
|
183 | 183 | $this->setProperty("value", $value); |
184 | 184 | } |
185 | 185 | $textElement=$this->getElementById("text-".$this->identifier, $this->content); |
186 | - if(isset($textElement)) |
|
186 | + if (isset($textElement)) |
|
187 | 187 | $textElement->setContent($value); |
188 | 188 | return $this; |
189 | 189 | } |
@@ -193,23 +193,23 @@ discard block |
||
193 | 193 | * @see BaseHtml::run() |
194 | 194 | */ |
195 | 195 | public function run(JsUtils $js) { |
196 | - if($this->propertyContains("class", "simple")===false){ |
|
197 | - if(isset($this->_bsComponent)===false) |
|
198 | - $this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->_params); |
|
196 | + if ($this->propertyContains("class", "simple")===false) { |
|
197 | + if (isset($this->_bsComponent)===false) |
|
198 | + $this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier, $this->_params); |
|
199 | 199 | $this->addEventsOnRun($js); |
200 | 200 | return $this->_bsComponent; |
201 | 201 | } |
202 | 202 | } |
203 | 203 | |
204 | - public function setCompact(){ |
|
204 | + public function setCompact() { |
|
205 | 205 | return $this->addToPropertyCtrl("class", "compact", array("compact")); |
206 | 206 | } |
207 | 207 | |
208 | - public function setAction($action){ |
|
208 | + public function setAction($action) { |
|
209 | 209 | $this->_params["action"]=$action; |
210 | 210 | } |
211 | 211 | |
212 | - public function setFullTextSearch($value){ |
|
212 | + public function setFullTextSearch($value) { |
|
213 | 213 | $this->_params["fullTextSearch"]=$value; |
214 | 214 | } |
215 | 215 | } |
216 | 216 | \ No newline at end of file |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } |
69 | 69 | if(!$item instanceof HtmlDropdownItem){ |
70 | 70 | $itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items),$item,$value,$image); |
71 | - }elseif($itemO instanceof HtmlDropdownItem){ |
|
71 | + } elseif($itemO instanceof HtmlDropdownItem){ |
|
72 | 72 | $this->addToProperty("class", "vertical"); |
73 | 73 | } |
74 | 74 | return $itemO; |
@@ -82,8 +82,9 @@ discard block |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | public function addInput($name){ |
85 | - if(!isset($name)) |
|
86 | - $name="input-".$this->identifier; |
|
85 | + if(!isset($name)) { |
|
86 | + $name="input-".$this->identifier; |
|
87 | + } |
|
87 | 88 | $this->setAction("activate"); |
88 | 89 | $this->input=new HtmlInput($name,"hidden"); |
89 | 90 | } |
@@ -93,7 +94,7 @@ discard block |
||
93 | 94 | foreach ($items as $k=>$v){ |
94 | 95 | $this->addItem($v)->setData($k); |
95 | 96 | } |
96 | - }else{ |
|
97 | + } else{ |
|
97 | 98 | foreach ($items as $item){ |
98 | 99 | $this->addItem($item); |
99 | 100 | } |
@@ -110,7 +111,7 @@ discard block |
||
110 | 111 | if($dropdown===false){ |
111 | 112 | $this->_template=include dirname(__FILE__).'/../templates/tplDropdownMenu.php'; |
112 | 113 | $dropdown="menu"; |
113 | - }else{ |
|
114 | + } else{ |
|
114 | 115 | $dropdown="dropdown"; |
115 | 116 | $this->mClass="menu"; |
116 | 117 | } |
@@ -126,18 +127,22 @@ discard block |
||
126 | 127 | } |
127 | 128 | |
128 | 129 | public function asButton($floating=false){ |
129 | - if($floating) |
|
130 | - $this->addToProperty("class", "floating"); |
|
130 | + if($floating) { |
|
131 | + $this->addToProperty("class", "floating"); |
|
132 | + } |
|
131 | 133 | return $this->addToProperty("class", "button"); |
132 | 134 | } |
133 | 135 | |
134 | 136 | public function asSelect($name=NULL,$multiple=false,$selection=true){ |
135 | - if(isset($name)) |
|
136 | - $this->addInput($name); |
|
137 | - if($multiple) |
|
138 | - $this->addToProperty("class", "multiple"); |
|
139 | - if ($selection) |
|
140 | - $this->addToPropertyCtrl("class", "selection",array("selection")); |
|
137 | + if(isset($name)) { |
|
138 | + $this->addInput($name); |
|
139 | + } |
|
140 | + if($multiple) { |
|
141 | + $this->addToProperty("class", "multiple"); |
|
142 | + } |
|
143 | + if ($selection) { |
|
144 | + $this->addToPropertyCtrl("class", "selection",array("selection")); |
|
145 | + } |
|
141 | 146 | return $this; |
142 | 147 | } |
143 | 148 | |
@@ -147,8 +152,9 @@ discard block |
||
147 | 152 | } |
148 | 153 | |
149 | 154 | public function setSelect($name=NULL,$multiple=false){ |
150 | - if(!isset($name)) |
|
151 | - $name="select-".$this->identifier; |
|
155 | + if(!isset($name)) { |
|
156 | + $name="select-".$this->identifier; |
|
157 | + } |
|
152 | 158 | $this->input=null; |
153 | 159 | if($multiple){ |
154 | 160 | $this->setProperty("multiple", true); |
@@ -179,12 +185,13 @@ discard block |
||
179 | 185 | public function setValue($value){ |
180 | 186 | if(isset($this->input)){ |
181 | 187 | $this->input->setProperty("value", $value); |
182 | - }else{ |
|
188 | + } else{ |
|
183 | 189 | $this->setProperty("value", $value); |
184 | 190 | } |
185 | 191 | $textElement=$this->getElementById("text-".$this->identifier, $this->content); |
186 | - if(isset($textElement)) |
|
187 | - $textElement->setContent($value); |
|
192 | + if(isset($textElement)) { |
|
193 | + $textElement->setContent($value); |
|
194 | + } |
|
188 | 195 | return $this; |
189 | 196 | } |
190 | 197 | |
@@ -194,8 +201,9 @@ discard block |
||
194 | 201 | */ |
195 | 202 | public function run(JsUtils $js) { |
196 | 203 | if($this->propertyContains("class", "simple")===false){ |
197 | - if(isset($this->_bsComponent)===false) |
|
198 | - $this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->_params); |
|
204 | + if(isset($this->_bsComponent)===false) { |
|
205 | + $this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->_params); |
|
206 | + } |
|
199 | 207 | $this->addEventsOnRun($js); |
200 | 208 | return $this->_bsComponent; |
201 | 209 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | * @param int $max |
14 | 14 | * @param string $icon star or heart |
15 | 15 | */ |
16 | - public function __construct($identifier, $value,$max=5,$icon="") { |
|
16 | + public function __construct($identifier, $value, $max=5, $icon="") { |
|
17 | 17 | parent::__construct($identifier, "div", "ui {$icon} rating"); |
18 | 18 | $this->setValue($value); |
19 | 19 | $this->setMax($max); |
@@ -23,11 +23,11 @@ discard block |
||
23 | 23 | * {@inheritDoc} |
24 | 24 | * @see \Ajax\common\html\HtmlDoubleElement::setValue() |
25 | 25 | */ |
26 | - public function setValue($value){ |
|
26 | + public function setValue($value) { |
|
27 | 27 | $this->setProperty("data-rating", $value); |
28 | 28 | } |
29 | 29 | |
30 | - public function setMax($max){ |
|
30 | + public function setMax($max) { |
|
31 | 31 | $this->setProperty("data-max-rating", $max); |
32 | 32 | } |
33 | 33 | |
@@ -35,20 +35,20 @@ discard block |
||
35 | 35 | * {@inheritDoc} |
36 | 36 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run() |
37 | 37 | */ |
38 | - public function run(JsUtils $js){ |
|
38 | + public function run(JsUtils $js) { |
|
39 | 39 | parent::run($js); |
40 | - return $js->semantic()->rating("#".$this->identifier,$this->_params); |
|
40 | + return $js->semantic()->rating("#".$this->identifier, $this->_params); |
|
41 | 41 | } |
42 | 42 | |
43 | - public function asStar(){ |
|
43 | + public function asStar() { |
|
44 | 44 | return $this->setIcon(); |
45 | 45 | } |
46 | 46 | |
47 | - public function asHeart(){ |
|
47 | + public function asHeart() { |
|
48 | 48 | return $this->setIcon("heart"); |
49 | 49 | } |
50 | 50 | |
51 | - public function setIcon($icon="star"){ |
|
52 | - return $this->addToPropertyCtrl("class", $icon, ["star","heart",""]); |
|
51 | + public function setIcon($icon="star") { |
|
52 | + return $this->addToPropertyCtrl("class", $icon, ["star", "heart", ""]); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | \ No newline at end of file |