Completed
Push — master ( 4367a8...409900 )
by Jean-Christophe
03:16
created
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   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 	protected $attr;
21 21
 	
22 22
 	
23
-	public function __construct($identifier,$tagName){
24
-		parent::__construct($identifier,$tagName);
23
+	public function __construct($identifier, $tagName) {
24
+		parent::__construct($identifier, $tagName);
25 25
 		$this->root="";
26 26
 		$this->attr="data-ajax";
27 27
 	}
@@ -33,11 +33,11 @@  discard block
 block discarded – undo
33 33
 	 * @param string $attr the html attribute used to build the elements url
34 34
 	 * @return HtmlNavElement
35 35
 	 */
36
-	public function autoGetOnClick($targetSelector){
37
-		return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr));
36
+	public function autoGetOnClick($targetSelector) {
37
+		return $this->getOnClick($this->root, $targetSelector, array("attr"=>$this->attr));
38 38
 	}
39 39
 	
40
-	public function contentAsString(){
40
+	public function contentAsString() {
41 41
 		return implode("", $this->content);
42 42
 	}
43 43
 	
@@ -45,15 +45,15 @@  discard block
 block discarded – undo
45 45
 	 * Generate the jquery script to set the elements to the HtmlNavElement
46 46
 	 * @param JsUtils $jsUtils
47 47
 	 */
48
-	public function jsSetContent(JsUtils $jsUtils){
49
-		$jsUtils->html("#".$this->identifier,str_replace("\"","'", $this->contentAsString()),true);
48
+	public function jsSetContent(JsUtils $jsUtils) {
49
+		$jsUtils->html("#".$this->identifier, str_replace("\"", "'", $this->contentAsString()), true);
50 50
 	}
51 51
 	
52 52
 	public function getRoot() {
53 53
 		return $this->root;
54 54
 	}
55 55
 	public function setRoot($root) {
56
-		$this->root = $root;
56
+		$this->root=$root;
57 57
 		return $this;
58 58
 	}
59 59
 	public function getAttr() {
@@ -66,12 +66,12 @@  discard block
 block discarded – undo
66 66
 	 * @return HtmlNavElement
67 67
 	 */
68 68
 	public function setAttr($attr) {
69
-		$this->attr = $attr;
69
+		$this->attr=$attr;
70 70
 		return $this;
71 71
 	}
72 72
 
73 73
 	public function __call($method, $args) {
74
-		if(isset($this->$method) && is_callable($this->$method)) {
74
+		if (isset($this->$method) && is_callable($this->$method)) {
75 75
 			return call_user_func_array(
76 76
 					$this->$method,
77 77
 					$args
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   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -43,70 +43,70 @@  discard block
 block discarded – undo
43 43
 	/**
44 44
 	 * @param string $identifier
45 45
 	 */
46
-	public function __construct($identifier,$from=1,$to=1,$active=NULL,$countVisible=NULL){
47
-		parent::__construct($identifier,"ul");
46
+	public function __construct($identifier, $from=1, $to=1, $active=NULL, $countVisible=NULL) {
47
+		parent::__construct($identifier, "ul");
48 48
 		$this->setProperty("class", "pagination");
49 49
 		$this->active=$active;
50 50
 		$this->from=$from;
51 51
 		$this->to=$to;
52 52
 		$this->urlMask="%page%";
53
-		if(!isset($countVisible))
53
+		if (!isset($countVisible))
54 54
 			$this->countVisible=$to-$from+1;
55 55
 		else
56 56
 			$this->countVisible=$countVisible;
57 57
 		$this->createContent();
58 58
 	}
59 59
 
60
-	private function createElement($num,$content,$disabled=false,$current=false){
60
+	private function createElement($num, $content, $disabled=false, $current=false) {
61 61
 		$count=sizeof($this->content)+1;
62
-		$elem=new HtmlBsDoubleElement("li-".$this->identifier."-".$count,"li");
63
-		if($disabled){
62
+		$elem=new HtmlBsDoubleElement("li-".$this->identifier."-".$count, "li");
63
+		if ($disabled) {
64 64
 			$elem->setProperty("class", "disabled");
65 65
 		}
66
-		if($current){
66
+		if ($current) {
67 67
 			$content.="<span class='sr-only'>(current)</span>";
68 68
 			$elem->setProperty("class", "active");
69 69
 		}
70
-		if(!$disabled){
70
+		if (!$disabled) {
71 71
 			$url=$this->getUrl($num);
72
-			$href=new HtmlLink("a-".$this->identifier."-".$count,$url,$content);
72
+			$href=new HtmlLink("a-".$this->identifier."-".$count, $url, $content);
73 73
 			$href->setProperty($this->attr, $url);
74 74
 			$elem->setContent($href);
75
-		}else{
75
+		}else {
76 76
 			$elem->setContent($content);
77 77
 		}
78 78
 		$this->content[]=$elem;
79 79
 		return $this;
80 80
 	}
81 81
 
82
-	protected function createContent(){
82
+	protected function createContent() {
83 83
 		$this->content=array();
84
-		$this->createElement($this->active-1,"<span aria-hidden='true'>&laquo;</span>",$this->active===1);
84
+		$this->createElement($this->active-1, "<span aria-hidden='true'>&laquo;</span>", $this->active===1);
85 85
 		$start=$this->getStart();
86
-		$end=min($start+$this->countVisible-1,$this->to);
87
-		for($index=$start;$index<=$end;$index++){
88
-			$this->createElement($index,$index,false,$index===$this->active);
86
+		$end=min($start+$this->countVisible-1, $this->to);
87
+		for ($index=$start; $index<=$end; $index++) {
88
+			$this->createElement($index, $index, false, $index===$this->active);
89 89
 		}
90
-		$this->createElement($this->active+1,"<span aria-hidden='true'>&raquo;</span>",$this->active===$this->to);
90
+		$this->createElement($this->active+1, "<span aria-hidden='true'>&raquo;</span>", $this->active===$this->to);
91 91
 	}
92 92
 
93
-	protected function half(){
94
-		return (int)($this->countVisible/2);
93
+	protected function half() {
94
+		return (int) ($this->countVisible / 2);
95 95
 	}
96 96
 
97
-	protected function getStart(){
97
+	protected function getStart() {
98 98
 		$result=1;
99
-		if($this->countVisible!==$this->to-$this->from+1){
100
-			$result=max($this->active-$this->half(),$result);
99
+		if ($this->countVisible!==$this->to-$this->from+1) {
100
+			$result=max($this->active-$this->half(), $result);
101 101
 		}
102 102
 		return $result;
103 103
 	}
104 104
 
105 105
 	public function _addEvent($event, $jsCode) {
106
-		foreach ($this->content as $li){
106
+		foreach ($this->content as $li) {
107 107
 			$content=$li->getContent();
108
-			if($content instanceof BaseHtml)
109
-				$content->_addEvent($event,$jsCode);
108
+			if ($content instanceof BaseHtml)
109
+				$content->_addEvent($event, $jsCode);
110 110
 		}
111 111
 	}
112 112
 	/**
@@ -114,15 +114,15 @@  discard block
 block discarded – undo
114 114
 	 * @param Dispatcher $dispatcher the request dispatcher
115 115
 	 * @return \Ajax\bootstrap\html\HtmlPagination
116 116
 	 */
117
-	public function fromDispatcher($dispatcher){
118
-		$items=array($dispatcher->getControllerName(),$dispatcher->getActionName());
119
-		$items=array_merge($items,$dispatcher->getParams());
117
+	public function fromDispatcher($dispatcher) {
118
+		$items=array($dispatcher->getControllerName(), $dispatcher->getActionName());
119
+		$items=array_merge($items, $dispatcher->getParams());
120 120
 		$url=implode("/", $items);
121
-		if($this->urlMask==="%page%"){
121
+		if ($this->urlMask==="%page%") {
122 122
 			$this->urlMask=preg_replace("/[0-9]/", "%page%", $url);
123 123
 		}
124
-		for($index=$this->from;$index<=$this->to;$index++){
125
-			if($this->getUrl($index)==$url){
124
+		for ($index=$this->from; $index<=$this->to; $index++) {
125
+			if ($this->getUrl($index)==$url) {
126 126
 				$this->setActive($index);
127 127
 				break;
128 128
 			}
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 		return $this;
131 131
 	}
132 132
 
133
-	public function getUrl($index){
133
+	public function getUrl($index) {
134 134
 		return str_ireplace("%page%", $index, $this->urlMask);
135 135
 	}
136 136
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 		if (is_int($size)) {
145 145
 			return $this->addToPropertyUnique("class", CssRef::sizes("pagination")[$size], CssRef::sizes("pagination"));
146 146
 		}
147
-		if(!PhalconUtils::startsWith($size, "pagination-") && $size!=="")
147
+		if (!PhalconUtils::startsWith($size, "pagination-") && $size!=="")
148 148
 			$size="pagination-".$size;
149 149
 		return $this->addToPropertyCtrl("class", $size, CssRef::sizes("pagination"));
150 150
 	}
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 		return $this->from;
154 154
 	}
155 155
 	public function setFrom($from) {
156
-		$this->from = $from;
156
+		$this->from=$from;
157 157
 		$this->createContent();
158 158
 		return $this;
159 159
 	}
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 		return $this->to;
162 162
 	}
163 163
 	public function setTo($to) {
164
-		$this->to = $to;
164
+		$this->to=$to;
165 165
 		$this->createContent();
166 166
 		return $this;
167 167
 	}
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 		return $this->active;
170 170
 	}
171 171
 	public function setActive($active) {
172
-		$this->active = $active;
172
+		$this->active=$active;
173 173
 		$this->createContent();
174 174
 		return $this;
175 175
 	}
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 		return $this->urlMask;
178 178
 	}
179 179
 	public function setUrlMask($urlMask) {
180
-		$this->urlMask = $urlMask;
180
+		$this->urlMask=$urlMask;
181 181
 		$this->createContent();
182 182
 		return $this;
183 183
 	}
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 		return $this->countVisible;
186 186
 	}
187 187
 	public function setCountVisible($countVisible) {
188
-		$this->countVisible = $countVisible;
188
+		$this->countVisible=$countVisible;
189 189
 		$this->createContent();
190 190
 		return $this;
191 191
 	}
Please login to merge, or discard this patch.
Ajax/bootstrap/html/content/HtmlGridRow.php 3 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.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -14,88 +14,88 @@
 block discarded – undo
14 14
  */
15 15
 class HtmlGridRow extends HtmlDoubleElement {
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){
43
-		if($index<sizeof($this->cols)+1){
42
+	public function getCol($index, $force=true) {
43
+		if ($index<sizeof($this->cols)+1) {
44 44
 			$result=$this->cols[$index-1];
45
-		}else if ($force){
46
-			$result=$this->addColAt(CssSize::SIZE_MD,1,$index);
45
+		}else if ($force) {
46
+			$result=$this->addColAt(CssSize::SIZE_MD, 1, $index);
47 47
 		}
48 48
 		return $result;
49 49
 	}
50 50
 	
51
-	public function getColAt($offset,$force=true){
51
+	public function getColAt($offset, $force=true) {
52 52
 		$result=null;
53
-		foreach ($this->cols as $col){
53
+		foreach ($this->cols as $col) {
54 54
 			$offsets=$col->getOffsets();
55
-			if($result=array_search($offset, $offsets)){
55
+			if ($result=array_search($offset, $offsets)) {
56 56
 				break;
57 57
 			}
58 58
 		}
59
-		if(!$result || isset($result)==false){
60
-			$result=$this->getCol($offset,$force);
59
+		if (!$result || isset($result)==false) {
60
+			$result=$this->getCol($offset, $force);
61 61
 		}
62 62
 		return $result;
63 63
 	}
64 64
 	
65 65
 	public function compile(JsUtils $js=NULL, View $view=NULL) {
66 66
 	
67
-		foreach ($this->cols as $col){
67
+		foreach ($this->cols as $col) {
68 68
 			$this->addContent($col);
69 69
 		}
70
-		return parent::compile($js,$view);
70
+		return parent::compile($js, $view);
71 71
 	}
72 72
 	public function getCols() {
73 73
 		return $this->cols;
74 74
 	}
75 75
 	
76
-	public function setContentForAll($content){
77
-		foreach ($this->cols as $col){
76
+	public function setContentForAll($content) {
77
+		foreach ($this->cols as $col) {
78 78
 			$col->setContent($content);
79 79
 		}
80 80
 	}
81
-	public function merge($size=CssSize::SIZE_MD,$start,$width){
82
-		$col=$this->getColAt($start,false);
83
-		if(isset($col)){
84
-			$col->setWidth($size,$width+1);
85
-			$this->delete($size,$start+1, $width);
81
+	public function merge($size=CssSize::SIZE_MD, $start, $width) {
82
+		$col=$this->getColAt($start, false);
83
+		if (isset($col)) {
84
+			$col->setWidth($size, $width+1);
85
+			$this->delete($size, $start+1, $width);
86 86
 		}
87 87
 	}
88
-	public function delete($size=CssSize::SIZE_MD,$start,$width){
89
-		while($start<sizeof($this->cols)+1 && $width>0){
90
-			$col=$this->getColAt($start,false);
91
-			if(isset($col)){
88
+	public function delete($size=CssSize::SIZE_MD, $start, $width) {
89
+		while ($start<sizeof($this->cols)+1 && $width>0) {
90
+			$col=$this->getColAt($start, false);
91
+			if (isset($col)) {
92 92
 				$widthCol=$col->getWidth($size);
93
-				if($widthCol<=$width){
93
+				if ($widthCol<=$width) {
94 94
 					unset($this->cols[$start-1]);
95
-					$this->cols = array_values($this->cols);
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.
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.
Ajax/bootstrap/html/HtmlGridsystem.php 3 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -16,6 +16,10 @@
 block discarded – undo
16 16
 class HtmlGridSystem extends HtmlDoubleElement {
17 17
 	private $rows;
18 18
 	
19
+	/**
20
+	 * @param string $identifier
21
+	 * @param integer $numCols
22
+	 */
19 23
 	public function __construct($identifier,$numRows=1,$numCols=NULL){
20 24
 		parent::__construct($identifier,"div");
21 25
 		$this->setProperty("class", "container-fluid");
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -16,11 +16,11 @@  discard block
 block discarded – undo
16 16
 class HtmlGridSystem extends HtmlDoubleElement {
17 17
 	private $rows;
18 18
 	
19
-	public function __construct($identifier,$numRows=1,$numCols=NULL){
20
-		parent::__construct($identifier,"div");
19
+	public function __construct($identifier, $numRows=1, $numCols=NULL) {
20
+		parent::__construct($identifier, "div");
21 21
 		$this->setProperty("class", "container-fluid");
22 22
 		$this->rows=array();
23
-		$this->setNumRows($numRows,$numCols);
23
+		$this->setNumRows($numRows, $numCols);
24 24
 	}
25 25
 	
26 26
 	/**
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 	 * @param int $numCols 
29 29
 	 * @return \Ajax\bootstrap\html\content\HtmlGridRow
30 30
 	 */
31
-	public function addRow($numCols=NULL){
32
-		$row=new HtmlGridRow($this->identifier."-row-".(sizeof($this->rows)+1),$numCols);
31
+	public function addRow($numCols=NULL) {
32
+		$row=new HtmlGridRow($this->identifier."-row-".(sizeof($this->rows)+1), $numCols);
33 33
 		$this->rows[]=$row;
34 34
 		return $row;
35 35
 	}
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
40 40
 	 * @param boolean $force add the row at $index if true
41 41
 	 * @return \Ajax\bootstrap\html\content\HtmlGridRow
42 42
 	 */
43
-	public function getRow($index,$force=true){
44
-		if($index<sizeof($this->rows)){
43
+	public function getRow($index, $force=true) {
44
+		if ($index<sizeof($this->rows)) {
45 45
 			$result=$this->rows[$index-1];
46
-		}else if ($force){
46
+		}else if ($force) {
47 47
 			$this->setNumRows($index);
48 48
 			$result=$this->rows[$index-1];
49 49
 		}
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
 	 * @param int $numCols
57 57
 	 * @return \Ajax\bootstrap\html\HtmlGridSystem
58 58
 	 */
59
-	public function setNumRows($numRows,$numCols=NULL){
60
-		for($i=sizeof($this->rows);$i<$numRows;$i++){
59
+	public function setNumRows($numRows, $numCols=NULL) {
60
+		for ($i=sizeof($this->rows); $i<$numRows; $i++) {
61 61
 			$this->addRow($numCols);
62 62
 		}
63 63
 		return $this;
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
 	 * @param $force add the cell at $row,$col if true
70 70
 	 * @return HtmlGridCol
71 71
 	 */
72
-	public function getCell($row,$col,$force=true){
73
-		$row=$this->getRow($row,$force);
74
-		if(isset($row)){
75
-			$col=$row->getCol($col,$force);
72
+	public function getCell($row, $col, $force=true) {
73
+		$row=$this->getRow($row, $force);
74
+		if (isset($row)) {
75
+			$col=$row->getCol($col, $force);
76 76
 		}
77 77
 		return $col;
78 78
 	}
@@ -82,22 +82,22 @@  discard block
 block discarded – undo
82 82
 	 * @param int $col
83 83
 	 * @return HtmlGridCol
84 84
 	 */
85
-	public function getCellAt($row,$col,$force=true){
86
-		$row=$this->getRow($row,$force);
87
-		if(isset($row)){
88
-			$col=$row->getColAt($col,$force);
85
+	public function getCellAt($row, $col, $force=true) {
86
+		$row=$this->getRow($row, $force);
87
+		if (isset($row)) {
88
+			$col=$row->getColAt($col, $force);
89 89
 		}
90 90
 		return $col;
91 91
 	}
92 92
 	
93 93
 	public function compile(JsUtils $js=NULL, View $view=NULL) {
94
-		foreach ($this->rows as $row){
94
+		foreach ($this->rows as $row) {
95 95
 			$this->addContent($row);
96 96
 		}
97
-		return parent::compile($js,$view);
97
+		return parent::compile($js, $view);
98 98
 	}
99
-	public function setContentForAll($content){
100
-		foreach ($this->rows as $row){
99
+	public function setContentForAll($content) {
100
+		foreach ($this->rows as $row) {
101 101
 			$row->setContentForAll($content);
102 102
 		}
103 103
 	}
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 	public function getCol($index,$force=true){
35 35
 		if($index<sizeof($this->cols)+1){
36 36
 			$result=$this->cols[$index-1];
37
-		}else if ($force){
37
+		} else if ($force){
38 38
 			$result=$this->addColAt(CssSize::SIZE_MD,1,$index);
39 39
 			$this->cols[]=$result;
40 40
 		}
Please login to merge, or discard this patch.
Ajax/bootstrap/html/content/HtmlGridCol.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -15,22 +15,22 @@  discard block
 block discarded – undo
15 15
 class HtmlGridCol extends HtmlDoubleElement {
16 16
 	private $positions;
17 17
 	private $offsets;
18
-	public function __construct($identifier,$size=CssSize::SIZE_MD,$width=1){
19
-		parent::__construct($identifier,"div");
18
+	public function __construct($identifier, $size=CssSize::SIZE_MD, $width=1) {
19
+		parent::__construct($identifier, "div");
20 20
 		$this->positions=array();
21 21
 		$this->offsets=array();
22
-		$this->addPosition($size,$width);
22
+		$this->addPosition($size, $width);
23 23
 	}
24
-	public function addPosition($size=CssSize::SIZE_MD,$width=1){
24
+	public function addPosition($size=CssSize::SIZE_MD, $width=1) {
25 25
 		$this->positions[$size]=$width;
26 26
 		return $this;
27 27
 	}
28
-	private function _generateClass(){
28
+	private function _generateClass() {
29 29
 		$result=array();
30
-		foreach ($this->positions as $size=>$width){
30
+		foreach ($this->positions as $size=>$width) {
31 31
 			$result[]="col-".$size."-".$width;
32 32
 		}
33
-		foreach ($this->offsets as $size=>$offset){
33
+		foreach ($this->offsets as $size=>$offset) {
34 34
 			$result[]="col-".$size."-offset-".$offset;
35 35
 		}
36 36
 		return implode(" ", $result);
@@ -38,63 +38,63 @@  discard block
 block discarded – undo
38 38
 	
39 39
 	public function compile(JsUtils $js=NULL, View $view=NULL) {
40 40
 		$this->setProperty("class", $this->_generateClass());
41
-		return parent::compile($js,$view);
41
+		return parent::compile($js, $view);
42 42
 	}
43 43
 	
44
-	public function setOffset($size,$offset){
44
+	public function setOffset($size, $offset) {
45 45
 		$this->offsets[$size]=$offset;
46 46
 		return $this;
47 47
 	}
48 48
 
49
-	public function setOffsetForAll($newOffset){
50
-		foreach ($this->offsets as &$value){
49
+	public function setOffsetForAll($newOffset) {
50
+		foreach ($this->offsets as &$value) {
51 51
 			$value=$newOffset;
52 52
 		}
53 53
 		unset($value);
54 54
 		return $this;
55 55
 	}
56 56
 	
57
-	public function setWidthForAll($newWidth){
58
-		foreach ($this->positions as &$pos){
57
+	public function setWidthForAll($newWidth) {
58
+		foreach ($this->positions as &$pos) {
59 59
 			$pos=$newWidth;
60 60
 		}
61 61
 		unset($pos);
62 62
 		return $this;
63 63
 	}
64 64
 	
65
-	public function setWidth($size=CssSize::SIZE_MD,$width=1){
65
+	public function setWidth($size=CssSize::SIZE_MD, $width=1) {
66 66
 		$this->positions[$size]=$width;
67 67
 		return $this;	
68 68
 	}
69 69
 	
70
-	public function setPosition($size=CssSize::SIZE_MD,$width=1){
71
-		return $this->addPosition($size,$width);
70
+	public function setPosition($size=CssSize::SIZE_MD, $width=1) {
71
+		return $this->addPosition($size, $width);
72 72
 	}
73 73
 	
74
-	public function getWidth($size){
74
+	public function getWidth($size) {
75 75
 		return @$this->positions[$size];
76 76
 	}
77 77
 	
78
-	public function getOffest($size){
78
+	public function getOffest($size) {
79 79
 		return @$this->offsets[$size];
80 80
 	}
81 81
 	
82
-	public function addClear(){
83
-		$this->wrap("","<div class='clearfix'></div>");
82
+	public function addClear() {
83
+		$this->wrap("", "<div class='clearfix'></div>");
84 84
 	}
85 85
 	public function setOffsets($offsets) {
86
-		$this->offsets = $offsets;
86
+		$this->offsets=$offsets;
87 87
 		return $this;
88 88
 	}
89 89
 	
90
-	public function copy($identifier){
90
+	public function copy($identifier) {
91 91
 		$result=new HtmlGridCol($identifier);
92 92
 		$result->setPositions($this->positions);
93 93
 		$result->setOffsets($this->offsets);
94 94
 		return $result;
95 95
 	}
96 96
 	public function setPositions($positions) {
97
-		$this->positions = $positions;
97
+		$this->positions=$positions;
98 98
 		return $this;
99 99
 	}
100 100
 	public function getOffsets() {
Please login to merge, or discard this patch.