Completed
Push — master ( 73e21a...085edf )
by Jean-Christophe
04:37
created
Ajax/ui/components/Dialog.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,11 +12,11 @@  discard block
 block discarded – undo
12 12
  */
13 13
 class Dialog extends SimpleComponent {
14 14
 	protected $attachTo;
15
-	protected $buttons=array ();
15
+	protected $buttons=array();
16 16
 
17 17
 	public function __construct(JsUtils $js) {
18 18
 		parent::__construct($js);
19
-		$this->params=array (
19
+		$this->params=array(
20 20
 				"dialogClass" => "no-close" 
21 21
 		);
22 22
 		$this->addCancelBtn("Annuler");
@@ -24,12 +24,12 @@  discard block
 block discarded – undo
24 24
 
25 25
 	public function getScript() {
26 26
 		$allParams=$this->params;
27
-		$jsonButtons=array ();
28
-		foreach ( $this->buttons as $button ) {
27
+		$jsonButtons=array();
28
+		foreach ($this->buttons as $button) {
29 29
 			$jsonButtons []=$button->getParams();
30 30
 		}
31 31
 		$allParams ["buttons"]=$jsonButtons;
32
-		$this->jquery_code_for_compile []="$( '" . $this->attachTo . "' ).dialog(" . $this->getParamsAsJSON($allParams) . ");";
32
+		$this->jquery_code_for_compile []="$( '".$this->attachTo."' ).dialog(".$this->getParamsAsJSON($allParams).");";
33 33
 		$result=implode("", $this->jquery_code_for_compile);
34 34
 		$result=str_ireplace("\"%", "", $result);
35 35
 		$result=str_ireplace("%\"", "", $result);
@@ -59,9 +59,9 @@  discard block
 block discarded – undo
59 59
 	}
60 60
 
61 61
 	private function insertBtn($insert, $position=NULL) {
62
-		if ($position != NULL) {
62
+		if ($position!=NULL) {
63 63
 			$this->buttons=array_splice($this->buttons, $position, 0, $insert);
64
-		} else {
64
+		}else {
65 65
 			$this->buttons []=$insert;
66 66
 		}
67 67
 	}
Please login to merge, or discard this patch.
Ajax/ui/components/DialogButton.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
 	private function addFunction($jsCode) {
18 18
 		if (!Text::startsWith($jsCode, "function"))
19
-			$jsCode="%function(){" . $jsCode . "}%";
19
+			$jsCode="%function(){".$jsCode."}%";
20 20
 		return $jsCode;
21 21
 	}
22 22
 
@@ -43,6 +43,6 @@  discard block
 block discarded – undo
43 43
 	}
44 44
 
45 45
 	public static function submitButton(JsUtils $js, $url, $form, $responseElement, $caption="Okay") {
46
-		return new DialogButton($caption, $js->postForm($url, $form, $responseElement) . ";$( this ).dialog( 'close' );");
46
+		return new DialogButton($caption, $js->postForm($url, $form, $responseElement).";$( this ).dialog( 'close' );");
47 47
 	}
48 48
 }
49 49
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,8 +15,9 @@
 block discarded – undo
15 15
 class DialogButton extends BaseComponent {
16 16
 
17 17
 	private function addFunction($jsCode) {
18
-		if (!Text::startsWith($jsCode, "function"))
19
-			$jsCode="%function(){" . $jsCode . "}%";
18
+		if (!Text::startsWith($jsCode, "function")) {
19
+					$jsCode="%function(){" . $jsCode . "}%";
20
+		}
20 21
 		return $jsCode;
21 22
 	}
22 23
 
Please login to merge, or discard this patch.
Ajax/ui/components/Progressbar.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 
15 15
 	public function __construct(JsUtils $js) {
16 16
 		parent::__construct($js);
17
-		$this->params=array (
17
+		$this->params=array(
18 18
 				"value" => 50 
19 19
 		);
20 20
 		$this->uiName="progressbar";
Please login to merge, or discard this patch.
Ajax/ui/properties/Animation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 	 * @param string $value default : swing
31 31
 	 */
32 32
 	public function setEasing($value) {
33
-		$this->setParamCtrl("easing", $value, array (
33
+		$this->setParamCtrl("easing", $value, array(
34 34
 				"linear",
35 35
 				"swing",
36 36
 				"easeInQuad",
Please login to merge, or discard this patch.
Ajax/ui/properties/Position.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@
 block discarded – undo
74 74
 	protected function setParamCtrl($key, $value, $typeCtrl) {
75 75
 		if (!$typeCtrl($value)) {
76 76
 			throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." à la position");
77
-		} else
77
+		}else
78 78
 			$this->setParam($key, $value);
79 79
 	}
80 80
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,8 +74,9 @@
 block discarded – undo
74 74
 	protected function setParamCtrl($key, $value, $typeCtrl) {
75 75
 		if (!$typeCtrl($value)) {
76 76
 			throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." à la position");
77
-		} else
78
-			$this->setParam($key, $value);
77
+		} else {
78
+					$this->setParam($key, $value);
79
+		}
79 80
 	}
80 81
 
81 82
 	/*
Please login to merge, or discard this patch.
Ajax/bootstrap/html/base/HtmlNavElement.php 2 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,6 +20,10 @@  discard block
 block discarded – undo
20 20
 	protected $attr;
21 21
 	
22 22
 	
23
+	/**
24
+	 * @param string $identifier
25
+	 * @param string $tagName
26
+	 */
23 27
 	public function __construct($identifier,$tagName){
24 28
 		parent::__construct($identifier,$tagName);
25 29
 		$this->root="";
@@ -30,7 +34,6 @@  discard block
 block discarded – undo
30 34
 	 * Associate an ajax get to the elements, displayed in $targetSelector
31 35
 	 * $attr member is used to build each element url
32 36
 	 * @param string $targetSelector the target of the get
33
-	 * @param string $attr the html attribute used to build the elements url
34 37
 	 * @return HtmlNavElement
35 38
 	 */
36 39
 	public function autoGetOnClick($targetSelector){
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
 	protected $attr;
20 20
 
21 21
 
22
-	public function __construct($identifier,$tagName){
23
-		parent::__construct($identifier,$tagName);
22
+	public function __construct($identifier, $tagName) {
23
+		parent::__construct($identifier, $tagName);
24 24
 		$this->root="";
25 25
 		$this->attr="data-ajax";
26 26
 	}
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
 	 * @param string $attr the html attribute used to build the elements url
33 33
 	 * @return HtmlNavElement
34 34
 	 */
35
-	public function autoGetOnClick($targetSelector){
36
-		return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr));
35
+	public function autoGetOnClick($targetSelector) {
36
+		return $this->getOnClick($this->root, $targetSelector, array("attr"=>$this->attr));
37 37
 	}
38 38
 
39
-	public function contentAsString(){
39
+	public function contentAsString() {
40 40
 		return implode("", $this->content);
41 41
 	}
42 42
 
@@ -44,15 +44,15 @@  discard block
 block discarded – undo
44 44
 	 * Generate the jquery script to set the elements to the HtmlNavElement
45 45
 	 * @param JsUtils $jsUtils
46 46
 	 */
47
-	public function jsSetContent(JsUtils $jsUtils){
48
-		$jsUtils->html("#".$this->identifier,str_replace("\"","'", $this->contentAsString()),true);
47
+	public function jsSetContent(JsUtils $jsUtils) {
48
+		$jsUtils->html("#".$this->identifier, str_replace("\"", "'", $this->contentAsString()), true);
49 49
 	}
50 50
 
51 51
 	public function getRoot() {
52 52
 		return $this->root;
53 53
 	}
54 54
 	public function setRoot($root) {
55
-		$this->root = $root;
55
+		$this->root=$root;
56 56
 		return $this;
57 57
 	}
58 58
 	public function getAttr() {
@@ -65,12 +65,12 @@  discard block
 block discarded – undo
65 65
 	 * @return HtmlNavElement
66 66
 	 */
67 67
 	public function setAttr($attr) {
68
-		$this->attr = $attr;
68
+		$this->attr=$attr;
69 69
 		return $this;
70 70
 	}
71 71
 
72 72
 	public function __call($method, $args) {
73
-		if(isset($this->$method) && is_callable($this->$method)) {
73
+		if (isset($this->$method) && is_callable($this->$method)) {
74 74
 			return call_user_func_array(
75 75
 					$this->$method,
76 76
 					$args
@@ -78,6 +78,6 @@  discard block
 block discarded – undo
78 78
 		}
79 79
 	}
80 80
 
81
-	public abstract function fromDispatcher(JsUtils $js,$dispatcher,$startIndex=0);
81
+	public abstract function fromDispatcher(JsUtils $js, $dispatcher, $startIndex=0);
82 82
 
83 83
 }
84 84
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlGlyphicon.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@
 block discarded – undo
149 149
 		$glyph->setGlyphicon($glyphicon);
150 150
 		if ($left) {
151 151
 			$this->content=$glyph->compile().$separator.$this->content;
152
-		} else {
152
+		}else {
153 153
 			$this->content.=$separator.$glyph->compile();
154 154
 		}
155 155
 		return $this;
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlPagination.php 2 patches
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -52,10 +52,11 @@  discard block
 block discarded – undo
52 52
 		$this->from=$from;
53 53
 		$this->to=$to;
54 54
 		$this->urlMask="%page%";
55
-		if(!isset($countVisible))
56
-			$this->countVisible=$to-$from+1;
57
-		else
58
-			$this->countVisible=$countVisible;
55
+		if(!isset($countVisible)) {
56
+					$this->countVisible=$to-$from+1;
57
+		} else {
58
+					$this->countVisible=$countVisible;
59
+		}
59 60
 		$this->createContent();
60 61
 	}
61 62
 	
@@ -74,7 +75,7 @@  discard block
 block discarded – undo
74 75
 			$href=new HtmlLink("a-".$this->identifier."-".$count,$url,$content);
75 76
 			$href->setProperty($this->attr, $url);
76 77
 			$elem->setContent($href);
77
-		}else{
78
+		} else{
78 79
 			$elem->setContent($content);
79 80
 		}
80 81
 		$this->content[]=$elem;
@@ -107,8 +108,9 @@  discard block
 block discarded – undo
107 108
 	public function _addEvent($event, $jsCode) {
108 109
 		foreach ($this->content as $li){
109 110
 			$content=$li->getContent();
110
-			if($content instanceof BaseHtml)
111
-				$content->_addEvent($event,$jsCode);
111
+			if($content instanceof BaseHtml) {
112
+							$content->_addEvent($event,$jsCode);
113
+			}
112 114
 		}
113 115
 	}
114 116
 	/**
@@ -146,8 +148,9 @@  discard block
 block discarded – undo
146 148
 		if (is_int($size)) {
147 149
 			return $this->addToPropertyUnique("class", CssRef::sizes("pagination")[$size], CssRef::sizes("pagination"));
148 150
 		}
149
-		if(!PhalconUtils::startsWith($size, "pagination-") && $size!=="")
150
-			$size="pagination-".$size;
151
+		if(!PhalconUtils::startsWith($size, "pagination-") && $size!=="") {
152
+					$size="pagination-".$size;
153
+		}
151 154
 		return $this->addToPropertyCtrl("class", $size, CssRef::sizes("pagination"));
152 155
 	}
153 156
 	
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -45,70 +45,70 @@  discard block
 block discarded – undo
45 45
 	/**
46 46
 	 * @param string $identifier
47 47
 	 */
48
-	public function __construct($identifier,$from=1,$to=1,$active=NULL,$countVisible=NULL){
49
-		parent::__construct($identifier,"ul");
48
+	public function __construct($identifier, $from=1, $to=1, $active=NULL, $countVisible=NULL) {
49
+		parent::__construct($identifier, "ul");
50 50
 		$this->setProperty("class", "pagination");
51 51
 		$this->active=$active;
52 52
 		$this->from=$from;
53 53
 		$this->to=$to;
54 54
 		$this->urlMask="%page%";
55
-		if(!isset($countVisible))
55
+		if (!isset($countVisible))
56 56
 			$this->countVisible=$to-$from+1;
57 57
 		else
58 58
 			$this->countVisible=$countVisible;
59 59
 		$this->createContent();
60 60
 	}
61 61
 
62
-	private function createElement($num,$content,$disabled=false,$current=false){
62
+	private function createElement($num, $content, $disabled=false, $current=false) {
63 63
 		$count=sizeof($this->content)+1;
64
-		$elem=new HtmlBsDoubleElement("li-".$this->identifier."-".$count,"li");
65
-		if($disabled){
64
+		$elem=new HtmlBsDoubleElement("li-".$this->identifier."-".$count, "li");
65
+		if ($disabled) {
66 66
 			$elem->setProperty("class", "disabled");
67 67
 		}
68
-		if($current){
68
+		if ($current) {
69 69
 			$content.="<span class='sr-only'>(current)</span>";
70 70
 			$elem->setProperty("class", "active");
71 71
 		}
72
-		if(!$disabled){
72
+		if (!$disabled) {
73 73
 			$url=$this->getUrl($num);
74
-			$href=new HtmlLink("a-".$this->identifier."-".$count,$url,$content);
74
+			$href=new HtmlLink("a-".$this->identifier."-".$count, $url, $content);
75 75
 			$href->setProperty($this->attr, $url);
76 76
 			$elem->setContent($href);
77
-		}else{
77
+		}else {
78 78
 			$elem->setContent($content);
79 79
 		}
80 80
 		$this->content[]=$elem;
81 81
 		return $this;
82 82
 	}
83 83
 
84
-	protected function createContent(){
84
+	protected function createContent() {
85 85
 		$this->content=array();
86
-		$this->createElement($this->active-1,"<span aria-hidden='true'>&laquo;</span>",$this->active===1);
86
+		$this->createElement($this->active-1, "<span aria-hidden='true'>&laquo;</span>", $this->active===1);
87 87
 		$start=$this->getStart();
88
-		$end=min($start+$this->countVisible-1,$this->to);
89
-		for($index=$start;$index<=$end;$index++){
90
-			$this->createElement($index,$index,false,$index===$this->active);
88
+		$end=min($start+$this->countVisible-1, $this->to);
89
+		for ($index=$start; $index<=$end; $index++) {
90
+			$this->createElement($index, $index, false, $index===$this->active);
91 91
 		}
92
-		$this->createElement($this->active+1,"<span aria-hidden='true'>&raquo;</span>",$this->active===$this->to);
92
+		$this->createElement($this->active+1, "<span aria-hidden='true'>&raquo;</span>", $this->active===$this->to);
93 93
 	}
94 94
 
95
-	protected function half(){
96
-		return (int)($this->countVisible/2);
95
+	protected function half() {
96
+		return (int) ($this->countVisible / 2);
97 97
 	}
98 98
 
99
-	protected function getStart(){
99
+	protected function getStart() {
100 100
 		$result=1;
101
-		if($this->countVisible!==$this->to-$this->from+1){
102
-			$result=max($this->active-$this->half(),$result);
101
+		if ($this->countVisible!==$this->to-$this->from+1) {
102
+			$result=max($this->active-$this->half(), $result);
103 103
 		}
104 104
 		return $result;
105 105
 	}
106 106
 
107 107
 	public function _addEvent($event, $jsCode) {
108
-		foreach ($this->content as $li){
108
+		foreach ($this->content as $li) {
109 109
 			$content=$li->getContent();
110
-			if($content instanceof BaseHtml)
111
-				$content->_addEvent($event,$jsCode);
110
+			if ($content instanceof BaseHtml)
111
+				$content->_addEvent($event, $jsCode);
112 112
 		}
113 113
 	}
114 114
 	/**
@@ -117,14 +117,14 @@  discard block
 block discarded – undo
117 117
 	 * @param Dispatcher $dispatcher the request dispatcher
118 118
 	 * @return \Ajax\bootstrap\html\HtmlPagination
119 119
 	 */
120
-	public function fromDispatcher(JsUtils $js,$dispatcher,$startIndex=0){
120
+	public function fromDispatcher(JsUtils $js, $dispatcher, $startIndex=0) {
121 121
 		$items=$js->fromDispatcher($dispatcher);
122 122
 		$url=implode("/", $items);
123
-		if($this->urlMask==="%page%"){
123
+		if ($this->urlMask==="%page%") {
124 124
 			$this->urlMask=preg_replace("/[0-9]/", "%page%", $url);
125 125
 		}
126
-		for($index=$this->from;$index<=$this->to;$index++){
127
-			if($this->getUrl($index)==$url){
126
+		for ($index=$this->from; $index<=$this->to; $index++) {
127
+			if ($this->getUrl($index)==$url) {
128 128
 				$this->setActive($index);
129 129
 				break;
130 130
 			}
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 		return $this;
133 133
 	}
134 134
 
135
-	public function getUrl($index){
135
+	public function getUrl($index) {
136 136
 		return str_ireplace("%page%", $index, $this->urlMask);
137 137
 	}
138 138
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		if (is_int($size)) {
147 147
 			return $this->addToPropertyUnique("class", CssRef::sizes("pagination")[$size], CssRef::sizes("pagination"));
148 148
 		}
149
-		if(!PhalconUtils::startsWith($size, "pagination-") && $size!=="")
149
+		if (!PhalconUtils::startsWith($size, "pagination-") && $size!=="")
150 150
 			$size="pagination-".$size;
151 151
 		return $this->addToPropertyCtrl("class", $size, CssRef::sizes("pagination"));
152 152
 	}
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 		return $this->from;
156 156
 	}
157 157
 	public function setFrom($from) {
158
-		$this->from = $from;
158
+		$this->from=$from;
159 159
 		$this->createContent();
160 160
 		return $this;
161 161
 	}
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 		return $this->to;
164 164
 	}
165 165
 	public function setTo($to) {
166
-		$this->to = $to;
166
+		$this->to=$to;
167 167
 		$this->createContent();
168 168
 		return $this;
169 169
 	}
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 		return $this->active;
172 172
 	}
173 173
 	public function setActive($active) {
174
-		$this->active = $active;
174
+		$this->active=$active;
175 175
 		$this->createContent();
176 176
 		return $this;
177 177
 	}
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 		return $this->urlMask;
180 180
 	}
181 181
 	public function setUrlMask($urlMask) {
182
-		$this->urlMask = $urlMask;
182
+		$this->urlMask=$urlMask;
183 183
 		$this->createContent();
184 184
 		return $this;
185 185
 	}
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 		return $this->countVisible;
188 188
 	}
189 189
 	public function setCountVisible($countVisible) {
190
-		$this->countVisible = $countVisible;
190
+		$this->countVisible=$countVisible;
191 191
 		$this->createContent();
192 192
 		return $this;
193 193
 	}
Please login to merge, or discard this patch.
Ajax/bootstrap/html/content/HtmlGridRow.php 4 patches
Doc Comments   +10 added lines patch added patch discarded remove patch
@@ -14,6 +14,11 @@  discard block
 block discarded – undo
14 14
  */
15 15
 class HtmlGridRow extends HtmlDoubleElement {
16 16
 	private $cols;
17
+
18
+	/**
19
+	 * @param string $identifier
20
+	 * @param integer $numCols
21
+	 */
17 22
 	public function __construct($identifier,$numCols=NULL){
18 23
 		parent::__construct($identifier,"div");
19 24
 		$this->setProperty("class", "row");
@@ -85,6 +90,11 @@  discard block
 block discarded – undo
85 90
 			$this->delete($size,$start+1, $width);
86 91
 		}
87 92
 	}
93
+
94
+	/**
95
+	 * @param integer $start
96
+	 * @param integer $width
97
+	 */
88 98
 	public function delete($size=CssSize::SIZE_MD,$start,$width){
89 99
 		while($start<sizeof($this->cols)+1 && $width>0){
90 100
 			$col=$this->getColAt($start,false);
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	public function getCol($index,$force=true){
43 43
 		if($index<sizeof($this->cols)+1){
44 44
 			$result=$this->cols[$index-1];
45
-		}else if ($force){
45
+		} else if ($force){
46 46
 			$result=$this->addColAt(CssSize::SIZE_MD,1,$index);
47 47
 		}
48 48
 		return $result;
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 					$this->cols = array_values($this->cols);
96 96
 					$width=$width-$widthCol;
97 97
 				}
98
-			}else{
98
+			} else{
99 99
 				$width=0;
100 100
 			}
101 101
 		}
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -14,89 +14,89 @@
 block discarded – undo
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);
24
-			$width=12/$numCols;
25
-			for ($i=0;$i<$numCols;$i++){
26
-				$this->addCol(CssSize::SIZE_MD,$width);
21
+		if (isset($numCols)) {
22
+			$numCols=min(12, $numCols);
23
+			$numCols=max(1, $numCols);
24
+			$width=12 / $numCols;
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 $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
 		}
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 
4 4
 use Ajax\bootstrap\html\base\CssSize;
5 5
 use Ajax\JsUtils;
6
-
7 6
 use Ajax\bootstrap\html\base\HtmlBsDoubleElement;
8 7
 
9 8
 /**
Please login to merge, or discard this patch.