@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | public function __construct($identifier, $items=array()) { |
12 | 12 | parent::__construct($identifier, "div"); |
13 | 13 | $this->setClass("ui menu"); |
14 | - foreach ($items as $item){ |
|
14 | + foreach ($items as $item) { |
|
15 | 15 | $this->addItem($item); |
16 | 16 | } |
17 | 17 | } |
@@ -21,14 +21,14 @@ discard block |
||
21 | 21 | * @param string $type one of text,item |
22 | 22 | * @return \Ajax\semantic\html\collections\HtmlMenu |
23 | 23 | */ |
24 | - public function setType($type=""){ |
|
25 | - return $this->addToPropertyCtrl("class", $type, array("","item","text")); |
|
24 | + public function setType($type="") { |
|
25 | + return $this->addToPropertyCtrl("class", $type, array("", "item", "text")); |
|
26 | 26 | } |
27 | 27 | |
28 | - public function addItem($item){ |
|
28 | + public function addItem($item) { |
|
29 | 29 | $itemO=$item; |
30 | - if(\is_string($item)){ |
|
31 | - $itemO=new HtmlLink("item-".\sizeof($this->content),"",$item); |
|
30 | + if (\is_string($item)) { |
|
31 | + $itemO=new HtmlLink("item-".\sizeof($this->content), "", $item); |
|
32 | 32 | $itemO->setClass("item"); |
33 | 33 | } |
34 | 34 | $this->addContent($itemO); |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | } |
49 | 49 | } |
50 | 50 | |
51 | - public function setActiveItem($index){ |
|
51 | + public function setActiveItem($index) { |
|
52 | 52 | $item=$this->getItem($index); |
53 | - if($item!==null){ |
|
53 | + if ($item!==null) { |
|
54 | 54 | $item->addToProperty("class", "active"); |
55 | 55 | } |
56 | 56 | return $this; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | class HtmlDropdown extends HtmlSemDoubleElement { |
13 | 13 | protected $mClass="menu"; |
14 | 14 | protected $mTagName="div"; |
15 | - protected $items=array (); |
|
15 | + protected $items=array(); |
|
16 | 16 | protected $params=array("action"=>"select"); |
17 | 17 | protected $input; |
18 | 18 | |
@@ -20,67 +20,67 @@ discard block |
||
20 | 20 | parent::__construct($identifier, "div"); |
21 | 21 | $this->_template=include dirname(__FILE__).'/../templates/tplDropdown.php'; |
22 | 22 | $this->setProperty("class", "ui dropdown"); |
23 | - $content=new HtmlSemDoubleElement("","div"); |
|
23 | + $content=new HtmlSemDoubleElement("", "div"); |
|
24 | 24 | $content->setClass("text"); |
25 | 25 | $content->setContent($value); |
26 | - $content->wrap("",new HtmlIcon("", "dropdown")); |
|
26 | + $content->wrap("", new HtmlIcon("", "dropdown")); |
|
27 | 27 | $this->content=array($content); |
28 | 28 | $this->tagName="div"; |
29 | 29 | $this->addItems($items); |
30 | 30 | } |
31 | 31 | |
32 | - public function addItem($item,$value=NULL,$image=NULL){ |
|
32 | + public function addItem($item, $value=NULL, $image=NULL) { |
|
33 | 33 | $itemO=$item; |
34 | - if(\is_object($item)===false){ |
|
35 | - $itemO=new HtmlDropdownItem("dd-item-".$this->identifier,$item,$value,$image); |
|
34 | + if (\is_object($item)===false) { |
|
35 | + $itemO=new HtmlDropdownItem("dd-item-".$this->identifier, $item, $value, $image); |
|
36 | 36 | } |
37 | 37 | $this->items[]=$itemO; |
38 | 38 | return $itemO; |
39 | 39 | } |
40 | 40 | |
41 | - public function addInput($name){ |
|
42 | - if(!isset($name)) |
|
41 | + public function addInput($name) { |
|
42 | + if (!isset($name)) |
|
43 | 43 | $name="input-".$this->identifier; |
44 | 44 | $this->setAction("activate"); |
45 | - $this->input=new HtmlInput($name,"hidden"); |
|
45 | + $this->input=new HtmlInput($name, "hidden"); |
|
46 | 46 | } |
47 | 47 | |
48 | - public function addItems($items){ |
|
49 | - if(JArray::isAssociative($items)){ |
|
50 | - foreach ($items as $k=>$v){ |
|
48 | + public function addItems($items) { |
|
49 | + if (JArray::isAssociative($items)) { |
|
50 | + foreach ($items as $k=>$v) { |
|
51 | 51 | $this->addItem($v)->setData($k); |
52 | 52 | } |
53 | - }else{ |
|
54 | - foreach ($items as $item){ |
|
53 | + }else { |
|
54 | + foreach ($items as $item) { |
|
55 | 55 | $this->addItem($item); |
56 | 56 | } |
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | - public function asButton(){ |
|
60 | + public function asButton() { |
|
61 | 61 | return $this->addToProperty("class", "button"); |
62 | 62 | } |
63 | 63 | |
64 | - public function asSelect($name=NULL,$multiple=false,$selection=true){ |
|
65 | - if(isset($name)) |
|
64 | + public function asSelect($name=NULL, $multiple=false, $selection=true) { |
|
65 | + if (isset($name)) |
|
66 | 66 | $this->addInput($name); |
67 | - if($multiple) |
|
67 | + if ($multiple) |
|
68 | 68 | $this->addToProperty("class", "multiple"); |
69 | 69 | if ($selection) |
70 | - $this->addToPropertyCtrl("class", "selection",array("selection")); |
|
70 | + $this->addToPropertyCtrl("class", "selection", array("selection")); |
|
71 | 71 | return $this; |
72 | 72 | } |
73 | 73 | |
74 | - public function asSearch($name=NULL,$multiple=false,$selection=false){ |
|
75 | - $this->asSelect($name,$multiple,$selection); |
|
74 | + public function asSearch($name=NULL, $multiple=false, $selection=false) { |
|
75 | + $this->asSelect($name, $multiple, $selection); |
|
76 | 76 | return $this->addToProperty("class", "search"); |
77 | 77 | } |
78 | 78 | |
79 | - public function setSelect($name=NULL,$multiple=false){ |
|
80 | - if(!isset($name)) |
|
79 | + public function setSelect($name=NULL, $multiple=false) { |
|
80 | + if (!isset($name)) |
|
81 | 81 | $name="select-".$this->identifier; |
82 | 82 | $this->input=null; |
83 | - if($multiple){ |
|
83 | + if ($multiple) { |
|
84 | 84 | $this->setProperty("multiple", true); |
85 | 85 | $this->addToProperty("class", "multiple"); |
86 | 86 | } |
@@ -88,16 +88,16 @@ discard block |
||
88 | 88 | $this->tagName="select"; |
89 | 89 | $this->setProperty("name", $name); |
90 | 90 | $this->content=null; |
91 | - foreach ($this->items as $item){ |
|
91 | + foreach ($this->items as $item) { |
|
92 | 92 | $item->asOption(); |
93 | 93 | } |
94 | 94 | return $this; |
95 | 95 | } |
96 | 96 | |
97 | - public function setValue($value){ |
|
98 | - if(isset($this->input)){ |
|
97 | + public function setValue($value) { |
|
98 | + if (isset($this->input)) { |
|
99 | 99 | $this->input->setProperty("value", $value); |
100 | - }else{ |
|
100 | + }else { |
|
101 | 101 | $this->setProperty("value", $value); |
102 | 102 | } |
103 | 103 | return $this; |
@@ -108,12 +108,12 @@ discard block |
||
108 | 108 | * @see BaseHtml::run() |
109 | 109 | */ |
110 | 110 | public function run(JsUtils $js) { |
111 | - $this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier,$this->params); |
|
111 | + $this->_bsComponent=$js->semantic()->dropdown("#".$this->identifier, $this->params); |
|
112 | 112 | $this->addEventsOnRun($js); |
113 | 113 | return $this->_bsComponent; |
114 | 114 | } |
115 | 115 | |
116 | - public function setAction($action){ |
|
116 | + public function setAction($action) { |
|
117 | 117 | $this->params["action"]=$action; |
118 | 118 | } |
119 | 119 | } |
120 | 120 | \ No newline at end of file |
@@ -8,8 +8,8 @@ discard block |
||
8 | 8 | |
9 | 9 | class HtmlLabel extends HtmlSemDoubleElement { |
10 | 10 | |
11 | - public function __construct($identifier,$caption="",$tagName="div") { |
|
12 | - parent::__construct($identifier,$tagName); |
|
11 | + public function __construct($identifier, $caption="", $tagName="div") { |
|
12 | + parent::__construct($identifier, $tagName); |
|
13 | 13 | $this->setProperty("class", "ui label"); |
14 | 14 | $this->content=$caption; |
15 | 15 | } |
@@ -18,26 +18,26 @@ discard block |
||
18 | 18 | * @param string $side |
19 | 19 | * @return \Ajax\semantic\html\elements\HtmlLabel |
20 | 20 | */ |
21 | - public function setPointing($side=""){ |
|
22 | - return $this->addToPropertyCtrl("class", $side." pointing",array("right pointing","left pointing"," pointing")); |
|
21 | + public function setPointing($side="") { |
|
22 | + return $this->addToPropertyCtrl("class", $side." pointing", array("right pointing", "left pointing", " pointing")); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
26 | 26 | * @param string $side |
27 | 27 | * @return \Ajax\semantic\html\elements\HtmlLabel |
28 | 28 | */ |
29 | - public function toCorner($side="left"){ |
|
30 | - return $this->addToPropertyCtrl("class", $side." corner",array("right corner","left corner")); |
|
29 | + public function toCorner($side="left") { |
|
30 | + return $this->addToPropertyCtrl("class", $side." corner", array("right corner", "left corner")); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
34 | 34 | * @return \Ajax\semantic\html\elements\HtmlLabel |
35 | 35 | */ |
36 | - public function asTag(){ |
|
36 | + public function asTag() { |
|
37 | 37 | return $this->addToProperty("class", "tag"); |
38 | 38 | } |
39 | 39 | |
40 | - public function setBasic(){ |
|
40 | + public function setBasic() { |
|
41 | 41 | return $this->addToProperty("class", "basic"); |
42 | 42 | } |
43 | 43 | |
@@ -48,17 +48,17 @@ discard block |
||
48 | 48 | * @param string $before |
49 | 49 | * @return \Ajax\semantic\html\elements\HtmlLabel |
50 | 50 | */ |
51 | - public function addImage($src,$alt="",$before=true){ |
|
51 | + public function addImage($src, $alt="", $before=true) { |
|
52 | 52 | $this->addToProperty("class", "image"); |
53 | - return $this->addContent(new HtmlImg("image-".$this->identifier,$src,$alt),$before); |
|
53 | + return $this->addContent(new HtmlImg("image-".$this->identifier, $src, $alt), $before); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
57 | 57 | * @param string $detail |
58 | 58 | * @return \Ajax\common\html\HtmlDoubleElement |
59 | 59 | */ |
60 | - public function addDetail($detail){ |
|
61 | - $div=new HtmlDoubleElement("detail-".$this->identifier,$this->tagName); |
|
60 | + public function addDetail($detail) { |
|
61 | + $div=new HtmlDoubleElement("detail-".$this->identifier, $this->tagName); |
|
62 | 62 | $div->setClass("detail"); |
63 | 63 | $div->setContent($detail); |
64 | 64 | $this->addContent($div); |
@@ -17,13 +17,13 @@ |
||
17 | 17 | $this->setProperty("class", "ui container"); |
18 | 18 | } |
19 | 19 | |
20 | - public function setAlignement($value="justified"){ |
|
21 | - if($value!=="justified") |
|
20 | + public function setAlignement($value="justified") { |
|
21 | + if ($value!=="justified") |
|
22 | 22 | $value.=" aligned"; |
23 | 23 | return $this->addToProperty("class", $value); |
24 | 24 | } |
25 | 25 | |
26 | - public function setTextContainer(){ |
|
26 | + public function setTextContainer() { |
|
27 | 27 | return $this->addToProperty("class", "text"); |
28 | 28 | } |
29 | 29 | } |
30 | 30 | \ No newline at end of file |
@@ -11,22 +11,22 @@ |
||
11 | 11 | */ |
12 | 12 | class HtmlIconGroups extends HtmlSemDoubleElement { |
13 | 13 | |
14 | - public function __construct($identifier,$size="") { |
|
14 | + public function __construct($identifier, $size="") { |
|
15 | 15 | parent::__construct($identifier, "i"); |
16 | 16 | $this->setProperty("class", "icons"); |
17 | 17 | $this->setSize($size); |
18 | 18 | } |
19 | 19 | |
20 | - public function add($icon,$size=""){ |
|
20 | + public function add($icon, $size="") { |
|
21 | 21 | $iconO=$icon; |
22 | - if(\is_string($icon)){ |
|
22 | + if (\is_string($icon)) { |
|
23 | 23 | $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
24 | 24 | $iconO->setSize($size); |
25 | 25 | } |
26 | 26 | $this->addContent($iconO); |
27 | 27 | } |
28 | 28 | |
29 | - public function getIcon($index){ |
|
29 | + public function getIcon($index) { |
|
30 | 30 | return $this->content[$index]; |
31 | 31 | } |
32 | 32 | } |
33 | 33 | \ No newline at end of file |
@@ -47,20 +47,20 @@ discard block |
||
47 | 47 | * @return \Ajax\semantic\html\HtmlButton default : "" |
48 | 48 | */ |
49 | 49 | public function setStyle($cssStyle) { |
50 | - return $this->addToProperty("class",$cssStyle); |
|
50 | + return $this->addToProperty("class", $cssStyle); |
|
51 | 51 | } |
52 | 52 | |
53 | - public function setFocusable(){ |
|
53 | + public function setFocusable() { |
|
54 | 54 | $this->setProperty("tabindex", "0"); |
55 | 55 | } |
56 | 56 | |
57 | - public function setAnimated($content,$animation=""){ |
|
57 | + public function setAnimated($content, $animation="") { |
|
58 | 58 | $this->setTagName("div"); |
59 | 59 | $this->addToProperty("class", "animated ".$animation); |
60 | - $visible=new HtmlSemDoubleElement("visible-".$this->identifier,"div"); |
|
60 | + $visible=new HtmlSemDoubleElement("visible-".$this->identifier, "div"); |
|
61 | 61 | $visible->setClass("visible content"); |
62 | 62 | $visible->setContent($this->content); |
63 | - $hidden=new HtmlSemDoubleElement("hidden-".$this->identifier,"div"); |
|
63 | + $hidden=new HtmlSemDoubleElement("hidden-".$this->identifier, "div"); |
|
64 | 64 | $hidden->setClass("hidden content"); |
65 | 65 | $hidden->setContent($content); |
66 | 66 | $this->content=$visible.$hidden; |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | * @param string|HtmlIcon $icon |
71 | 71 | * @return \Ajax\semantic\html\elements\HtmlButton |
72 | 72 | */ |
73 | - public function asIcon($icon){ |
|
73 | + public function asIcon($icon) { |
|
74 | 74 | $iconO=$icon; |
75 | - if(\is_string($icon)){ |
|
75 | + if (\is_string($icon)) { |
|
76 | 76 | $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
77 | 77 | } |
78 | 78 | $this->addToProperty("class", "icon"); |
@@ -86,14 +86,14 @@ discard block |
||
86 | 86 | * @param string $before |
87 | 87 | * @return \Ajax\semantic\html\elements\HtmlLabel |
88 | 88 | */ |
89 | - public function addLabel($caption,$before=false){ |
|
89 | + public function addLabel($caption, $before=false) { |
|
90 | 90 | $this->tagName="div"; |
91 | 91 | $this->addToProperty("class", "labeled"); |
92 | - $this->content=new HtmlButton("button-".$this->identifier,$this->content); |
|
92 | + $this->content=new HtmlButton("button-".$this->identifier, $this->content); |
|
93 | 93 | $this->content->setTagName("div"); |
94 | - $label=new HtmlLabel("label-".$this->identifier,$caption,"a"); |
|
94 | + $label=new HtmlLabel("label-".$this->identifier, $caption, "a"); |
|
95 | 95 | $label->setBasic(); |
96 | - $this->addContent($label,$before); |
|
96 | + $this->addContent($label, $before); |
|
97 | 97 | return $label; |
98 | 98 | } |
99 | 99 | /* |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function fromArray($array) { |
104 | 104 | $array=parent::fromArray($array); |
105 | - foreach ( $array as $key => $value ) { |
|
105 | + foreach ($array as $key => $value) { |
|
106 | 106 | $this->setProperty($key, $value); |
107 | 107 | } |
108 | 108 | return $array; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | * can be formatted to appear on dark backgrounds |
113 | 113 | * @return \Ajax\semantic\html\elements\HtmlButton |
114 | 114 | */ |
115 | - public function setInverted(){ |
|
115 | + public function setInverted() { |
|
116 | 116 | return $this->addToProperty("class", "inverted"); |
117 | 117 | } |
118 | 118 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | * show it is currently the active user selection |
121 | 121 | * @return \Ajax\semantic\html\elements\HtmlButton |
122 | 122 | */ |
123 | - public function setActive(){ |
|
123 | + public function setActive() { |
|
124 | 124 | return $this->addToProperty("class", "active"); |
125 | 125 | } |
126 | 126 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | * show a loading indicator |
129 | 129 | * @return \Ajax\semantic\html\elements\HtmlButton |
130 | 130 | */ |
131 | - public function asLoader(){ |
|
131 | + public function asLoader() { |
|
132 | 132 | return $this->addToProperty("class", "loading"); |
133 | 133 | } |
134 | 134 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | * hint towards a positive consequence |
137 | 137 | * @return \Ajax\semantic\html\elements\HtmlButton |
138 | 138 | */ |
139 | - public function setPositive(){ |
|
139 | + public function setPositive() { |
|
140 | 140 | return $this->addToProperty("class", "positive"); |
141 | 141 | } |
142 | 142 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | * hint towards a negative consequence |
145 | 145 | * @return \Ajax\semantic\html\elements\HtmlButton |
146 | 146 | */ |
147 | - public function setNegative(){ |
|
147 | + public function setNegative() { |
|
148 | 148 | return $this->addToProperty("class", "negative"); |
149 | 149 | } |
150 | 150 | |
@@ -152,14 +152,14 @@ discard block |
||
152 | 152 | * formatted to toggle on/off |
153 | 153 | * @return \Ajax\semantic\html\elements\HtmlButton |
154 | 154 | */ |
155 | - public function setToggle(){ |
|
155 | + public function setToggle() { |
|
156 | 156 | return $this->addToProperty("class", "toggle"); |
157 | 157 | } |
158 | 158 | |
159 | 159 | /** |
160 | 160 | * @return \Ajax\semantic\html\elements\HtmlButton |
161 | 161 | */ |
162 | - public function setCircular(){ |
|
162 | + public function setCircular() { |
|
163 | 163 | return $this->addToProperty("class", "circular"); |
164 | 164 | } |
165 | 165 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | * button is less pronounced |
168 | 168 | * @return \Ajax\semantic\html\elements\HtmlButton |
169 | 169 | */ |
170 | - public function setBasic(){ |
|
170 | + public function setBasic() { |
|
171 | 171 | return $this->addToProperty("class", "basic"); |
172 | 172 | } |
173 | 173 | } |
174 | 174 | \ No newline at end of file |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * {@inheritDoc} |
21 | 21 | * @see \Ajax\common\html\HtmlSingleElement::setSize() |
22 | 22 | */ |
23 | - public function setSize($size){ |
|
23 | + public function setSize($size) { |
|
24 | 24 | return $this->addToPropertyCtrl("class", $size, Size::getConstants()); |
25 | 25 | } |
26 | 26 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * show it is currently unable to be interacted with |
29 | 29 | * @return \Ajax\semantic\html\elements\HtmlSemDoubleElement |
30 | 30 | */ |
31 | - public function setDisabled(){ |
|
31 | + public function setDisabled() { |
|
32 | 32 | return $this->addToProperty("class", "disabled"); |
33 | 33 | } |
34 | 34 | |
@@ -36,28 +36,28 @@ discard block |
||
36 | 36 | * @param string $color |
37 | 37 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
38 | 38 | */ |
39 | - public function setColor($color){ |
|
40 | - return $this->addToPropertyCtrl("class", $color,Color::getConstants()); |
|
39 | + public function setColor($color) { |
|
40 | + return $this->addToPropertyCtrl("class", $color, Color::getConstants()); |
|
41 | 41 | } |
42 | 42 | |
43 | - public function setPopupAttributes($variation=NULL,$popupEvent=NULL){ |
|
44 | - if(isset($this->_popup)) |
|
45 | - $this->_popup->setAttributes($variation,$popupEvent); |
|
43 | + public function setPopupAttributes($variation=NULL, $popupEvent=NULL) { |
|
44 | + if (isset($this->_popup)) |
|
45 | + $this->_popup->setAttributes($variation, $popupEvent); |
|
46 | 46 | } |
47 | 47 | |
48 | - public function addPopup($title="",$content="",$variation=NULL,$params=array()){ |
|
49 | - $this->_popup=new InternalPopup($this,$title,$content,$variation,$params); |
|
48 | + public function addPopup($title="", $content="", $variation=NULL, $params=array()) { |
|
49 | + $this->_popup=new InternalPopup($this, $title, $content, $variation, $params); |
|
50 | 50 | return $this; |
51 | 51 | } |
52 | 52 | |
53 | - public function addPopupHtml($html="",$variation=NULL,$params=array()){ |
|
53 | + public function addPopupHtml($html="", $variation=NULL, $params=array()) { |
|
54 | 54 | $this->_popup=new InternalPopup($this); |
55 | 55 | $this->_popup->setHtml($html); |
56 | - $this->_popup->setAttributes($variation,$params); |
|
56 | + $this->_popup->setAttributes($variation, $params); |
|
57 | 57 | return $this; |
58 | 58 | } |
59 | 59 | |
60 | - public function setFluid(){ |
|
60 | + public function setFluid() { |
|
61 | 61 | $this->addToProperty("class", "fluid"); |
62 | 62 | } |
63 | 63 | |
@@ -68,27 +68,27 @@ discard block |
||
68 | 68 | * @param boolean $labeled |
69 | 69 | * @return \Ajax\semantic\html\elements\HtmlIcon |
70 | 70 | */ |
71 | - public function addIcon($icon,$before=true,$labeled=false){ |
|
71 | + public function addIcon($icon, $before=true, $labeled=false) { |
|
72 | 72 | $iconO=$icon; |
73 | - if(\is_string($icon)){ |
|
73 | + if (\is_string($icon)) { |
|
74 | 74 | $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
75 | 75 | } |
76 | - if($labeled!==false){ |
|
76 | + if ($labeled!==false) { |
|
77 | 77 | $this->addToProperty("class", "labeled icon"); |
78 | 78 | $this->tagName="div"; |
79 | 79 | } |
80 | - $this->addContent($iconO,$before); |
|
80 | + $this->addContent($iconO, $before); |
|
81 | 81 | return $iconO; |
82 | 82 | } |
83 | 83 | |
84 | - public function compile(JsUtils $js=NULL, View $view=NULL){ |
|
85 | - if(isset($this->_popup)) |
|
84 | + public function compile(JsUtils $js=NULL, View $view=NULL) { |
|
85 | + if (isset($this->_popup)) |
|
86 | 86 | $this->_popup->compile(); |
87 | - return parent::compile($js,$view); |
|
87 | + return parent::compile($js, $view); |
|
88 | 88 | } |
89 | - public function run(JsUtils $js){ |
|
89 | + public function run(JsUtils $js) { |
|
90 | 90 | parent::run($js); |
91 | - if(isset($this->_popup)){ |
|
91 | + if (isset($this->_popup)) { |
|
92 | 92 | $this->_popup->run($js); |
93 | 93 | //$this->addEventsOnRun($js); |
94 | 94 | //return $this->_bsComponent; |
@@ -11,11 +11,11 @@ discard block |
||
11 | 11 | protected $variation; |
12 | 12 | protected $params; |
13 | 13 | protected $semElement; |
14 | - public function __construct($semElement,$title="",$content="",$variation=NULL,$params=array()){ |
|
14 | + public function __construct($semElement, $title="", $content="", $variation=NULL, $params=array()) { |
|
15 | 15 | $this->semElement=$semElement; |
16 | 16 | $this->title=$title; |
17 | 17 | $this->content=$content; |
18 | - $this->setAttributes($variation,$params); |
|
18 | + $this->setAttributes($variation, $params); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | public function setHtml($html) { |
@@ -23,32 +23,32 @@ discard block |
||
23 | 23 | return $this; |
24 | 24 | } |
25 | 25 | |
26 | - public function setAttributes($variation=NULL,$params=array()){ |
|
26 | + public function setAttributes($variation=NULL, $params=array()) { |
|
27 | 27 | $this->variation=$variation; |
28 | 28 | $this->params=$params; |
29 | 29 | } |
30 | 30 | |
31 | - public function onShow($jsCode){ |
|
31 | + public function onShow($jsCode) { |
|
32 | 32 | $this->params["onShow"]=$jsCode; |
33 | 33 | } |
34 | 34 | |
35 | - public function compile(){ |
|
36 | - if(JString::isNotNull($this->title)){ |
|
35 | + public function compile() { |
|
36 | + if (JString::isNotNull($this->title)) { |
|
37 | 37 | $this->semElement->addToProperty("data-title", $this->title); |
38 | 38 | } |
39 | - if(JString::isNotNull($this->content)){ |
|
39 | + if (JString::isNotNull($this->content)) { |
|
40 | 40 | $this->semElement->addToProperty("data-content", $this->content); |
41 | 41 | } |
42 | - if(JString::isNotNull($this->html)){ |
|
42 | + if (JString::isNotNull($this->html)) { |
|
43 | 43 | $this->semElement->addToProperty("data-html", $this->html); |
44 | 44 | } |
45 | - if(JString::isNotNull($this->variation)){ |
|
45 | + if (JString::isNotNull($this->variation)) { |
|
46 | 46 | $this->semElement->addToProperty("data-variation", $this->variation); |
47 | 47 | } |
48 | 48 | } |
49 | 49 | |
50 | - public function run(JsUtils $js){ |
|
51 | - $js->semantic()->popup("#".$this->semElement->getIdentifier(),$this->params); |
|
50 | + public function run(JsUtils $js) { |
|
51 | + $js->semantic()->popup("#".$this->semElement->getIdentifier(), $this->params); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | } |
55 | 55 | \ No newline at end of file |
@@ -10,30 +10,30 @@ discard block |
||
10 | 10 | |
11 | 11 | class HtmlDropdownItem extends HtmlSemDoubleElement { |
12 | 12 | |
13 | - public function __construct($identifier, $content="",$value=NULL,$image=NULL) { |
|
13 | + public function __construct($identifier, $content="", $value=NULL, $image=NULL) { |
|
14 | 14 | parent::__construct($identifier, "div"); |
15 | 15 | $this->setClass("item"); |
16 | 16 | $this->setContent($content); |
17 | - if($value!==NULL) |
|
17 | + if ($value!==NULL) |
|
18 | 18 | $this->setData($value); |
19 | - if($image!==NULL) |
|
19 | + if ($image!==NULL) |
|
20 | 20 | $this->asMiniAvatar($image); |
21 | 21 | } |
22 | 22 | |
23 | - public function setDescription($description){ |
|
24 | - $descO=new HtmlDoubleElement("desc-".$this->identifier,"span"); |
|
23 | + public function setDescription($description) { |
|
24 | + $descO=new HtmlDoubleElement("desc-".$this->identifier, "span"); |
|
25 | 25 | $descO->setClass("description"); |
26 | 26 | $descO->setContent($description); |
27 | - return $this->addContent($descO,true); |
|
27 | + return $this->addContent($descO, true); |
|
28 | 28 | } |
29 | 29 | |
30 | - public function setData($value){ |
|
30 | + public function setData($value) { |
|
31 | 31 | $this->setProperty("data-value", $value); |
32 | 32 | } |
33 | 33 | |
34 | - public function asOption(){ |
|
34 | + public function asOption() { |
|
35 | 35 | $this->tagName="option"; |
36 | - if($this->getProperty("data-value")!==null) |
|
36 | + if ($this->getProperty("data-value")!==null) |
|
37 | 37 | $this->setProperty("value", $this->getProperty("data-value")); |
38 | 38 | } |
39 | 39 | |
@@ -41,42 +41,42 @@ discard block |
||
41 | 41 | * @param string $image the image src |
42 | 42 | * @return \Ajax\common\html\html5\HtmlImg |
43 | 43 | */ |
44 | - public function asMiniAvatar($image){ |
|
44 | + public function asMiniAvatar($image) { |
|
45 | 45 | $this->tagName="div"; |
46 | - $img=new HtmlImg("image-".$this->identifier,$image); |
|
46 | + $img=new HtmlImg("image-".$this->identifier, $image); |
|
47 | 47 | $img->setClass("ui mini avatar image"); |
48 | - $this->addContent($img,true); |
|
48 | + $this->addContent($img, true); |
|
49 | 49 | return $img; |
50 | 50 | } |
51 | 51 | |
52 | - public function asSearchInput($placeholder=NULL,$icon=NULL){ |
|
52 | + public function asSearchInput($placeholder=NULL, $icon=NULL) { |
|
53 | 53 | $this->setClass("ui icon search input"); |
54 | 54 | $input=new HtmlInput("search-".$this->identifier); |
55 | - if(isset($placeholder)) |
|
55 | + if (isset($placeholder)) |
|
56 | 56 | $input->setProperty("placeholder", $placeholder); |
57 | 57 | $this->content=$input; |
58 | - if(isset($icon)) |
|
58 | + if (isset($icon)) |
|
59 | 59 | $this->addIcon($icon); |
60 | 60 | return $this; |
61 | 61 | } |
62 | 62 | |
63 | - public function setContent($content){ |
|
64 | - if($content==="-"){ |
|
63 | + public function setContent($content) { |
|
64 | + if ($content==="-") { |
|
65 | 65 | $this->asDivider(); |
66 | - }elseif($content==="-search-"){ |
|
67 | - $values=\explode(",",$content,-1); |
|
68 | - $this->asSearchInput(JArray::getDefaultValue($values, 0, "Search..."),JArray::getDefaultValue($values, 1, "search")); |
|
66 | + }elseif ($content==="-search-") { |
|
67 | + $values=\explode(",", $content, -1); |
|
68 | + $this->asSearchInput(JArray::getDefaultValue($values, 0, "Search..."), JArray::getDefaultValue($values, 1, "search")); |
|
69 | 69 | }else |
70 | 70 | parent::setContent($content); |
71 | 71 | return $this; |
72 | 72 | } |
73 | 73 | |
74 | - public function asDivider(){ |
|
74 | + public function asDivider() { |
|
75 | 75 | $this->content=NULL; |
76 | 76 | $this->setClass("divider"); |
77 | 77 | } |
78 | 78 | |
79 | - public static function searchInput($placeholder=NULL,$icon=NULL){ |
|
80 | - return (new HtmlDropdownItem(""))->asSearchInput($placeholder,$icon); |
|
79 | + public static function searchInput($placeholder=NULL, $icon=NULL) { |
|
80 | + return (new HtmlDropdownItem(""))->asSearchInput($placeholder, $icon); |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 | \ No newline at end of file |