@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | -return array ( |
|
3 | - "JQuery" => array ( |
|
4 | - "MaxCDN" => array ( |
|
2 | +return array( |
|
3 | + "JQuery" => array( |
|
4 | + "MaxCDN" => array( |
|
5 | 5 | "url" => "http://code.jquery.com/jquery-%version%.min.js", |
6 | - "versions" => array ( |
|
6 | + "versions" => array( |
|
7 | 7 | "2.2.3", |
8 | 8 | "2.2.1", |
9 | 9 | "2.1.4", |
@@ -11,9 +11,9 @@ discard block |
||
11 | 11 | "1.11.2" |
12 | 12 | ) |
13 | 13 | ), |
14 | - "Google" => array ( |
|
14 | + "Google" => array( |
|
15 | 15 | "url" => "https://ajax.googleapis.com/ajax/libs/jquery/%version%/jquery.min.js", |
16 | - "versions" => array ( |
|
16 | + "versions" => array( |
|
17 | 17 | "2.2.2", |
18 | 18 | "2.2.1", |
19 | 19 | "2.2.0", |
@@ -25,17 +25,17 @@ discard block |
||
25 | 25 | ) |
26 | 26 | ) |
27 | 27 | ), |
28 | - "JQueryUI" => array ( |
|
29 | - "MaxCDN" => array ( |
|
28 | + "JQueryUI" => array( |
|
29 | + "MaxCDN" => array( |
|
30 | 30 | "core" => "http://code.jquery.com/ui/%version%/jquery-ui.min.js", |
31 | 31 | "css" => "http://code.jquery.com/ui/%version%/themes/%theme%/jquery-ui.css", |
32 | - "versions" => array ( |
|
32 | + "versions" => array( |
|
33 | 33 | "1.11.4", |
34 | 34 | "1.11.3", |
35 | 35 | "1.11.2", |
36 | 36 | "1.10.4" |
37 | 37 | ), |
38 | - "themes" => array ( |
|
38 | + "themes" => array( |
|
39 | 39 | "black-tie", |
40 | 40 | "blitzer", |
41 | 41 | "cupertino", |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | "vader" |
63 | 63 | ) |
64 | 64 | ), |
65 | - "Google" => array ( |
|
65 | + "Google" => array( |
|
66 | 66 | "core" => "https://ajax.googleapis.com/ajax/libs/jqueryui/%version%/jquery-ui.min.js", |
67 | 67 | "css" => "https://ajax.googleapis.com/ajax/libs/jqueryui/%version%/themes/%theme%/jquery-ui.css", |
68 | - "versions" => array ( |
|
68 | + "versions" => array( |
|
69 | 69 | "1.11.4", |
70 | 70 | "1.11.3", |
71 | 71 | "1.11.2", |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | "1.10.4", |
75 | 75 | "1.10.0" |
76 | 76 | ), |
77 | - "themes" => array ( |
|
77 | + "themes" => array( |
|
78 | 78 | "black-tie", |
79 | 79 | "blitzer", |
80 | 80 | "cupertino", |
@@ -102,25 +102,25 @@ discard block |
||
102 | 102 | ) |
103 | 103 | ) |
104 | 104 | ), |
105 | - "Bootstrap" => array ( |
|
106 | - "MaxCDN" => array ( |
|
105 | + "Bootstrap" => array( |
|
106 | + "MaxCDN" => array( |
|
107 | 107 | "core" => "http://maxcdn.bootstrapcdn.com/bootstrap/%version%/js/bootstrap.min.js", |
108 | 108 | "css" => "http://maxcdn.bootstrapcdn.com/bootstrap/%version%/css/bootstrap.min.css", |
109 | - "versions" => array ( |
|
109 | + "versions" => array( |
|
110 | 110 | "3.3.6", |
111 | 111 | "3.3.5" |
112 | 112 | ), |
113 | - "themes" => array () |
|
113 | + "themes" => array() |
|
114 | 114 | ) |
115 | 115 | ), |
116 | - "Semantic" => array ( |
|
117 | - "cdnjs" => array ( |
|
116 | + "Semantic" => array( |
|
117 | + "cdnjs" => array( |
|
118 | 118 | "core" => "https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/%version%/semantic.min.js", |
119 | 119 | "css" => "https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/%version%/semantic.min.css", |
120 | - "versions" => array ( |
|
120 | + "versions" => array( |
|
121 | 121 | "2.1.8" |
122 | 122 | ), |
123 | - "themes" => array () |
|
123 | + "themes" => array() |
|
124 | 124 | ) |
125 | 125 | ) |
126 | 126 | ); |
127 | 127 | \ No newline at end of file |
@@ -9,7 +9,7 @@ |
||
9 | 9 | protected $localCss; |
10 | 10 | protected $framework; |
11 | 11 | |
12 | - public function __construct($framework,$version, $provider="MaxCDN") { |
|
12 | + public function __construct($framework, $version, $provider="MaxCDN") { |
|
13 | 13 | parent::__construct($version, $provider); |
14 | 14 | $this->framework=$framework; |
15 | 15 | $this->data=$this->data [$framework]; |
@@ -60,10 +60,10 @@ |
||
60 | 60 | |
61 | 61 | protected function replaceVersionAndTheme($url, $version, $theme) { |
62 | 62 | if (isset($theme)) |
63 | - return str_ireplace(array ( |
|
63 | + return str_ireplace(array( |
|
64 | 64 | "%theme%", |
65 | 65 | "%version%" |
66 | - ), array ( |
|
66 | + ), array( |
|
67 | 67 | $theme, |
68 | 68 | $version |
69 | 69 | ), $url); |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | private $default; |
14 | 14 | private $options; |
15 | 15 | |
16 | - public function __construct($identifier, $caption="",$default=NULL) { |
|
16 | + public function __construct($identifier, $caption="", $default=NULL) { |
|
17 | 17 | parent::__construct($identifier, "select"); |
18 | 18 | $this->setProperty("name", $identifier); |
19 | 19 | $this->setProperty("class", "form-control"); |
@@ -22,21 +22,21 @@ discard block |
||
22 | 22 | $this->options=array(); |
23 | 23 | } |
24 | 24 | |
25 | - public function addOption($element,$value="",$selected=false){ |
|
26 | - if($element instanceof HtmlOption){ |
|
25 | + public function addOption($element, $value="", $selected=false) { |
|
26 | + if ($element instanceof HtmlOption) { |
|
27 | 27 | $option=$element; |
28 | - }else{ |
|
29 | - $option=new HtmlOption($this->identifier."-".count($this->options), $element,$value); |
|
28 | + } else { |
|
29 | + $option=new HtmlOption($this->identifier."-".count($this->options), $element, $value); |
|
30 | 30 | } |
31 | - if($selected || $option->getValue()==$this->getProperty("value")){ |
|
31 | + if ($selected || $option->getValue()==$this->getProperty("value")) { |
|
32 | 32 | $option->select(); |
33 | 33 | } |
34 | 34 | $this->options[]=$option; |
35 | 35 | } |
36 | 36 | |
37 | 37 | public function setValue($value) { |
38 | - foreach ( $this->options as $option ) { |
|
39 | - if (strcasecmp($option->getValue(),$value)===0) { |
|
38 | + foreach ($this->options as $option) { |
|
39 | + if (strcasecmp($option->getValue(), $value)===0) { |
|
40 | 40 | $option->setProperty("selected", ""); |
41 | 41 | } |
42 | 42 | } |
@@ -49,23 +49,23 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
51 | 51 | $this->content=array(); |
52 | - if(isset($this->default)){ |
|
52 | + if (isset($this->default)) { |
|
53 | 53 | $default=new HtmlOption("", $this->default); |
54 | 54 | $this->content[]=$default; |
55 | 55 | } |
56 | - foreach ($this->options as $option){ |
|
56 | + foreach ($this->options as $option) { |
|
57 | 57 | $this->content[]=$option; |
58 | 58 | } |
59 | 59 | return parent::compile($js, $view); |
60 | 60 | } |
61 | 61 | |
62 | - public function fromArray($array){ |
|
63 | - if(JArray::isAssociative($array)){ |
|
64 | - foreach ($array as $k=>$v){ |
|
62 | + public function fromArray($array) { |
|
63 | + if (JArray::isAssociative($array)) { |
|
64 | + foreach ($array as $k=>$v) { |
|
65 | 65 | $this->addOption($v, $k); |
66 | 66 | } |
67 | - }else{ |
|
68 | - foreach ($array as $v){ |
|
67 | + } else { |
|
68 | + foreach ($array as $v) { |
|
69 | 69 | $this->addOption($v, $v); |
70 | 70 | } |
71 | 71 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $this->addOption($function($object)); |
99 | 99 | } |
100 | 100 | |
101 | - public function setSize($size){ |
|
101 | + public function setSize($size) { |
|
102 | 102 | return $this->setProperty("size", $size); |
103 | 103 | } |
104 | 104 | } |
@@ -5,13 +5,13 @@ |
||
5 | 5 | |
6 | 6 | class HtmlShapeItem extends HtmlSemDoubleElement { |
7 | 7 | public function __construct($identifier, $content) { |
8 | - parent::__construct($identifier,"div","side",$content); |
|
8 | + parent::__construct($identifier, "div", "side", $content); |
|
9 | 9 | } |
10 | 10 | |
11 | - public function setActive($value=true){ |
|
12 | - if($value){ |
|
11 | + public function setActive($value=true) { |
|
12 | + if ($value) { |
|
13 | 13 | $this->addToPropertyCtrl("class", "active", ["active"]); |
14 | - }else{ |
|
14 | + } else { |
|
15 | 15 | $this->removePropertyValue("class", "active"); |
16 | 16 | } |
17 | 17 | return $this; |
@@ -6,19 +6,19 @@ |
||
6 | 6 | |
7 | 7 | abstract public function getDataField(); |
8 | 8 | abstract public function addToProperty($name, $value, $separator=" "); |
9 | - public function setPlaceholder($value){ |
|
9 | + public function setPlaceholder($value) { |
|
10 | 10 | $this->getDataField()->setPlaceholder($value); |
11 | 11 | return $this; |
12 | 12 | } |
13 | 13 | |
14 | - public function setValue($value){ |
|
14 | + public function setValue($value) { |
|
15 | 15 | $this->getDataField()->setValue($value); |
16 | 16 | return $this; |
17 | 17 | } |
18 | 18 | |
19 | - public function setInputType($type){ |
|
20 | - if($type==="hidden") |
|
21 | - $this->addToProperty("style","display:none;"); |
|
19 | + public function setInputType($type) { |
|
20 | + if ($type==="hidden") |
|
21 | + $this->addToProperty("style", "display:none;"); |
|
22 | 22 | $this->getDataField()->setInputType($type); |
23 | 23 | return $this; |
24 | 24 | } |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | trait HtmlLinkTrait { |
6 | 6 | |
7 | - abstract public function setProperty($name,$value); |
|
7 | + abstract public function setProperty($name, $value); |
|
8 | 8 | abstract public function getProperty($name); |
9 | 9 | |
10 | 10 | public function setHref($value) { |
@@ -14,89 +14,89 @@ |
||
14 | 14 | */ |
15 | 15 | class HtmlGridRow extends HtmlBsDoubleElement { |
16 | 16 | private $cols; |
17 | - public function __construct($identifier,$numCols=NULL){ |
|
18 | - parent::__construct($identifier,"div"); |
|
17 | + public function __construct($identifier, $numCols=NULL) { |
|
18 | + parent::__construct($identifier, "div"); |
|
19 | 19 | $this->setProperty("class", "row"); |
20 | 20 | $this->cols=array(); |
21 | - if(isset($numCols)){ |
|
22 | - $numCols=min(12,$numCols); |
|
23 | - $numCols=max(1,$numCols); |
|
21 | + if (isset($numCols)) { |
|
22 | + $numCols=min(12, $numCols); |
|
23 | + $numCols=max(1, $numCols); |
|
24 | 24 | $width=12/$numCols; |
25 | - for ($i=0;$i<$numCols;$i++){ |
|
26 | - $this->addCol(CssSize::SIZE_MD,$width); |
|
25 | + for ($i=0; $i<$numCols; $i++) { |
|
26 | + $this->addCol(CssSize::SIZE_MD, $width); |
|
27 | 27 | } |
28 | 28 | } |
29 | 29 | } |
30 | 30 | |
31 | - public function addCol($size=CssSize::SIZE_MD,$width=1){ |
|
32 | - $col=new HtmlGridCol($this->identifier."-col-".(sizeof($this->cols)+1),$size,$width); |
|
31 | + public function addCol($size=CssSize::SIZE_MD, $width=1) { |
|
32 | + $col=new HtmlGridCol($this->identifier."-col-".(sizeof($this->cols)+1), $size, $width); |
|
33 | 33 | $this->cols[]=$col; |
34 | 34 | return $col; |
35 | 35 | } |
36 | 36 | |
37 | - public function addColAt($size=CssSize::SIZE_MD,$width=1,$offset=1){ |
|
38 | - $col=$this->addCol($size,$width); |
|
39 | - return $col->setOffset($size, max($offset,sizeof($this->cols)+1)); |
|
37 | + public function addColAt($size=CssSize::SIZE_MD, $width=1, $offset=1) { |
|
38 | + $col=$this->addCol($size, $width); |
|
39 | + return $col->setOffset($size, max($offset, sizeof($this->cols)+1)); |
|
40 | 40 | } |
41 | 41 | |
42 | - public function getCol($index,$force=true){ |
|
42 | + public function getCol($index, $force=true) { |
|
43 | 43 | $result=null; |
44 | - if($index<sizeof($this->cols)+1){ |
|
44 | + if ($index<sizeof($this->cols)+1) { |
|
45 | 45 | $result=$this->cols[$index-1]; |
46 | - }else if ($force){ |
|
47 | - $result=$this->addColAt(CssSize::SIZE_MD,1,$index); |
|
46 | + } else if ($force) { |
|
47 | + $result=$this->addColAt(CssSize::SIZE_MD, 1, $index); |
|
48 | 48 | } |
49 | 49 | return $result; |
50 | 50 | } |
51 | 51 | |
52 | - public function getColAt($offset,$force=true){ |
|
52 | + public function getColAt($offset, $force=true) { |
|
53 | 53 | $result=null; |
54 | - foreach ($this->cols as $col){ |
|
54 | + foreach ($this->cols as $col) { |
|
55 | 55 | $offsets=$col->getOffsets(); |
56 | - if($result=array_search($offset, $offsets)){ |
|
56 | + if ($result=array_search($offset, $offsets)) { |
|
57 | 57 | break; |
58 | 58 | } |
59 | 59 | } |
60 | - if(!$result || isset($result)===false){ |
|
61 | - $result=$this->getCol($offset,$force); |
|
60 | + if (!$result || isset($result)===false) { |
|
61 | + $result=$this->getCol($offset, $force); |
|
62 | 62 | } |
63 | 63 | return $result; |
64 | 64 | } |
65 | 65 | |
66 | 66 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
67 | 67 | |
68 | - foreach ($this->cols as $col){ |
|
68 | + foreach ($this->cols as $col) { |
|
69 | 69 | $this->addContent($col); |
70 | 70 | } |
71 | - return parent::compile($js,$view); |
|
71 | + return parent::compile($js, $view); |
|
72 | 72 | } |
73 | 73 | public function getCols() { |
74 | 74 | return $this->cols; |
75 | 75 | } |
76 | 76 | |
77 | - public function setContentForAll($content){ |
|
78 | - foreach ($this->cols as $col){ |
|
77 | + public function setContentForAll($content) { |
|
78 | + foreach ($this->cols as $col) { |
|
79 | 79 | $col->setContent($content); |
80 | 80 | } |
81 | 81 | } |
82 | - public function merge($size=CssSize::SIZE_MD,$start,$width){ |
|
83 | - $col=$this->getColAt($start,false); |
|
84 | - if(isset($col)){ |
|
85 | - $col->setWidth($size,$width+1); |
|
86 | - $this->delete($size,$start+1, $width); |
|
82 | + public function merge($size=CssSize::SIZE_MD, $start, $width) { |
|
83 | + $col=$this->getColAt($start, false); |
|
84 | + if (isset($col)) { |
|
85 | + $col->setWidth($size, $width+1); |
|
86 | + $this->delete($size, $start+1, $width); |
|
87 | 87 | } |
88 | 88 | } |
89 | - public function delete($size=CssSize::SIZE_MD,$start,$width){ |
|
90 | - while($start<sizeof($this->cols)+1 && $width>0){ |
|
91 | - $col=$this->getColAt($start,false); |
|
92 | - if(isset($col)){ |
|
89 | + public function delete($size=CssSize::SIZE_MD, $start, $width) { |
|
90 | + while ($start<sizeof($this->cols)+1 && $width>0) { |
|
91 | + $col=$this->getColAt($start, false); |
|
92 | + if (isset($col)) { |
|
93 | 93 | $widthCol=$col->getWidth($size); |
94 | - if($widthCol<=$width){ |
|
94 | + if ($widthCol<=$width) { |
|
95 | 95 | unset($this->cols[$start-1]); |
96 | - $this->cols = array_values($this->cols); |
|
96 | + $this->cols=array_values($this->cols); |
|
97 | 97 | $width=$width-$widthCol; |
98 | 98 | } |
99 | - }else{ |
|
99 | + } else { |
|
100 | 100 | $width=0; |
101 | 101 | } |
102 | 102 | } |
@@ -15,18 +15,18 @@ discard block |
||
15 | 15 | private $_hasIcon=false; |
16 | 16 | |
17 | 17 | abstract protected function addToPropertyCtrl($name, $value, $typeCtrl); |
18 | - abstract public function addContent($content,$before=false); |
|
18 | + abstract public function addContent($content, $before=false); |
|
19 | 19 | |
20 | - public function addIcon($icon,$direction=Direction::LEFT){ |
|
21 | - if($this->_hasIcon===false){ |
|
20 | + public function addIcon($icon, $direction=Direction::LEFT) { |
|
21 | + if ($this->_hasIcon===false) { |
|
22 | 22 | $iconO=$icon; |
23 | - if(\is_string($icon)){ |
|
23 | + if (\is_string($icon)) { |
|
24 | 24 | $iconO=new HtmlIcon("icon-".$this->identifier, $icon); |
25 | 25 | } |
26 | 26 | $this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon")); |
27 | - $this->addContent($iconO,$direction===Direction::LEFT); |
|
27 | + $this->addContent($iconO, $direction===Direction::LEFT); |
|
28 | 28 | $this->_hasIcon=true; |
29 | - }else{ |
|
29 | + } else { |
|
30 | 30 | $iconO=$this->getIcon(); |
31 | 31 | $iconO->setIcon($icon); |
32 | 32 | $this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon")); |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | return $iconO; |
35 | 35 | } |
36 | 36 | |
37 | - public function getIcon(){ |
|
38 | - if(\is_array($this->content)){ |
|
39 | - foreach ($this->content as $item){ |
|
40 | - if($item instanceof HtmlIcon) |
|
37 | + public function getIcon() { |
|
38 | + if (\is_array($this->content)) { |
|
39 | + foreach ($this->content as $item) { |
|
40 | + if ($item instanceof HtmlIcon) |
|
41 | 41 | return $item; |
42 | 42 | } |
43 | 43 | } |