@@ -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 | } |
@@ -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 |
@@ -26,8 +26,9 @@ discard block |
||
26 | 26 | public function asIcon($icon, $title, $subHeader=NULL) { |
27 | 27 | $header=new HtmlHeader("header-" . $this->identifier); |
28 | 28 | $header->asIcon($icon, $title, $subHeader); |
29 | - if ($this->_inverted === false) |
|
30 | - $header->setInverted(); |
|
29 | + if ($this->_inverted === false) { |
|
30 | + $header->setInverted(); |
|
31 | + } |
|
31 | 32 | return $this->setContent($header); |
32 | 33 | } |
33 | 34 | |
@@ -42,14 +43,16 @@ discard block |
||
42 | 43 | } |
43 | 44 | |
44 | 45 | public function run(JsUtils $js) { |
45 | - if ($this->_container instanceof HtmlSingleElement) |
|
46 | - $this->_bsComponent=$js->semantic()->dimmer("#" . $this->_container->getIdentifier(), $this->_params); |
|
46 | + if ($this->_container instanceof HtmlSingleElement) { |
|
47 | + $this->_bsComponent=$js->semantic()->dimmer("#" . $this->_container->getIdentifier(), $this->_params); |
|
48 | + } |
|
47 | 49 | return parent::run($js); |
48 | 50 | } |
49 | 51 | |
50 | 52 | public function jsShow() { |
51 | - if (isset($this->_container) === true) |
|
52 | - return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");'; |
|
53 | + if (isset($this->_container) === true) { |
|
54 | + return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");'; |
|
55 | + } |
|
53 | 56 | } |
54 | 57 | |
55 | 58 | public function setBlurring() { |
@@ -18,14 +18,14 @@ discard block |
||
18 | 18 | } |
19 | 19 | |
20 | 20 | public function setContent($content) { |
21 | - $this->content=new HtmlSemDoubleElement("content-" . $this->identifier, "div", "content", new HtmlSemDoubleElement("", "div", "center", $content)); |
|
21 | + $this->content=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content", new HtmlSemDoubleElement("", "div", "center", $content)); |
|
22 | 22 | return $this; |
23 | 23 | } |
24 | 24 | |
25 | 25 | public function asIcon($icon, $title, $subHeader=NULL) { |
26 | - $header=new HtmlHeader("header-" . $this->identifier); |
|
26 | + $header=new HtmlHeader("header-".$this->identifier); |
|
27 | 27 | $header->asIcon($icon, $title, $subHeader); |
28 | - if ($this->_inverted === false) |
|
28 | + if ($this->_inverted===false) |
|
29 | 29 | $header->setInverted(); |
30 | 30 | return $this->setContent($header); |
31 | 31 | } |
@@ -42,13 +42,13 @@ discard block |
||
42 | 42 | |
43 | 43 | public function run(JsUtils $js) { |
44 | 44 | if ($this->_container instanceof HtmlSingleElement) |
45 | - $this->_bsComponent=$js->semantic()->dimmer("#" . $this->_container->getIdentifier(), $this->_params); |
|
45 | + $this->_bsComponent=$js->semantic()->dimmer("#".$this->_container->getIdentifier(), $this->_params); |
|
46 | 46 | return parent::run($js); |
47 | 47 | } |
48 | 48 | |
49 | 49 | public function jsShow() { |
50 | - if (isset($this->_container) === true) |
|
51 | - return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");'; |
|
50 | + if (isset($this->_container)===true) |
|
51 | + return '$("#.'.$this->_container->getIdentifier().').dimmer("show");'; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | public function setBlurring() { |
@@ -8,13 +8,13 @@ discard block |
||
8 | 8 | class HtmlSticky extends HtmlSemDoubleElement { |
9 | 9 | private $_params=array(); |
10 | 10 | |
11 | - public function __construct($identifier,$context=NULL,$content=NULL) { |
|
11 | + public function __construct($identifier, $context=NULL, $content=NULL) { |
|
12 | 12 | parent::__construct($identifier, "div", "ui sticky", $content); |
13 | - if(isset($content)) |
|
13 | + if (isset($content)) |
|
14 | 14 | $this->setContext($context); |
15 | 15 | } |
16 | 16 | |
17 | - public function setContext($context){ |
|
17 | + public function setContext($context) { |
|
18 | 18 | $this->_params["context"]=$context; |
19 | 19 | return $this; |
20 | 20 | } |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | * {@inheritDoc} |
24 | 24 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run() |
25 | 25 | */ |
26 | - public function run(JsUtils $js){ |
|
26 | + public function run(JsUtils $js) { |
|
27 | 27 | parent::run($js); |
28 | - return $js->semantic()->sticky("#".$this->identifier,$this->_params); |
|
28 | + return $js->semantic()->sticky("#".$this->identifier, $this->_params); |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 | \ No newline at end of file |
@@ -10,8 +10,9 @@ |
||
10 | 10 | |
11 | 11 | public function __construct($identifier,$context=NULL,$content=NULL) { |
12 | 12 | parent::__construct($identifier, "div", "ui sticky", $content); |
13 | - if(isset($content)) |
|
14 | - $this->setContext($context); |
|
13 | + if(isset($content)) { |
|
14 | + $this->setContext($context); |
|
15 | + } |
|
15 | 16 | } |
16 | 17 | |
17 | 18 | public function setContext($context){ |
@@ -22,10 +22,12 @@ |
||
22 | 22 | |
23 | 23 | private function createField($placeholder=NULL, $icon=NULL) { |
24 | 24 | $field=new HtmlInput($this->identifier); |
25 | - if (isset($placeholder) === true) |
|
26 | - $field->setPlaceholder($placeholder); |
|
27 | - if (isset($icon) === true) |
|
28 | - $field->addIcon($icon, Direction::RIGHT); |
|
25 | + if (isset($placeholder) === true) { |
|
26 | + $field->setPlaceholder($placeholder); |
|
27 | + } |
|
28 | + if (isset($icon) === true) { |
|
29 | + $field->addIcon($icon, Direction::RIGHT); |
|
30 | + } |
|
29 | 31 | $field->getField()->setClass("prompt"); |
30 | 32 | $this->content["field"]=$field; |
31 | 33 | return $field; |
@@ -8,12 +8,12 @@ discard block |
||
8 | 8 | use Ajax\semantic\html\base\constants\Direction; |
9 | 9 | |
10 | 10 | class HtmlSearch extends HtmlSemDoubleElement { |
11 | - private $_elements=array (); |
|
12 | - private $_searchFields=array ("title" ); |
|
11 | + private $_elements=array(); |
|
12 | + private $_searchFields=array("title"); |
|
13 | 13 | private $_local=false; |
14 | 14 | |
15 | 15 | public function __construct($identifier, $placeholder=NULL, $icon=NULL) { |
16 | - parent::__construct("search-" . $identifier, "div", "ui search", array ()); |
|
16 | + parent::__construct("search-".$identifier, "div", "ui search", array()); |
|
17 | 17 | $this->createField($placeholder, $icon); |
18 | 18 | $this->createResult(); |
19 | 19 | $this->_params["type"]="standard"; |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | |
22 | 22 | private function createField($placeholder=NULL, $icon=NULL) { |
23 | 23 | $field=new HtmlInput($this->identifier); |
24 | - if (isset($placeholder) === true) |
|
24 | + if (isset($placeholder)===true) |
|
25 | 25 | $field->setPlaceholder($placeholder); |
26 | - if (isset($icon) === true) |
|
26 | + if (isset($icon)===true) |
|
27 | 27 | $field->addIcon($icon, Direction::RIGHT); |
28 | 28 | $field->getField()->setClass("prompt"); |
29 | 29 | $this->content["field"]=$field; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | } |
32 | 32 | |
33 | 33 | private function createResult() { |
34 | - $this->content["result"]=new HtmlSemDoubleElement("results-" . $this->identifier, "div", "results"); |
|
34 | + $this->content["result"]=new HtmlSemDoubleElement("results-".$this->identifier, "div", "results"); |
|
35 | 35 | return $this->content["result"]; |
36 | 36 | } |
37 | 37 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | public function setUrl($url) { |
51 | - $this->_params["apiSettings"]="%{url: %quote%" . $url . "%quote%}%"; |
|
51 | + $this->_params["apiSettings"]="%{url: %quote%".$url."%quote%}%"; |
|
52 | 52 | return $this; |
53 | 53 | } |
54 | 54 | |
@@ -71,16 +71,16 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | public function run(JsUtils $js) { |
74 | - $this->_params["onSelect"]='%function(result,response){$(%quote%#' . $this->identifier . '%quote%).trigger(%quote%onSelect%quote%, {%quote%result%quote%: result, %quote%response%quote%:response} );}%'; |
|
74 | + $this->_params["onSelect"]='%function(result,response){$(%quote%#'.$this->identifier.'%quote%).trigger(%quote%onSelect%quote%, {%quote%result%quote%: result, %quote%response%quote%:response} );}%'; |
|
75 | 75 | $searchFields=\json_encode($this->_searchFields); |
76 | 76 | $searchFields=str_ireplace("\"", "%quote%", $searchFields); |
77 | - $this->_params["searchFields"]="%" . $searchFields . "%"; |
|
78 | - if ($this->_local === true) { |
|
77 | + $this->_params["searchFields"]="%".$searchFields."%"; |
|
78 | + if ($this->_local===true) { |
|
79 | 79 | $this->_params["source"]="%content%"; |
80 | - $this->addEvent("beforeExecute", "var content=" . $this->resultsToJson() . ";"); |
|
80 | + $this->addEvent("beforeExecute", "var content=".$this->resultsToJson().";"); |
|
81 | 81 | } |
82 | - if (isset($this->_bsComponent) === false) { |
|
83 | - $this->_bsComponent=$js->semantic()->search("#" . $this->identifier, $this->_params); |
|
82 | + if (isset($this->_bsComponent)===false) { |
|
83 | + $this->_bsComponent=$js->semantic()->search("#".$this->identifier, $this->_params); |
|
84 | 84 | } |
85 | 85 | $this->addEventsOnRun($js); |
86 | 86 | return $this->_bsComponent; |