@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | |
11 | 11 | class HtmlLabel extends HtmlSemDoubleElement { |
12 | 12 | use LabeledIconTrait; |
13 | - public function __construct($identifier,$caption="",$icon=NULL,$tagName="div") { |
|
14 | - parent::__construct($identifier,$tagName,"ui label"); |
|
13 | + public function __construct($identifier, $caption="", $icon=NULL, $tagName="div") { |
|
14 | + parent::__construct($identifier, $tagName, "ui label"); |
|
15 | 15 | $this->content=$caption; |
16 | - if(isset($icon)) |
|
16 | + if (isset($icon)) |
|
17 | 17 | $this->addIcon($icon); |
18 | 18 | } |
19 | 19 | |
@@ -21,33 +21,33 @@ discard block |
||
21 | 21 | * @param string $side |
22 | 22 | * @return \Ajax\semantic\html\elements\HtmlLabel |
23 | 23 | */ |
24 | - public function setPointing($value=Direction::NONE){ |
|
25 | - return $this->addToPropertyCtrl("class", $value." pointing",Direction::getConstantValues("pointing")); |
|
24 | + public function setPointing($value=Direction::NONE) { |
|
25 | + return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
29 | 29 | * @param string $side |
30 | 30 | * @return \Ajax\semantic\html\elements\HtmlLabel |
31 | 31 | */ |
32 | - public function toCorner($side="left"){ |
|
33 | - return $this->addToPropertyCtrl("class", $side." corner",array("right corner","left corner")); |
|
32 | + public function toCorner($side="left") { |
|
33 | + return $this->addToPropertyCtrl("class", $side." corner", array("right corner", "left corner")); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
37 | 37 | * @return \Ajax\semantic\html\elements\HtmlLabel |
38 | 38 | */ |
39 | - public function asTag(){ |
|
39 | + public function asTag() { |
|
40 | 40 | return $this->addToProperty("class", "tag"); |
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
44 | 44 | * @return \Ajax\semantic\html\elements\HtmlLabel |
45 | 45 | */ |
46 | - public function asLink(){ |
|
46 | + public function asLink() { |
|
47 | 47 | return $this->setTagName("a"); |
48 | 48 | } |
49 | 49 | |
50 | - public function setBasic(){ |
|
50 | + public function setBasic() { |
|
51 | 51 | return $this->addToProperty("class", "basic"); |
52 | 52 | } |
53 | 53 | |
@@ -58,28 +58,28 @@ discard block |
||
58 | 58 | * @param string $before |
59 | 59 | * @return \Ajax\semantic\html\elements\HtmlLabel |
60 | 60 | */ |
61 | - public function addImage($src,$alt="",$before=true){ |
|
61 | + public function addImage($src, $alt="", $before=true) { |
|
62 | 62 | $this->addToProperty("class", "image"); |
63 | - return $this->addContent(new HtmlImg("image-".$this->identifier,$src,$alt),$before); |
|
63 | + return $this->addContent(new HtmlImg("image-".$this->identifier, $src, $alt), $before); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
67 | 67 | * @param string $detail |
68 | 68 | * @return \Ajax\common\html\HtmlDoubleElement |
69 | 69 | */ |
70 | - public function addDetail($detail){ |
|
71 | - $div=new HtmlDoubleElement("detail-".$this->identifier,$this->tagName); |
|
70 | + public function addDetail($detail) { |
|
71 | + $div=new HtmlDoubleElement("detail-".$this->identifier, $this->tagName); |
|
72 | 72 | $div->setClass("detail"); |
73 | 73 | $div->setContent($detail); |
74 | 74 | $this->addContent($div); |
75 | 75 | return $div; |
76 | 76 | } |
77 | 77 | |
78 | - public function asRibbon(){ |
|
78 | + public function asRibbon() { |
|
79 | 79 | return $this->addToPropertyCtrl("class", "ribbon", array("ribbon")); |
80 | 80 | } |
81 | 81 | |
82 | - public static function ribbon($identifier,$caption){ |
|
83 | - return (new HtmlLabel($identifier,$caption))->asRibbon(); |
|
82 | + public static function ribbon($identifier, $caption) { |
|
83 | + return (new HtmlLabel($identifier, $caption))->asRibbon(); |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | \ No newline at end of file |
@@ -7,19 +7,19 @@ |
||
7 | 7 | use Phalcon\Mvc\View; |
8 | 8 | use Ajax\semantic\html\elements\HtmlIcon; |
9 | 9 | |
10 | -class HtmlPaginationMenu extends HtmlMenu{ |
|
10 | +class HtmlPaginationMenu extends HtmlMenu { |
|
11 | 11 | |
12 | - public function __construct( $identifier, $items=array() ){ |
|
13 | - parent::__construct( $identifier,$items); |
|
12 | + public function __construct($identifier, $items=array()) { |
|
13 | + parent::__construct($identifier, $items); |
|
14 | 14 | } |
15 | 15 | /** |
16 | 16 | * {@inheritDoc} |
17 | 17 | * @see \Ajax\common\html\BaseHtml::compile() |
18 | 18 | */ |
19 | - public function compile(JsUtils $js=NULL,View $view=NULL){ |
|
19 | + public function compile(JsUtils $js=NULL, View $view=NULL) { |
|
20 | 20 | $this->insertItem(new HtmlIcon("", "left chevron")); |
21 | 21 | $this->addItem(new HtmlIcon("", "right chevron")); |
22 | 22 | $this->asPagination(); |
23 | - return parent::compile($js,$view); |
|
23 | + return parent::compile($js, $view); |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 | \ No newline at end of file |
@@ -10,23 +10,23 @@ |
||
10 | 10 | * @param string $value |
11 | 11 | * @return \Ajax\semantic\html\base\HtmlSemDoubleElement |
12 | 12 | */ |
13 | - public function setTextAlignment($value=TextAlignment::LEFT){ |
|
14 | - return $this->addToPropertyCtrl("class", $value,TextAlignment::getConstants()); |
|
13 | + public function setTextAlignment($value=TextAlignment::LEFT) { |
|
14 | + return $this->addToPropertyCtrl("class", $value, TextAlignment::getConstants()); |
|
15 | 15 | } |
16 | 16 | |
17 | - public function textCenterAligned(){ |
|
17 | + public function textCenterAligned() { |
|
18 | 18 | return $this->setTextAlignment(TextAlignment::CENTER); |
19 | 19 | } |
20 | 20 | |
21 | - public function textJustified(){ |
|
21 | + public function textJustified() { |
|
22 | 22 | return $this->setTextAlignment(TextAlignment::JUSTIFIED); |
23 | 23 | } |
24 | 24 | |
25 | - public function textRightAligned(){ |
|
25 | + public function textRightAligned() { |
|
26 | 26 | return $this->setTextAlignment(TextAlignment::RIGHT); |
27 | 27 | } |
28 | 28 | |
29 | - public function textLeftAligned(){ |
|
29 | + public function textLeftAligned() { |
|
30 | 30 | return $this->setTextAlignment(); |
31 | 31 | } |
32 | 32 | } |
33 | 33 | \ No newline at end of file |
@@ -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 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | * @param int $rowCount |
14 | 14 | * @param int $colCount |
15 | 15 | */ |
16 | - public function htmlTable($identifier, $rowCount, $colCount){ |
|
16 | + public function htmlTable($identifier, $rowCount, $colCount) { |
|
17 | 17 | return $this->addHtmlComponent(new HtmlTable($identifier, $rowCount, $colCount)); |
18 | 18 | } |
19 | 19 | } |
20 | 20 | \ No newline at end of file |
@@ -15,7 +15,7 @@ |
||
15 | 15 | class HtmlFormCheckbox extends HtmlFormField { |
16 | 16 | use CheckboxTrait; |
17 | 17 | public function __construct($identifier, $label=NULL, $value=NULL, $type=NULL) { |
18 | - parent::__construct("field-".$identifier, new HtmlCheckbox($identifier,$label,$value,$type)); |
|
18 | + parent::__construct("field-".$identifier, new HtmlCheckbox($identifier, $label, $value, $type)); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | public static function slider($identifier, $label="", $value=NULL) { |
@@ -29,13 +29,13 @@ discard block |
||
29 | 29 | if (\is_string($end)) { |
30 | 30 | $label=$end; |
31 | 31 | \array_pop($fields); |
32 | - } else |
|
32 | + }else |
|
33 | 33 | $label=NULL; |
34 | 34 | } |
35 | 35 | } |
36 | 36 | if (isset($label)) |
37 | 37 | $this->setLabel($label); |
38 | - foreach ( $fields as $field ) { |
|
38 | + foreach ($fields as $field) { |
|
39 | 39 | $this->addItem($field); |
40 | 40 | } |
41 | 41 | return $this; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | if ($this->_equalWidth) { |
66 | 66 | $count=$this->count(); |
67 | 67 | $this->addToProperty("class", Wide::getConstants()["W".$count]." fields"); |
68 | - } else |
|
68 | + }else |
|
69 | 69 | $this->addToProperty("class", "fields"); |
70 | 70 | return parent::compile($js, $view); |
71 | 71 | } |
@@ -96,9 +96,9 @@ discard block |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | public static function radios($name, $items=array(), $label=NULL, $value=null, $type=NULL) { |
99 | - $fields=array (); |
|
99 | + $fields=array(); |
|
100 | 100 | $i=0; |
101 | - foreach ( $items as $val => $caption ) { |
|
101 | + foreach ($items as $val => $caption) { |
|
102 | 102 | $itemO=new HtmlFormRadio($name."-".$i++, $name, $caption, $val, $type); |
103 | 103 | if ($val===$value) { |
104 | 104 | $itemO->getField()->getField()->setProperty("checked", ""); |
@@ -112,9 +112,9 @@ discard block |
||
112 | 112 | } |
113 | 113 | |
114 | 114 | public static function checkeds($name, $items=array(), $label=NULL, $values=array(), $type=NULL) { |
115 | - $fields=array (); |
|
115 | + $fields=array(); |
|
116 | 116 | $i=0; |
117 | - foreach ( $items as $val => $caption ) { |
|
117 | + foreach ($items as $val => $caption) { |
|
118 | 118 | $itemO=new HtmlFormCheckbox($name."-".$i++, $name, $caption, $val, $type); |
119 | 119 | if (\array_search($val, $values)!==false) { |
120 | 120 | $itemO->getField()->getField()->setProperty("checked", ""); |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | use Ajax\semantic\html\base\constants\CheckboxType; |
7 | 7 | |
8 | 8 | abstract class AbstractCheckbox extends HtmlSemDoubleElement { |
9 | - protected $_params=array (); |
|
9 | + protected $_params=array(); |
|
10 | 10 | |
11 | 11 | public function __construct($identifier, $name=NULL, $label=NULL, $value=NULL, $inputType="checkbox", $type="checkbox") { |
12 | 12 | parent::__construct("ck-".$identifier, "div", "ui ".$type); |
@@ -73,9 +73,9 @@ discard block |
||
73 | 73 | * @return \Ajax\semantic\html\collections\form\AbstractHtmlFormRadioCheckbox |
74 | 74 | */ |
75 | 75 | public function attachEvent($selector, $action=NULL) { |
76 | - if (isset($action)!==false||\is_numeric($action)===true) { |
|
76 | + if (isset($action)!==false || \is_numeric($action)===true) { |
|
77 | 77 | $js='$("#%identifier%").checkbox("attach events", "'.$selector.'", "'.$action.'");'; |
78 | - } else { |
|
78 | + }else { |
|
79 | 79 | $js='$("#%identifier%").checkbox("attach events", "'.$selector.'");'; |
80 | 80 | } |
81 | 81 | $js=\str_replace("%identifier%", $this->identifier, $js); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function attachEvents($events=array()) { |
91 | 91 | if (\is_array($events)) { |
92 | - foreach ( $events as $action => $selector ) { |
|
92 | + foreach ($events as $action => $selector) { |
|
93 | 93 | $this->attachEvent($selector, $action); |
94 | 94 | } |
95 | 95 | } |
@@ -34,12 +34,12 @@ discard block |
||
34 | 34 | * @return \Ajax\semantic\html\collections\HtmlMenu |
35 | 35 | */ |
36 | 36 | public function setType($type="") { |
37 | - return $this->addToPropertyCtrl("class", $type, array ("","item","text" )); |
|
37 | + return $this->addToPropertyCtrl("class", $type, array("", "item", "text")); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | public function setActiveItem($index) { |
41 | 41 | $item=$this->getItem($index); |
42 | - if ($item !== null) { |
|
42 | + if ($item!==null) { |
|
43 | 43 | $item->addToProperty("class", "active"); |
44 | 44 | } |
45 | 45 | return $this; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | private function getItemToInsert($item) { |
49 | 49 | if ($item instanceof HtmlInput || $item instanceof HtmlImg || $item instanceof HtmlIcon) { |
50 | - $itemO=new HtmlSemDoubleElement("item-" . $this->identifier, "div", ""); |
|
50 | + $itemO=new HtmlSemDoubleElement("item-".$this->identifier, "div", ""); |
|
51 | 51 | $itemO->setContent($item); |
52 | 52 | $item=$itemO; |
53 | 53 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | private function afterInsert($item) { |
58 | 58 | if (!$item instanceof HtmlMenu) |
59 | - $item->addToPropertyCtrl("class", "item", array ("item" )); |
|
59 | + $item->addToPropertyCtrl("class", "item", array("item")); |
|
60 | 60 | else { |
61 | 61 | $this->setSecondary(); |
62 | 62 | } |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | |
88 | 88 | public function generateMenuAsItem($menu, $header=null) { |
89 | 89 | $count=$this->count(); |
90 | - $item=new HtmlSemDoubleElement("item-" . $this->identifier . "-" . $count, "div"); |
|
90 | + $item=new HtmlSemDoubleElement("item-".$this->identifier."-".$count, "div"); |
|
91 | 91 | if (isset($header)) { |
92 | - $headerItem=new HtmlSemDoubleElement("item-header-" . $this->identifier . "-" . $count, "div", "header"); |
|
92 | + $headerItem=new HtmlSemDoubleElement("item-header-".$this->identifier."-".$count, "div", "header"); |
|
93 | 93 | $headerItem->setContent($header); |
94 | 94 | $item->addContent($headerItem); |
95 | 95 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $value=new HtmlSemDoubleElement($identifier, "a", "browse item", $value); |
107 | 107 | $value->addContent(new HtmlIcon("", "dropdown")); |
108 | 108 | $value=$this->addItem($value); |
109 | - $popup=new HtmlPopup($value, "popup-" . $this->identifier . "-" . $this->count(), $content); |
|
109 | + $popup=new HtmlPopup($value, "popup-".$this->identifier."-".$this->count(), $content); |
|
110 | 110 | $popup->setFlowing()->setPosition("bottom left")->setOn("click"); |
111 | 111 | $this->wrap("", $popup); |
112 | 112 | return $popup; |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | public function addDropdownAsItem($value, $items=NULL) { |
116 | 116 | $dd=$value; |
117 | 117 | if (\is_string($value)) { |
118 | - $dd=new HtmlDropdown("dropdown-" . $this->identifier . "-" . $this->count(), $value, $items); |
|
118 | + $dd=new HtmlDropdown("dropdown-".$this->identifier."-".$this->count(), $value, $items); |
|
119 | 119 | } |
120 | 120 | return $this->addItem($dd); |
121 | 121 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | * @see \Ajax\common\html\html5\HtmlCollection::createItem() |
128 | 128 | */ |
129 | 129 | protected function createItem($value) { |
130 | - $itemO=new HtmlLink("item-" . \sizeof($this->content), "", $value); |
|
130 | + $itemO=new HtmlLink("item-".\sizeof($this->content), "", $value); |
|
131 | 131 | return $itemO->setClass("item"); |
132 | 132 | } |
133 | 133 | |
@@ -140,28 +140,28 @@ discard block |
||
140 | 140 | } |
141 | 141 | |
142 | 142 | public function setVertical() { |
143 | - return $this->addToPropertyCtrl("class", "vertical", array ("vertical" )); |
|
143 | + return $this->addToPropertyCtrl("class", "vertical", array("vertical")); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | public function setPosition($value="right") { |
147 | - return $this->addToPropertyCtrl("class", $value, array ("right","left" )); |
|
147 | + return $this->addToPropertyCtrl("class", $value, array("right", "left")); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | public function setPointing($value=Direction::NONE) { |
151 | - return $this->addToPropertyCtrl("class", $value . " pointing", Direction::getConstantValues("pointing")); |
|
151 | + return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | public function asTab($vertical=false) { |
155 | - $this->apply(function (HtmlDoubleElement &$item) { |
|
155 | + $this->apply(function(HtmlDoubleElement & $item) { |
|
156 | 156 | $item->setTagName("a"); |
157 | 157 | }); |
158 | - if ($vertical === true) |
|
158 | + if ($vertical===true) |
|
159 | 159 | $this->setVertical(); |
160 | 160 | return $this->addToProperty("class", "tabular"); |
161 | 161 | } |
162 | 162 | |
163 | 163 | public function asPagination() { |
164 | - $this->apply(function (HtmlDoubleElement &$item) { |
|
164 | + $this->apply(function(HtmlDoubleElement & $item) { |
|
165 | 165 | $item->setTagName("a"); |
166 | 166 | }); |
167 | 167 | return $this->addToProperty("class", "pagination"); |
@@ -198,10 +198,10 @@ discard block |
||
198 | 198 | */ |
199 | 199 | public function setWidth($width) { |
200 | 200 | if (\is_int($width)) { |
201 | - $width=Wide::getConstants()["W" . $width]; |
|
201 | + $width=Wide::getConstants()["W".$width]; |
|
202 | 202 | } |
203 | 203 | $this->addToPropertyCtrl("class", $width, Wide::getConstants()); |
204 | - return $this->addToPropertyCtrl("class", "item", array ("item" )); |
|
204 | + return $this->addToPropertyCtrl("class", "item", array("item")); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | public function addImage($identifier, $src="", $alt="") { |