@@ -5,5 +5,5 @@ |
||
5 | 5 | use Ajax\common\BaseEnum; |
6 | 6 | |
7 | 7 | class VerticalAlignment extends BaseEnum { |
8 | - const TOP="top",MIDDLE="middle",BOTTOM="bottom"; |
|
8 | + const TOP="top", MIDDLE="middle", BOTTOM="bottom"; |
|
9 | 9 | } |
10 | 10 | \ No newline at end of file |
@@ -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 | } |
@@ -9,26 +9,26 @@ discard block |
||
9 | 9 | use Ajax\semantic\html\base\constants\State; |
10 | 10 | |
11 | 11 | class HtmlProgress extends HtmlSemDoubleElement { |
12 | - private $_params=array (); |
|
12 | + private $_params=array(); |
|
13 | 13 | |
14 | 14 | public function __construct($identifier, $value=NULL, $label=NULL, $attributes=array()) { |
15 | 15 | parent::__construct($identifier, "div", "ui progress"); |
16 | - if (isset($value) === true) |
|
16 | + if (isset($value)===true) |
|
17 | 17 | $this->setProperty("data-percent", $value); |
18 | 18 | $this->createBar(); |
19 | - if (isset($label) === true) |
|
19 | + if (isset($label)===true) |
|
20 | 20 | $this->setLabel($label); |
21 | - $this->_states=[ State::SUCCESS,State::WARNING,State::ERROR,State::ACTIVE,State::DISABLED ]; |
|
21 | + $this->_states=[State::SUCCESS, State::WARNING, State::ERROR, State::ACTIVE, State::DISABLED]; |
|
22 | 22 | $this->addToProperty("class", $attributes); |
23 | 23 | } |
24 | 24 | |
25 | 25 | public function setLabel($label) { |
26 | - $this->content["label"]=new HtmlSemDoubleElement("lbl-" . $this->identifier, "div", "label", $label); |
|
26 | + $this->content["label"]=new HtmlSemDoubleElement("lbl-".$this->identifier, "div", "label", $label); |
|
27 | 27 | return $this; |
28 | 28 | } |
29 | 29 | |
30 | 30 | private function createBar() { |
31 | - $bar=new HtmlSemDoubleElement("bar-" . $this->identifier, "div", "bar", new HtmlSemDoubleElement("progress-" . $this->identifier, "div", "progress")); |
|
31 | + $bar=new HtmlSemDoubleElement("bar-".$this->identifier, "div", "bar", new HtmlSemDoubleElement("progress-".$this->identifier, "div", "progress")); |
|
32 | 32 | $this->content["bar"]=$bar; |
33 | 33 | return $this; |
34 | 34 | } |
@@ -68,20 +68,20 @@ discard block |
||
68 | 68 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() |
69 | 69 | */ |
70 | 70 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
71 | - $this->content=JArray::sortAssociative($this->content, [ "bar","label" ]); |
|
71 | + $this->content=JArray::sortAssociative($this->content, ["bar", "label"]); |
|
72 | 72 | return parent::compile($js, $view); |
73 | 73 | } |
74 | 74 | |
75 | 75 | public function jsSetValue($value) { |
76 | - return '$("#' . $this->identifier . '").progress({value:' . $value . '});'; |
|
76 | + return '$("#'.$this->identifier.'").progress({value:'.$value.'});'; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | public function jsIncValue() { |
80 | - return '$("#' . $this->identifier . '").progress("increment");'; |
|
80 | + return '$("#'.$this->identifier.'").progress("increment");'; |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | public function jsDecValue() { |
84 | - return '$("#' . $this->identifier . '").progress("decrement");'; |
|
84 | + return '$("#'.$this->identifier.'").progress("decrement");'; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @return HtmlProgress |
96 | 96 | */ |
97 | 97 | public function setTextValues($active=false, $error=false, $success=false, $warning=false, $percent="{percent}%", $ratio="{value} of {total}") { |
98 | - if (\is_array($active) == true) { |
|
98 | + if (\is_array($active)==true) { |
|
99 | 99 | $array=$active; |
100 | 100 | $active=JArray::getDefaultValue($array, "active", false); |
101 | 101 | $success=JArray::getDefaultValue($array, "success", $success); |
@@ -103,12 +103,12 @@ discard block |
||
103 | 103 | $percent=JArray::getDefaultValue($array, "percent", $percent); |
104 | 104 | $ratio=JArray::getDefaultValue($array, "ratio", $ratio); |
105 | 105 | } |
106 | - $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) . "}%"; |
|
106 | + $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)."}%"; |
|
107 | 107 | return $this; |
108 | 108 | } |
109 | 109 | |
110 | 110 | public function onChange($jsCode) { |
111 | - return $this->_params["onChange"]="%function(percent, value, total){" . $jsCode . "}%"; |
|
111 | + return $this->_params["onChange"]="%function(percent, value, total){".$jsCode."}%"; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /* |
@@ -116,8 +116,8 @@ discard block |
||
116 | 116 | * @see BaseHtml::run() |
117 | 117 | */ |
118 | 118 | public function run(JsUtils $js) { |
119 | - if (isset($this->_bsComponent) === false) |
|
120 | - $this->_bsComponent=$js->semantic()->progress("#" . $this->identifier, $this->_params); |
|
119 | + if (isset($this->_bsComponent)===false) |
|
120 | + $this->_bsComponent=$js->semantic()->progress("#".$this->identifier, $this->_params); |
|
121 | 121 | $this->addEventsOnRun($js); |
122 | 122 | return $this->_bsComponent; |
123 | 123 | } |