@@ -41,15 +41,15 @@ discard block |
||
41 | 41 | * @param boolean $autoActive sets the last element's class to <b>active</b> if true |
42 | 42 | * @param function $hrefFunction the function who generates the href elements. default : function($e){return $e->getContent()} |
43 | 43 | */ |
44 | - public function __construct($identifier,$elements=array(),$autoActive=true,$startIndex=0,$hrefFunction=NULL){ |
|
45 | - parent::__construct($identifier,"ol"); |
|
44 | + public function __construct($identifier, $elements=array(), $autoActive=true, $startIndex=0, $hrefFunction=NULL) { |
|
45 | + parent::__construct($identifier, "ol"); |
|
46 | 46 | $this->startIndex=$startIndex; |
47 | 47 | $this->setProperty("class", "breadcrumb"); |
48 | 48 | $this->content=array(); |
49 | 49 | $this->autoActive=$autoActive; |
50 | 50 | $this->absolutePaths; |
51 | - $this->_hrefFunction=function ($e){return $e->getContent();}; |
|
52 | - if(isset($hrefFunction)){ |
|
51 | + $this->_hrefFunction=function($e) {return $e->getContent(); }; |
|
52 | + if (isset($hrefFunction)) { |
|
53 | 53 | $this->_hrefFunction=$hrefFunction; |
54 | 54 | } |
55 | 55 | $this->addElements($elements); |
@@ -60,43 +60,43 @@ discard block |
||
60 | 60 | * @param string $href |
61 | 61 | * @return \Ajax\bootstrap\html\HtmlLink |
62 | 62 | */ |
63 | - public function addElement($element,$href="",$glyph=NULL){ |
|
63 | + public function addElement($element, $href="", $glyph=NULL) { |
|
64 | 64 | $size=sizeof($this->content); |
65 | - if(is_array($element)){ |
|
65 | + if (is_array($element)) { |
|
66 | 66 | $elm=new HtmlLink("lnk-".$this->identifier."-".$size); |
67 | 67 | $elm->fromArray($element); |
68 | - }else if($element instanceof HtmlLink){ |
|
68 | + }else if ($element instanceof HtmlLink) { |
|
69 | 69 | $elm=$element; |
70 | - }else{ |
|
71 | - $elm=new HtmlLink("lnk-".$this->identifier."-".$size,$href,$element); |
|
72 | - if(isset($glyph)){ |
|
70 | + }else { |
|
71 | + $elm=new HtmlLink("lnk-".$this->identifier."-".$size, $href, $element); |
|
72 | + if (isset($glyph)) { |
|
73 | 73 | $elm->wrapContentWithGlyph($glyph); |
74 | 74 | } |
75 | 75 | } |
76 | - $elm->wrap("<li>","</li>"); |
|
76 | + $elm->wrap("<li>", "</li>"); |
|
77 | 77 | $this->content[]=$elm; |
78 | 78 | $elm->setProperty($this->attr, $this->getHref($size)); |
79 | 79 | return $elm; |
80 | 80 | } |
81 | 81 | |
82 | - public function setActive($index=null){ |
|
83 | - if(!isset($index)){ |
|
82 | + public function setActive($index=null) { |
|
83 | + if (!isset($index)) { |
|
84 | 84 | $index=sizeof($this->content)-1; |
85 | 85 | } |
86 | - $li=new HtmlBsDoubleElement("","li"); |
|
86 | + $li=new HtmlBsDoubleElement("", "li"); |
|
87 | 87 | $li->setClass("active"); |
88 | 88 | $li->setContent($this->content[$index]->getContent()); |
89 | 89 | $this->content[$index]=$li; |
90 | 90 | } |
91 | 91 | |
92 | - public function addElements($elements){ |
|
93 | - foreach ( $elements as $element ) { |
|
92 | + public function addElements($elements) { |
|
93 | + foreach ($elements as $element) { |
|
94 | 94 | $this->addElement($element); |
95 | 95 | } |
96 | 96 | return $this; |
97 | 97 | } |
98 | 98 | |
99 | - public function fromArray($array){ |
|
99 | + public function fromArray($array) { |
|
100 | 100 | $array=parent::fromArray($array); |
101 | 101 | $this->addElements($array); |
102 | 102 | return $array; |
@@ -108,14 +108,14 @@ discard block |
||
108 | 108 | * @param string $separator |
109 | 109 | * @return string |
110 | 110 | */ |
111 | - public function getHref($index=null,$separator="/"){ |
|
112 | - if(!isset($index)){ |
|
111 | + public function getHref($index=null, $separator="/") { |
|
112 | + if (!isset($index)) { |
|
113 | 113 | $index=sizeof($this->content); |
114 | 114 | } |
115 | - if($this->absolutePaths===true){ |
|
115 | + if ($this->absolutePaths===true) { |
|
116 | 116 | return $this->_hrefFunction($this->content[$index]); |
117 | - }else{ |
|
118 | - return $this->root.implode($separator, array_slice(array_map(function($e){return $this->_hrefFunction($e);}, $this->content),$this->startIndex,$index+1)); |
|
117 | + }else { |
|
118 | + return $this->root.implode($separator, array_slice(array_map(function($e) {return $this->_hrefFunction($e); }, $this->content), $this->startIndex, $index+1)); |
|
119 | 119 | } |
120 | 120 | } |
121 | 121 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | * @see \Ajax\bootstrap\html\BaseHtml::compile() |
125 | 125 | */ |
126 | 126 | public function compile(JsUtils $js=NULL, View $view=NULL) { |
127 | - if($this->autoActive){ |
|
127 | + if ($this->autoActive) { |
|
128 | 128 | $this->setActive(); |
129 | 129 | } |
130 | 130 | return parent::compile($js, $view); |
@@ -142,19 +142,19 @@ discard block |
||
142 | 142 | * @see \Ajax\bootstrap\html\base\BaseHtml::on() |
143 | 143 | */ |
144 | 144 | public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) { |
145 | - foreach ($this->content as $element){ |
|
146 | - $element->on($event,$jsCode,$stopPropagation,$preventDefault); |
|
145 | + foreach ($this->content as $element) { |
|
146 | + $element->on($event, $jsCode, $stopPropagation, $preventDefault); |
|
147 | 147 | } |
148 | 148 | return $this; |
149 | 149 | } |
150 | 150 | |
151 | 151 | public function setAutoActive($autoActive) { |
152 | - $this->autoActive = $autoActive; |
|
152 | + $this->autoActive=$autoActive; |
|
153 | 153 | return $this; |
154 | 154 | } |
155 | 155 | |
156 | 156 | public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) { |
157 | - foreach ($this->content as $element){ |
|
157 | + foreach ($this->content as $element) { |
|
158 | 158 | $element->_ajaxOn($operation, $event, $url, $responseElement, $parameters); |
159 | 159 | } |
160 | 160 | return $this; |
@@ -167,18 +167,18 @@ discard block |
||
167 | 167 | * @param string $attr the html attribute used to build the elements url |
168 | 168 | * @return HtmlBreadcrumbs |
169 | 169 | */ |
170 | - public function autoGetOnClick($targetSelector){ |
|
171 | - return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr)); |
|
170 | + public function autoGetOnClick($targetSelector) { |
|
171 | + return $this->getOnClick($this->root, $targetSelector, array("attr"=>$this->attr)); |
|
172 | 172 | } |
173 | 173 | |
174 | - public function contentAsString(){ |
|
175 | - if($this->autoActive){ |
|
174 | + public function contentAsString() { |
|
175 | + if ($this->autoActive) { |
|
176 | 176 | $this->setActive(); |
177 | 177 | } |
178 | 178 | return parent::contentAsString(); |
179 | 179 | } |
180 | 180 | |
181 | - public function getElement($index){ |
|
181 | + public function getElement($index) { |
|
182 | 182 | return $this->content[$index]; |
183 | 183 | } |
184 | 184 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * @param mixed $glyph |
188 | 188 | * @param int $index |
189 | 189 | */ |
190 | - public function addGlyph($glyph,$index=0){ |
|
190 | + public function addGlyph($glyph, $index=0) { |
|
191 | 191 | $elm=$this->getElement($index); |
192 | 192 | return $elm->wrapContentWithGlyph($glyph); |
193 | 193 | } |
@@ -197,15 +197,15 @@ discard block |
||
197 | 197 | * @param Dispatcher $dispatcher the request dispatcher |
198 | 198 | * @return \Ajax\bootstrap\html\HtmlBreadcrumbs |
199 | 199 | */ |
200 | - public function fromDispatcher($dispatcher,$startIndex=0){ |
|
200 | + public function fromDispatcher($dispatcher, $startIndex=0) { |
|
201 | 201 | $this->startIndex=$startIndex; |
202 | 202 | $params=$dispatcher->getParams(); |
203 | 203 | $action=$dispatcher->getActionName(); |
204 | 204 | $items=array($dispatcher->getControllerName()); |
205 | - if(\sizeof($params)>0 || \strtolower($action)!="index" ){ |
|
205 | + if (\sizeof($params)>0 || \strtolower($action)!="index") { |
|
206 | 206 | $items[]=$action; |
207 | - foreach ($params as $p){ |
|
208 | - if(\is_object($p)===false) |
|
207 | + foreach ($params as $p) { |
|
208 | + if (\is_object($p)===false) |
|
209 | 209 | $items[]=$p; |
210 | 210 | } |
211 | 211 | } |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | * @return \Ajax\bootstrap\html\HtmlBreadcrumbs |
220 | 220 | */ |
221 | 221 | public function setHrefFunction($_hrefFunction) { |
222 | - $this->_hrefFunction = $_hrefFunction; |
|
222 | + $this->_hrefFunction=$_hrefFunction; |
|
223 | 223 | return $this; |
224 | 224 | } |
225 | 225 |
@@ -25,47 +25,47 @@ |
||
25 | 25 | * @param string $type one of "raised","stacked","piled" default : "" |
26 | 26 | * @return \Ajax\semantic\html\elements\HtmlSegment |
27 | 27 | */ |
28 | - public function setType($type){ |
|
28 | + public function setType($type) { |
|
29 | 29 | return $this->addToPropertyCtrl("class", $type, SegmentType::getConstants()); |
30 | 30 | } |
31 | 31 | |
32 | - public function setSens($sens="vertical"){ |
|
33 | - return $this->addToPropertyCtrl("class", $sens, array("vertical","horizontal")); |
|
32 | + public function setSens($sens="vertical") { |
|
33 | + return $this->addToPropertyCtrl("class", $sens, array("vertical", "horizontal")); |
|
34 | 34 | } |
35 | 35 | |
36 | - public function setInverted(){ |
|
36 | + public function setInverted() { |
|
37 | 37 | return $this->addToProperty("class", "inverted"); |
38 | 38 | } |
39 | 39 | |
40 | - public function setAttached(){ |
|
40 | + public function setAttached() { |
|
41 | 41 | return $this->addToProperty("class", "attached"); |
42 | 42 | } |
43 | 43 | |
44 | - public function setEmphasis($value="secondary"){ |
|
45 | - return $this->addToPropertyCtrl("class", $value, array("secondary","tertiary","")); |
|
44 | + public function setEmphasis($value="secondary") { |
|
45 | + return $this->addToPropertyCtrl("class", $value, array("secondary", "tertiary", "")); |
|
46 | 46 | } |
47 | 47 | |
48 | - public function setCircular(){ |
|
48 | + public function setCircular() { |
|
49 | 49 | return $this->addToProperty("class", "circular"); |
50 | 50 | } |
51 | 51 | |
52 | - public function clear(){ |
|
52 | + public function clear() { |
|
53 | 53 | return $this->addToProperty("class", "clearing"); |
54 | 54 | } |
55 | 55 | |
56 | - public function setFloating($value="left"){ |
|
57 | - return $this->addToPropertyCtrl("class", "floated ".$value,array("floated right","floated left")); |
|
56 | + public function setFloating($value="left") { |
|
57 | + return $this->addToPropertyCtrl("class", "floated ".$value, array("floated right", "floated left")); |
|
58 | 58 | } |
59 | 59 | |
60 | - public function setTextAlignment($value=TextAlignment::LEFT){ |
|
61 | - return $this->addToPropertyCtrl("class", $value,TextAlignment::getConstants()); |
|
60 | + public function setTextAlignment($value=TextAlignment::LEFT) { |
|
61 | + return $this->addToPropertyCtrl("class", $value, TextAlignment::getConstants()); |
|
62 | 62 | } |
63 | 63 | |
64 | - public function setCompact(){ |
|
64 | + public function setCompact() { |
|
65 | 65 | return $this->addToProperty("class", "compact"); |
66 | 66 | } |
67 | 67 | |
68 | - public function setBasic(){ |
|
68 | + public function setBasic() { |
|
69 | 69 | return $this->setProperty("class", "ui basic segment"); |
70 | 70 | } |
71 | 71 |
@@ -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 | class VerticalAlignment extends BaseEnum { |
8 | - const TOP="top aligned",MIDDLE="middle aligned",BOTTOM="bottom aligned"; |
|
8 | + const TOP="top aligned", MIDDLE="middle aligned", BOTTOM="bottom aligned"; |
|
9 | 9 | } |
10 | 10 | \ No newline at end of file |
@@ -12,11 +12,11 @@ discard block |
||
12 | 12 | * @author jc |
13 | 13 | * @version 1.001 |
14 | 14 | */ |
15 | -class HtmlGridCol extends HtmlSemDoubleElement{ |
|
16 | - public function __construct($identifier,$width){ |
|
17 | - parent::__construct($identifier,"div"); |
|
15 | +class HtmlGridCol extends HtmlSemDoubleElement { |
|
16 | + public function __construct($identifier, $width) { |
|
17 | + parent::__construct($identifier, "div"); |
|
18 | 18 | $this->setClass("column"); |
19 | - if(isset($width)) |
|
19 | + if (isset($width)) |
|
20 | 20 | $this->setWidth($width); |
21 | 21 | } |
22 | 22 | |
@@ -25,12 +25,12 @@ discard block |
||
25 | 25 | * @param int $width |
26 | 26 | * @return \Ajax\semantic\html\content\HtmlGridCol |
27 | 27 | */ |
28 | - public function setWidth($width){ |
|
29 | - if(\is_int($width)){ |
|
28 | + public function setWidth($width) { |
|
29 | + if (\is_int($width)) { |
|
30 | 30 | $width=Wide::getConstants()["W".$width]; |
31 | 31 | } |
32 | 32 | $this->addToPropertyCtrl("class", $width, Wide::getConstants()); |
33 | - return $this->addToPropertyCtrl("class", "wide",array("wide")); |
|
33 | + return $this->addToPropertyCtrl("class", "wide", array("wide")); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -38,15 +38,15 @@ discard block |
||
38 | 38 | * @param string $value left or right |
39 | 39 | * @return \Ajax\semantic\html\content\HtmlGridCol |
40 | 40 | */ |
41 | - public function setFloated($value="left"){ |
|
41 | + public function setFloated($value="left") { |
|
42 | 42 | return $this->addToProperty("class", $value." floated"); |
43 | 43 | } |
44 | 44 | |
45 | - public function setTextAlignment($value=TextAlignment::LEFT){ |
|
46 | - return $this->addToPropertyCtrl("class", $value,TextAlignment::getConstants()); |
|
45 | + public function setTextAlignment($value=TextAlignment::LEFT) { |
|
46 | + return $this->addToPropertyCtrl("class", $value, TextAlignment::getConstants()); |
|
47 | 47 | } |
48 | 48 | |
49 | - public function setValue($value){ |
|
49 | + public function setValue($value) { |
|
50 | 50 | $this->content=$value; |
51 | 51 | } |
52 | 52 | } |
53 | 53 | \ No newline at end of file |
@@ -2,5 +2,5 @@ |
||
2 | 2 | namespace Ajax\semantic\html\base; |
3 | 3 | use Ajax\common\BaseEnum; |
4 | 4 | abstract class Size extends BaseEnum { |
5 | - const MASSIVE="massive",HUGE="huge",BIG="big",LARGE="large",MEDIUM="",SMALL="small",MINI="mini",TINY="tiny"; |
|
5 | + const MASSIVE="massive", HUGE="huge", BIG="big", LARGE="large", MEDIUM="", SMALL="small", MINI="mini", TINY="tiny"; |
|
6 | 6 | } |
7 | 7 | \ No newline at end of file |
@@ -9,8 +9,8 @@ discard block |
||
9 | 9 | |
10 | 10 | class HtmlLabel extends HtmlSemDoubleElement { |
11 | 11 | |
12 | - public function __construct($identifier,$caption="",$tagName="div") { |
|
13 | - parent::__construct($identifier,$tagName); |
|
12 | + public function __construct($identifier, $caption="", $tagName="div") { |
|
13 | + parent::__construct($identifier, $tagName); |
|
14 | 14 | $this->setProperty("class", "ui label"); |
15 | 15 | $this->content=$caption; |
16 | 16 | } |
@@ -19,26 +19,26 @@ discard block |
||
19 | 19 | * @param string $side |
20 | 20 | * @return \Ajax\semantic\html\elements\HtmlLabel |
21 | 21 | */ |
22 | - public function setPointing($value=Pointing::POINTING){ |
|
23 | - return $this->addToPropertyCtrl("class", $value,Pointing::getConstants()); |
|
22 | + public function setPointing($value=Pointing::POINTING) { |
|
23 | + return $this->addToPropertyCtrl("class", $value, Pointing::getConstants()); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
27 | 27 | * @param string $side |
28 | 28 | * @return \Ajax\semantic\html\elements\HtmlLabel |
29 | 29 | */ |
30 | - public function toCorner($side="left"){ |
|
31 | - return $this->addToPropertyCtrl("class", $side." corner",array("right corner","left corner")); |
|
30 | + public function toCorner($side="left") { |
|
31 | + return $this->addToPropertyCtrl("class", $side." corner", array("right corner", "left corner")); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
35 | 35 | * @return \Ajax\semantic\html\elements\HtmlLabel |
36 | 36 | */ |
37 | - public function asTag(){ |
|
37 | + public function asTag() { |
|
38 | 38 | return $this->addToProperty("class", "tag"); |
39 | 39 | } |
40 | 40 | |
41 | - public function setBasic(){ |
|
41 | + public function setBasic() { |
|
42 | 42 | return $this->addToProperty("class", "basic"); |
43 | 43 | } |
44 | 44 | |
@@ -49,17 +49,17 @@ discard block |
||
49 | 49 | * @param string $before |
50 | 50 | * @return \Ajax\semantic\html\elements\HtmlLabel |
51 | 51 | */ |
52 | - public function addImage($src,$alt="",$before=true){ |
|
52 | + public function addImage($src, $alt="", $before=true) { |
|
53 | 53 | $this->addToProperty("class", "image"); |
54 | - return $this->addContent(new HtmlImg("image-".$this->identifier,$src,$alt),$before); |
|
54 | + return $this->addContent(new HtmlImg("image-".$this->identifier, $src, $alt), $before); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
58 | 58 | * @param string $detail |
59 | 59 | * @return \Ajax\common\html\HtmlDoubleElement |
60 | 60 | */ |
61 | - public function addDetail($detail){ |
|
62 | - $div=new HtmlDoubleElement("detail-".$this->identifier,$this->tagName); |
|
61 | + public function addDetail($detail) { |
|
62 | + $div=new HtmlDoubleElement("detail-".$this->identifier, $this->tagName); |
|
63 | 63 | $div->setClass("detail"); |
64 | 64 | $div->setContent($detail); |
65 | 65 | $this->addContent($div); |
@@ -16,23 +16,23 @@ discard block |
||
16 | 16 | * @author jc |
17 | 17 | * @version 1.001 |
18 | 18 | */ |
19 | -class HtmlGridRow extends HtmlCollection{ |
|
19 | +class HtmlGridRow extends HtmlCollection { |
|
20 | 20 | |
21 | 21 | private $_colSize; |
22 | 22 | private $_implicite=false; |
23 | - public function __construct( $identifier,$numCols=NULL,$colSizing=false,$implicite=false){ |
|
24 | - parent::__construct( $identifier,"div"); |
|
23 | + public function __construct($identifier, $numCols=NULL, $colSizing=false, $implicite=false) { |
|
24 | + parent::__construct($identifier, "div"); |
|
25 | 25 | $this->_implicite=$implicite; |
26 | 26 | $this->setClass("row"); |
27 | 27 | $width=null; |
28 | - if(isset($numCols)){ |
|
29 | - $numCols=min(16,$numCols); |
|
30 | - $numCols=max(1,$numCols); |
|
31 | - if($colSizing) |
|
32 | - $width=(int)(16/$numCols); |
|
28 | + if (isset($numCols)) { |
|
29 | + $numCols=min(16, $numCols); |
|
30 | + $numCols=max(1, $numCols); |
|
31 | + if ($colSizing) |
|
32 | + $width=(int) (16 / $numCols); |
|
33 | 33 | else |
34 | - $this->_colSize=16/$numCols; |
|
35 | - for ($i=0;$i<$numCols;$i++){ |
|
34 | + $this->_colSize=16 / $numCols; |
|
35 | + for ($i=0; $i<$numCols; $i++) { |
|
36 | 36 | $this->addItem($width); |
37 | 37 | } |
38 | 38 | } |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | * @param int $width |
44 | 44 | * @return \Ajax\semantic\html\content\HtmlGridRow |
45 | 45 | */ |
46 | - public function setWidth($width){ |
|
47 | - if(\is_int($width)){ |
|
46 | + public function setWidth($width) { |
|
47 | + if (\is_int($width)) { |
|
48 | 48 | $width=Wide::getConstants()["W".$width]; |
49 | 49 | } |
50 | 50 | $this->addToPropertyCtrl("class", $width, Wide::getConstants()); |
51 | - return $this->addToPropertyCtrl("class", "column",array("column")); |
|
51 | + return $this->addToPropertyCtrl("class", "column", array("column")); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * @param int $index |
57 | 57 | * @return \Ajax\semantic\html\collections\HtmlGridCol |
58 | 58 | */ |
59 | - public function getCol($index){ |
|
59 | + public function getCol($index) { |
|
60 | 60 | return $this->getItem($index); |
61 | 61 | } |
62 | 62 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * stretch the row contents to take up the entire column height |
65 | 65 | * @return \Ajax\semantic\html\content\HtmlGridRow |
66 | 66 | */ |
67 | - public function setStretched(){ |
|
67 | + public function setStretched() { |
|
68 | 68 | return $this->addToProperty("class", "stretched"); |
69 | 69 | } |
70 | 70 | |
@@ -72,23 +72,23 @@ discard block |
||
72 | 72 | * @param string $color |
73 | 73 | * @return \Ajax\semantic\html\content\HtmlGridRow |
74 | 74 | */ |
75 | - public function setColor($color){ |
|
76 | - return $this->addToPropertyCtrl("class", $color,Color::getConstants()); |
|
75 | + public function setColor($color) { |
|
76 | + return $this->addToPropertyCtrl("class", $color, Color::getConstants()); |
|
77 | 77 | } |
78 | 78 | |
79 | - public function setTextAlignment($value=TextAlignment::LEFT){ |
|
80 | - return $this->addToPropertyCtrl("class", $value,TextAlignment::getConstants()); |
|
79 | + public function setTextAlignment($value=TextAlignment::LEFT) { |
|
80 | + return $this->addToPropertyCtrl("class", $value, TextAlignment::getConstants()); |
|
81 | 81 | } |
82 | 82 | |
83 | - public function setValues($values,$force=false){ |
|
83 | + public function setValues($values, $force=false) { |
|
84 | 84 | $count=$this->count(); |
85 | - if($force===true){ |
|
86 | - for($i=$count;$i<\sizeof($values);$i++){ |
|
87 | - $this->addItem(new HtmlGridCol($this->identifier."-col-".($this->count()+1),null)); |
|
85 | + if ($force===true) { |
|
86 | + for ($i=$count; $i<\sizeof($values); $i++) { |
|
87 | + $this->addItem(new HtmlGridCol($this->identifier."-col-".($this->count()+1), null)); |
|
88 | 88 | } |
89 | 89 | } |
90 | - $count=\min(array($this->count(),\sizeof($values))); |
|
91 | - for($i=0;$i<$count;$i++){ |
|
90 | + $count=\min(array($this->count(), \sizeof($values))); |
|
91 | + for ($i=0; $i<$count; $i++) { |
|
92 | 92 | $this->content[$i]->setValue($values[$i]); |
93 | 93 | } |
94 | 94 | } |
@@ -97,15 +97,15 @@ discard block |
||
97 | 97 | * {@inheritDoc} |
98 | 98 | * @see \Ajax\common\html\HtmlCollection::createItem() |
99 | 99 | */ |
100 | - protected function createItem($value){ |
|
101 | - $col=new HtmlGridCol($this->identifier."-col-".($this->count()+1),$value); |
|
100 | + protected function createItem($value) { |
|
101 | + $col=new HtmlGridCol($this->identifier."-col-".($this->count()+1), $value); |
|
102 | 102 | return $col; |
103 | 103 | } |
104 | 104 | |
105 | - public function compile(JsUtils $js=NULL,View $view=NULL){ |
|
106 | - if($this->_implicite===true){ |
|
105 | + public function compile(JsUtils $js=NULL, View $view=NULL) { |
|
106 | + if ($this->_implicite===true) { |
|
107 | 107 | $this->_template="%wrapContentBefore%%content%%wrapContentAfter%"; |
108 | 108 | } |
109 | - return parent::compile($js,$view); |
|
109 | + return parent::compile($js, $view); |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | \ No newline at end of file |
@@ -26,13 +26,13 @@ discard block |
||
26 | 26 | * @param string $type one of text,item |
27 | 27 | * @return \Ajax\semantic\html\collections\HtmlMenu |
28 | 28 | */ |
29 | - public function setType($type=""){ |
|
30 | - return $this->addToPropertyCtrl("class", $type, array("","item","text")); |
|
29 | + public function setType($type="") { |
|
30 | + return $this->addToPropertyCtrl("class", $type, array("", "item", "text")); |
|
31 | 31 | } |
32 | 32 | |
33 | - public function setActiveItem($index){ |
|
33 | + public function setActiveItem($index) { |
|
34 | 34 | $item=$this->getItem($index); |
35 | - if($item!==null){ |
|
35 | + if ($item!==null) { |
|
36 | 36 | $item->addToProperty("class", "active"); |
37 | 37 | } |
38 | 38 | return $this; |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | * {@inheritDoc} |
43 | 43 | * @see \Ajax\common\html\html5\HtmlCollection::addItem() |
44 | 44 | */ |
45 | - public function addItem($item){ |
|
45 | + public function addItem($item) { |
|
46 | 46 | $item=parent::addItem($item); |
47 | - if(!$item instanceof HtmlMenu) |
|
48 | - $item->addToPropertyCtrl("class", "item",array("item")); |
|
49 | - else{ |
|
47 | + if (!$item instanceof HtmlMenu) |
|
48 | + $item->addToPropertyCtrl("class", "item", array("item")); |
|
49 | + else { |
|
50 | 50 | $this->setSecondary(); |
51 | 51 | } |
52 | 52 | } |
@@ -55,51 +55,51 @@ discard block |
||
55 | 55 | * @see \Ajax\common\html\html5\HtmlCollection::createItem() |
56 | 56 | */ |
57 | 57 | protected function createItem($value) { |
58 | - $itemO=new HtmlLink("item-".\sizeof($this->content),"",$value); |
|
58 | + $itemO=new HtmlLink("item-".\sizeof($this->content), "", $value); |
|
59 | 59 | return $itemO->setClass("item"); |
60 | 60 | } |
61 | 61 | |
62 | - public function setInverted(){ |
|
62 | + public function setInverted() { |
|
63 | 63 | return $this->addToProperty("class", "inverted"); |
64 | 64 | } |
65 | 65 | |
66 | - public function setSecondary(){ |
|
66 | + public function setSecondary() { |
|
67 | 67 | return $this->addToProperty("class", "secondary"); |
68 | 68 | } |
69 | 69 | |
70 | - public function setVertical(){ |
|
70 | + public function setVertical() { |
|
71 | 71 | return $this->addToProperty("class", "vertical"); |
72 | 72 | } |
73 | 73 | |
74 | - public function setPosition($value="right"){ |
|
75 | - return $this->addToPropertyCtrl("class", $value,array("right","left")); |
|
74 | + public function setPosition($value="right") { |
|
75 | + return $this->addToPropertyCtrl("class", $value, array("right", "left")); |
|
76 | 76 | } |
77 | 77 | |
78 | - public function setPointing($value=Pointing::POINTING){ |
|
79 | - return $this->addToPropertyCtrl("class", $value,Pointing::getConstants()); |
|
78 | + public function setPointing($value=Pointing::POINTING) { |
|
79 | + return $this->addToPropertyCtrl("class", $value, Pointing::getConstants()); |
|
80 | 80 | } |
81 | 81 | |
82 | - public function asTab($vertical=false){ |
|
83 | - $this->apply(function(HtmlDoubleElement &$item){$item->setTagName("a");}); |
|
84 | - if($vertical===true) |
|
82 | + public function asTab($vertical=false) { |
|
83 | + $this->apply(function(HtmlDoubleElement & $item) {$item->setTagName("a"); }); |
|
84 | + if ($vertical===true) |
|
85 | 85 | $this->setVertical(); |
86 | 86 | return $this->addToProperty("class", "tabular"); |
87 | 87 | } |
88 | 88 | |
89 | - public function asPagination(){ |
|
90 | - $this->apply(function(HtmlDoubleElement &$item){$item->setTagName("a");}); |
|
89 | + public function asPagination() { |
|
90 | + $this->apply(function(HtmlDoubleElement & $item) {$item->setTagName("a"); }); |
|
91 | 91 | return $this->addToProperty("class", "pagination"); |
92 | 92 | } |
93 | 93 | |
94 | - public function setFixed(){ |
|
94 | + public function setFixed() { |
|
95 | 95 | return $this->addToProperty("class", "fixed"); |
96 | 96 | } |
97 | 97 | |
98 | - public function setFluid(){ |
|
98 | + public function setFluid() { |
|
99 | 99 | return $this->addToProperty("class", "fluid"); |
100 | 100 | } |
101 | 101 | |
102 | - public function setCompact(){ |
|
102 | + public function setCompact() { |
|
103 | 103 | return $this->addToProperty("class", "compact"); |
104 | 104 | } |
105 | 105 | } |
106 | 106 | \ No newline at end of file |