Completed
Push — master ( e76efc...a384bc )
by Jean-Christophe
04:08
created
Ajax/semantic/widgets/dataform/FormInstanceViewer.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -11,58 +11,58 @@  discard block
 block discarded – undo
11 11
 	protected $headers;
12 12
 	protected $wrappers;
13 13
 
14
-	public function __construct($identifier,$instance=NULL, $captions=NULL) {
15
-		parent::__construct($identifier,$instance=NULL, $captions=NULL);
14
+	public function __construct($identifier, $instance=NULL, $captions=NULL) {
15
+		parent::__construct($identifier, $instance=NULL, $captions=NULL);
16 16
 		$this->separators=[-1];
17 17
 		$this->headers=[];
18 18
 		$this->wrappers=[];
19
-		$this->defaultValueFunction=function($name,$value,$index){
19
+		$this->defaultValueFunction=function($name, $value, $index) {
20 20
 			$caption=$this->getCaption($index);
21
-			$input=new HtmlFormInput($this->widgetIdentifier."-".$name,$caption,"text",$value);
21
+			$input=new HtmlFormInput($this->widgetIdentifier."-".$name, $caption, "text", $value);
22 22
 			$input->setName($name);
23 23
 			return $input;
24 24
 		};
25 25
 	}
26 26
 
27
-	protected function _beforeAddProperty($index,&$field){
28
-		if(JString::endswith($field, "\n")===true){
27
+	protected function _beforeAddProperty($index, &$field) {
28
+		if (JString::endswith($field, "\n")===true) {
29 29
 			$this->addSeparatorAfter($index);
30 30
 		}
31
-		if($index>1 && JString::startswith($field, "\n")===true){
31
+		if ($index>1 && JString::startswith($field, "\n")===true) {
32 32
 			$this->addSeparatorAfter($index-1);
33 33
 		}
34 34
 		$field=\str_replace("\n", "", $field);
35
-		if(($header=$this->hasHeader($field))!==false){
35
+		if (($header=$this->hasHeader($field))!==false) {
36 36
 			$this->addHeaderDividerBefore($index, $header);
37 37
 		}
38 38
 	}
39 39
 
40
-	protected function hasHeader(&$field){
41
-		$matches=[];$result=false;
42
-		if(\preg_match('/\{(.*?)\}/s', $field, $matches)===1){
40
+	protected function hasHeader(&$field) {
41
+		$matches=[]; $result=false;
42
+		if (\preg_match('/\{(.*?)\}/s', $field, $matches)===1) {
43 43
 			$result=$matches[1];
44
-			$field=\str_replace("{".$result."}","", $field);
44
+			$field=\str_replace("{".$result."}", "", $field);
45 45
 		}
46 46
 		return $result;
47 47
 	}
48 48
 
49 49
 
50 50
 
51
-	public function addSeparatorAfter($fieldNum){
52
-		if(\array_search($fieldNum, $this->separators)===false)
51
+	public function addSeparatorAfter($fieldNum) {
52
+		if (\array_search($fieldNum, $this->separators)===false)
53 53
 			$this->separators[]=$fieldNum;
54 54
 		return $this;
55 55
 	}
56 56
 
57
-	public function addHeaderDividerBefore($fieldNum,$header){
57
+	public function addHeaderDividerBefore($fieldNum, $header) {
58 58
 		$this->headers[$fieldNum]=$header;
59
-		if($fieldNum>0)
59
+		if ($fieldNum>0)
60 60
 			$this->addSeparatorAfter($fieldNum-1);
61 61
 		return $this;
62 62
 	}
63 63
 
64
-	public function addWrapper($fieldNum,$contentBefore,$contentAfter=null){
65
-		$this->wrappers[$fieldNum]=[$contentBefore,$contentAfter];
64
+	public function addWrapper($fieldNum, $contentBefore, $contentAfter=null) {
65
+		$this->wrappers[$fieldNum]=[$contentBefore, $contentAfter];
66 66
 			return $this;
67 67
 	}
68 68
 
@@ -70,15 +70,15 @@  discard block
 block discarded – undo
70 70
 		return $this->separators;
71 71
 	}
72 72
 
73
-	public function removeSeparator($index){
74
-		\array_splice($this->separators,$index,1);
73
+	public function removeSeparator($index) {
74
+		\array_splice($this->separators, $index, 1);
75 75
 	}
76 76
 
77
-	public function removeField($index){
77
+	public function removeField($index) {
78 78
 		parent::removeField($index);
79 79
 		$pos=\array_search($index, $this->separators);
80
-		if($pos!==false){
81
-			for($i=$pos+1;$i<\sizeof($this->separators);$i++){
80
+		if ($pos!==false) {
81
+			for ($i=$pos+1; $i<\sizeof($this->separators); $i++) {
82 82
 				$this->separators[$i]--;
83 83
 			}
84 84
 			\array_splice($this->separators, $pos, 1);
Please login to merge, or discard this patch.
Ajax/semantic/widgets/dataform/DataForm.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -19,64 +19,64 @@  discard block
 block discarded – undo
19 19
 class DataForm extends Widget {
20 20
 
21 21
 	public function __construct($identifier, $modelInstance=NULL) {
22
-		parent::__construct($identifier, null,$modelInstance);
22
+		parent::__construct($identifier, null, $modelInstance);
23 23
 		$this->_form=new HtmlForm($identifier);
24 24
 		$this->_init(new FormInstanceViewer($identifier), "form", $this->_form, true);
25 25
 	}
26 26
 
27
-	protected function _getFieldIdentifier($prefix,$name=""){
27
+	protected function _getFieldIdentifier($prefix, $name="") {
28 28
 		return $this->identifier."-{$name}-".$this->_instanceViewer->getIdentifier();
29 29
 	}
30 30
 
31
-	public function compile(JsUtils $js=NULL,&$view=NULL){
32
-		if(!$this->_generated){
31
+	public function compile(JsUtils $js=NULL, &$view=NULL) {
32
+		if (!$this->_generated) {
33 33
 			$this->_instanceViewer->setInstance($this->_modelInstance);
34 34
 
35 35
 			$form=$this->content["form"];
36 36
 			$this->_generateContent($form);
37 37
 
38
-			if(isset($this->_toolbar)){
38
+			if (isset($this->_toolbar)) {
39 39
 				$this->_setToolbarPosition($form);
40 40
 			}
41
-			$this->content=JArray::sortAssociative($this->content, [PositionInTable::BEFORETABLE,"form",PositionInTable::AFTERTABLE]);
41
+			$this->content=JArray::sortAssociative($this->content, [PositionInTable::BEFORETABLE, "form", PositionInTable::AFTERTABLE]);
42 42
 			$this->_generated=true;
43 43
 		}
44
-		return parent::compile($js,$view);
44
+		return parent::compile($js, $view);
45 45
 	}
46 46
 
47 47
 	/**
48 48
 	 * @param HtmlForm $form
49 49
 	 */
50
-	protected function _generateContent($form){
51
-		$values= $this->_instanceViewer->getValues();
50
+	protected function _generateContent($form) {
51
+		$values=$this->_instanceViewer->getValues();
52 52
 		$count=$this->_instanceViewer->count();
53 53
 		$separators=$this->_instanceViewer->getSeparators();
54 54
 		$headers=$this->_instanceViewer->getHeaders();
55 55
 		$wrappers=$this->_instanceViewer->getWrappers();
56 56
 		\sort($separators);
57 57
 		$size=\sizeof($separators);
58
-		if($size===1){
59
-			foreach ($values as $v){
58
+		if ($size===1) {
59
+			foreach ($values as $v) {
60 60
 				$form->addField($v);
61 61
 			}
62
-		}else{
62
+		} else {
63 63
 			$separators[]=$count;
64
-			for($i=0;$i<$size;$i++){
64
+			for ($i=0; $i<$size; $i++) {
65 65
 				$wrapper=null;
66
-				$fields=\array_slice($values, $separators[$i]+1,$separators[$i+1]-$separators[$i]);
67
-				if(isset($headers[$separators[$i]+1]))
68
-					$form->addHeader($headers[$separators[$i]+1],4,true);
69
-				if(isset($wrappers[$separators[$i]+1])){
66
+				$fields=\array_slice($values, $separators[$i]+1, $separators[$i+1]-$separators[$i]);
67
+				if (isset($headers[$separators[$i]+1]))
68
+					$form->addHeader($headers[$separators[$i]+1], 4, true);
69
+				if (isset($wrappers[$separators[$i]+1])) {
70 70
 					$wrapper=$wrappers[$separators[$i]+1];
71 71
 				}
72 72
 				//TODO check why $fields is empty
73
-				if(\sizeof($fields)===1){
73
+				if (\sizeof($fields)===1) {
74 74
 					$added=$form->addField($fields[0]);
75
-				}elseif(\sizeof($fields)>1){
75
+				}elseif (\sizeof($fields)>1) {
76 76
 					$added=$form->addFields($fields);
77 77
 				}
78
-				if(isset($wrapper))
79
-					$added->wrap($wrapper[0],$wrapper[1]);
78
+				if (isset($wrapper))
79
+					$added->wrap($wrapper[0], $wrapper[1]);
80 80
 			}
81 81
 		}
82 82
 	}
@@ -85,11 +85,11 @@  discard block
 block discarded – undo
85 85
 	 * {@inheritDoc}
86 86
 	 * @see \Ajax\common\Widget::getForm()
87 87
 	 */
88
-	public function getForm(){
88
+	public function getForm() {
89 89
 		return $this->content["form"];
90 90
 	}
91 91
 
92
-	public function addSeparatorAfter($fieldNum){
92
+	public function addSeparatorAfter($fieldNum) {
93 93
 		$fieldNum=$this->_getIndex($fieldNum);
94 94
 		$this->_instanceViewer->addSeparatorAfter($fieldNum);
95 95
 		return $this;
@@ -104,12 +104,12 @@  discard block
 block discarded – undo
104 104
 		return $this;
105 105
 	}
106 106
 
107
-	public function fieldAsReset($index,$cssStyle=NULL,$attributes=NULL){
108
-		return $this->_fieldAs(function($id,$name,$value,$caption) use ($cssStyle){
109
-			$button=new HtmlButton($id,$value,$cssStyle);
107
+	public function fieldAsReset($index, $cssStyle=NULL, $attributes=NULL) {
108
+		return $this->_fieldAs(function($id, $name, $value, $caption) use ($cssStyle){
109
+			$button=new HtmlButton($id, $value, $cssStyle);
110 110
 			$button->setProperty("type", "reset");
111 111
 			return $button;
112
-		}, $index,$attributes);
112
+		}, $index, $attributes);
113 113
 	}
114 114
 
115 115
 	/**
@@ -128,19 +128,19 @@  discard block
 block discarded – undo
128 128
 		$this->content[$this->_toolbarPosition]=$this->_toolbar;
129 129
 	}
130 130
 
131
-	public function addDividerBefore($index,$title){
131
+	public function addDividerBefore($index, $title) {
132 132
 		$index=$this->_getIndex($index);
133 133
 		$this->_instanceViewer->addHeaderDividerBefore($index, $title);
134 134
 		return $this;
135 135
 	}
136 136
 
137
-	public function addWrapper($index,$contentBefore,$contentAfter=null){
137
+	public function addWrapper($index, $contentBefore, $contentAfter=null) {
138 138
 		$index=$this->_getIndex($index);
139
-		$this->_instanceViewer->addWrapper($index, $contentBefore,$contentAfter);
139
+		$this->_instanceViewer->addWrapper($index, $contentBefore, $contentAfter);
140 140
 		return $this;
141 141
 	}
142 142
 
143
-	public function run(JsUtils $js){
143
+	public function run(JsUtils $js) {
144 144
 		return parent::run($js);
145 145
 	}
146 146
 }
147 147
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/widgets/business/user/FormLogin.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -10,50 +10,50 @@
 block discarded – undo
10 10
 	 * @param string $identifier
11 11
 	 * @param object $modelInstance
12 12
 	 */
13
-	public function __construct($identifier,$modelInstance=null,$fieldsOrder=[],$fieldsDefinition=[],$fields=[],$captions=[],$separators=[]) {
14
-		parent::__construct($identifier,$modelInstance,$fieldsOrder,$fieldsDefinition,$fields,$captions,$separators);
13
+	public function __construct($identifier, $modelInstance=null, $fieldsOrder=[], $fieldsDefinition=[], $fields=[], $captions=[], $separators=[]) {
14
+		parent::__construct($identifier, $modelInstance, $fieldsOrder, $fieldsDefinition, $fields, $captions, $separators);
15 15
 	}
16 16
 
17
-	protected function getDefaultModelInstance(){
17
+	protected function getDefaultModelInstance() {
18 18
 		return new UserModel();
19 19
 	}
20 20
 
21
-	public static function regular($identifier,$modelInstance=null){
22
-		return new FormLogin($identifier,$modelInstance,
23
-				["message","login","password","remember","forget","submit","error"],
24
-				["message"=>[["icon"=>"sign in"]],"input0"=>[["rules"=>"empty"]],"input1"=>[["inputType"=>"password","rules"=>"empty"]],"checkbox","link","submit"=>["green fluid"],"message2"=>[["error"=>true]]],
25
-				["Connection","login","password","remember","forget","submit","error"],
26
-				["Please enter login and password to connect","Login","Password","Remember me.","Forgot your password?","Connection"],
27
-				[0,2,4,5,6]);
21
+	public static function regular($identifier, $modelInstance=null) {
22
+		return new FormLogin($identifier, $modelInstance,
23
+				["message", "login", "password", "remember", "forget", "submit", "error"],
24
+				["message"=>[["icon"=>"sign in"]], "input0"=>[["rules"=>"empty"]], "input1"=>[["inputType"=>"password", "rules"=>"empty"]], "checkbox", "link", "submit"=>["green fluid"], "message2"=>[["error"=>true]]],
25
+				["Connection", "login", "password", "remember", "forget", "submit", "error"],
26
+				["Please enter login and password to connect", "Login", "Password", "Remember me.", "Forgot your password?", "Connection"],
27
+				[0, 2, 4, 5, 6]);
28 28
 	}
29 29
 
30
-	public static function smallInline($identifier,$modelInstance=null){
31
-		$result=new FormLogin($identifier,$modelInstance,
32
-				["login","password","submit"],
33
-				["input0"=>[["rules"=>"empty"]],"input1"=>[["inputType"=>"password","rules"=>"empty"]],"submit"=>["green basic"]],
34
-				["login","password","submit"],
35
-				["","","Connection"],
30
+	public static function smallInline($identifier, $modelInstance=null) {
31
+		$result=new FormLogin($identifier, $modelInstance,
32
+				["login", "password", "submit"],
33
+				["input0"=>[["rules"=>"empty"]], "input1"=>[["inputType"=>"password", "rules"=>"empty"]], "submit"=>["green basic"]],
34
+				["login", "password", "submit"],
35
+				["", "", "Connection"],
36 36
 				[2]);
37 37
 			$result->addDividerBefore(0, "Connection");
38 38
 		return $result;
39 39
 	}
40 40
 
41
-	public static function small($identifier,$modelInstance=null){
42
-		$result=new FormLogin($identifier,$modelInstance,
43
-				["login","password","submit"],
44
-				["input0"=>[["rules"=>"empty"]],"input1"=>[["inputType"=>"password","rules"=>"empty"]],"submit"=>["green basic"]],
45
-				["login","password","submit"],
46
-				["Login","Password","Connection"],
47
-				[1,2]);
41
+	public static function small($identifier, $modelInstance=null) {
42
+		$result=new FormLogin($identifier, $modelInstance,
43
+				["login", "password", "submit"],
44
+				["input0"=>[["rules"=>"empty"]], "input1"=>[["inputType"=>"password", "rules"=>"empty"]], "submit"=>["green basic"]],
45
+				["login", "password", "submit"],
46
+				["Login", "Password", "Connection"],
47
+				[1, 2]);
48 48
 		$result->addDividerBefore(0, "Connection");
49 49
 		return $result;
50 50
 	}
51 51
 
52
-	public static function attachedSegment($identifier,$modelInstance=null){
53
-		$result=self::regular($identifier,$modelInstance);
54
-		$result->fieldAsMessage("message",["icon"=>"sign in","attached"=>true]);
55
-		$result->addWrapper("message",null,"<div class='ui attached segment'>");
56
-		$result->addWrapper("error", null,"</div>");
52
+	public static function attachedSegment($identifier, $modelInstance=null) {
53
+		$result=self::regular($identifier, $modelInstance);
54
+		$result->fieldAsMessage("message", ["icon"=>"sign in", "attached"=>true]);
55
+		$result->addWrapper("message", null, "<div class='ui attached segment'>");
56
+		$result->addWrapper("error", null, "</div>");
57 57
 		return $result;
58 58
 	}
59 59
 }
60 60
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/traits/SemanticWidgetsTrait.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 	 * @param array $instances
17 17
 	 * @return DataTable
18 18
 	 */
19
-	public function dataTable($identifier,$model, $instances){
20
-		return $this->addHtmlComponent(new DataTable($identifier,$model,$instances));
19
+	public function dataTable($identifier, $model, $instances) {
20
+		return $this->addHtmlComponent(new DataTable($identifier, $model, $instances));
21 21
 	}
22 22
 
23 23
 	/**
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
 	 * @param object $instance
26 26
 	 * @return DataElement
27 27
 	 */
28
-	public function dataElement($identifier, $instance){
29
-		return $this->addHtmlComponent(new DataElement($identifier,$instance));
28
+	public function dataElement($identifier, $instance) {
29
+		return $this->addHtmlComponent(new DataElement($identifier, $instance));
30 30
 	}
31 31
 
32 32
 	/**
@@ -34,19 +34,19 @@  discard block
 block discarded – undo
34 34
 	 * @param object $instance
35 35
 	 * @return DataForm
36 36
 	 */
37
-	public function dataForm($identifier, $instance){
38
-		return $this->addHtmlComponent(new DataForm($identifier,$instance));
37
+	public function dataForm($identifier, $instance) {
38
+		return $this->addHtmlComponent(new DataForm($identifier, $instance));
39 39
 	}
40 40
 
41
-	public function defaultLogin($identifier,$instance=null){
42
-		return $this->addHtmlComponent(FormLogin::regular($identifier,$instance));
41
+	public function defaultLogin($identifier, $instance=null) {
42
+		return $this->addHtmlComponent(FormLogin::regular($identifier, $instance));
43 43
 	}
44 44
 
45
-	public function smallLogin($identifier,$instance=null){
46
-		return $this->addHtmlComponent(FormLogin::small($identifier,$instance));
45
+	public function smallLogin($identifier, $instance=null) {
46
+		return $this->addHtmlComponent(FormLogin::small($identifier, $instance));
47 47
 	}
48 48
 
49
-	public function segmentedLogin($identifier,$instance=null){
50
-		return $this->addHtmlComponent(FormLogin::attachedSegment($identifier,$instance));
49
+	public function segmentedLogin($identifier, $instance=null) {
50
+		return $this->addHtmlComponent(FormLogin::attachedSegment($identifier, $instance));
51 51
 	}
52 52
 }
53 53
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlGrid.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -32,16 +32,16 @@  discard block
 block discarded – undo
32 32
 			// }
33 33
 			$this->setWide($numCols);
34 34
 		}
35
-		if($createCols)
35
+		if ($createCols)
36 36
 			$this->setRowsCount($numRows, $numCols);
37 37
 	}
38 38
 
39 39
 	public function asSegment() {
40
-		return $this->addToPropertyCtrl("class", "segment", array ("segment" ));
40
+		return $this->addToPropertyCtrl("class", "segment", array("segment"));
41 41
 	}
42 42
 
43 43
 	public function asContainer() {
44
-		return $this->addToPropertyCtrl("class", "container", array ("container" ));
44
+		return $this->addToPropertyCtrl("class", "container", array("container"));
45 45
 	}
46 46
 
47 47
 	/**
@@ -49,16 +49,16 @@  discard block
 block discarded – undo
49 49
 	 * @param int $wide
50 50
 	 */
51 51
 	public function setWide($wide) {
52
-		if(isset(Wide::getConstants()["W" . $wide])){
53
-			$wide=Wide::getConstants()["W" . $wide];
52
+		if (isset(Wide::getConstants()["W".$wide])) {
53
+			$wide=Wide::getConstants()["W".$wide];
54 54
 			$this->addToPropertyCtrl("class", $wide, Wide::getConstants());
55
-			return $this->addToPropertyCtrl("class", "column", array ("column" ));
55
+			return $this->addToPropertyCtrl("class", "column", array("column"));
56 56
 		}
57 57
 		return $this;
58 58
 	}
59 59
 	
60
-	public function setColWidth($numCol,$width){
61
-		foreach ($this->content as $row){
60
+	public function setColWidth($numCol, $width) {
61
+		foreach ($this->content as $row) {
62 62
 			$row->getCol($numCol)->setWidth($width);
63 63
 		}
64 64
 	}
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
 	 * @return mixed
79 79
 	 */
80 80
 	public function addRow($colsCount=NULL) {
81
-		$rowCount=$this->rowCount() + 1;
81
+		$rowCount=$this->rowCount()+1;
82 82
 		$this->setRowsCount($rowCount, $colsCount, true);
83
-		return $this->content[$rowCount - 1];
83
+		return $this->content[$rowCount-1];
84 84
 	}
85 85
 
86 86
 	/**
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
 	 * @return mixed|\Ajax\semantic\html\collections\HtmlGrid
90 90
 	 */
91 91
 	public function addCol($width=NULL) {
92
-		$colCount=$this->colCount() + 1;
92
+		$colCount=$this->colCount()+1;
93 93
 		$this->setColsCount($colCount, true, $width);
94 94
 		if ($this->hasOnlyCols($this->count()))
95
-			return $this->content[$colCount - 1];
95
+			return $this->content[$colCount-1];
96 96
 		return $this;
97 97
 	}
98 98
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
103 103
 	 */
104 104
 	public function addCols($sizes=array()) {
105
-		foreach ( $sizes as $size ) {
105
+		foreach ($sizes as $size) {
106 106
 			$this->addCol($size);
107 107
 		}
108 108
 		return $this;
@@ -116,19 +116,19 @@  discard block
 block discarded – undo
116 116
 	 */
117 117
 	public function setRowsCount($rowsCount, $colsCount=NULL, $force=false) {
118 118
 		$count=$this->count();
119
-		if ($rowsCount < 2 && $force === false) {
120
-			for($i=$count; $i < $colsCount; $i++) {
121
-				$this->addItem(new HtmlGridCol("col-" . $this->identifier . "-" . $i));
119
+		if ($rowsCount<2 && $force===false) {
120
+			for ($i=$count; $i<$colsCount; $i++) {
121
+				$this->addItem(new HtmlGridCol("col-".$this->identifier."-".$i));
122 122
 			}
123 123
 		} else {
124 124
 			if ($this->hasOnlyCols($count)) {
125 125
 				$tmpContent=$this->content;
126 126
 				$item=$this->addItem($colsCount);
127 127
 				$item->setContent($tmpContent);
128
-				$this->content=array ();
128
+				$this->content=array();
129 129
 				$count=1;
130 130
 			}
131
-			for($i=$count; $i < $rowsCount; $i++) {
131
+			for ($i=$count; $i<$rowsCount; $i++) {
132 132
 				$this->addItem($colsCount);
133 133
 			}
134 134
 		}
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 	}
137 137
 
138 138
 	protected function hasOnlyCols($count) {
139
-		return $count > 0 && $this->content[0] instanceof HtmlGridCol;
139
+		return $count>0 && $this->content[0] instanceof HtmlGridCol;
140 140
 	}
141 141
 
142 142
 	/**
@@ -150,14 +150,14 @@  discard block
 block discarded – undo
150 150
 		if (isset($width)===false) {
151 151
 			$this->setWide($numCols);
152 152
 		}
153
-		if ($toCreate === true) {
153
+		if ($toCreate===true) {
154 154
 			$count=$this->count();
155
-			if ($count == 0 || $this->hasOnlyCols($count)) {
156
-				for($i=$count; $i < $numCols; $i++) {
157
-					$this->addItem(new HtmlGridCol("col-" . $this->identifier . "-" . $i, $width));
155
+			if ($count==0 || $this->hasOnlyCols($count)) {
156
+				for ($i=$count; $i<$numCols; $i++) {
157
+					$this->addItem(new HtmlGridCol("col-".$this->identifier."-".$i, $width));
158 158
 				}
159 159
 			} else {
160
-				for($i=0; $i < $count; $i++) {
160
+				for ($i=0; $i<$count; $i++) {
161 161
 					$this->getItem($i)->setColsCount($numCols);
162 162
 				}
163 163
 			}
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 		$count=$this->count();
194 194
 		if ($this->hasOnlyCols($count))
195 195
 			return $count;
196
-		if ($count > 0)
196
+		if ($count>0)
197 197
 			return $this->getItem(0)->count();
198 198
 		return 0;
199 199
 	}
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	 * @return \Ajax\semantic\html\collections\HtmlGridCol
206 206
 	 */
207 207
 	public function getCell($row, $col) {
208
-		if ($row < 2 && $this->hasOnlyCols($this->count()))
208
+		if ($row<2 && $this->hasOnlyCols($this->count()))
209 209
 			return $this->getItem($col);
210 210
 		$row=$this->getItem($row);
211 211
 		if (isset($row)) {
@@ -220,8 +220,8 @@  discard block
 block discarded – undo
220 220
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
221 221
 	 */
222 222
 	public function setDivided($vertically=false) {
223
-		$value=($vertically === true) ? "vertically divided" : "divided";
224
-		return $this->addToPropertyCtrl("class", $value, array ("divided" ));
223
+		$value=($vertically===true) ? "vertically divided" : "divided";
224
+		return $this->addToPropertyCtrl("class", $value, array("divided"));
225 225
 	}
226 226
 
227 227
 	/**
@@ -230,15 +230,15 @@  discard block
 block discarded – undo
230 230
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
231 231
 	 */
232 232
 	public function setCelled($internally=false) {
233
-		$value=($internally === true) ? "internally celled" : "celled";
234
-		return $this->addToPropertyCtrl("class", $value, array ("celled","internally celled" ));
233
+		$value=($internally===true) ? "internally celled" : "celled";
234
+		return $this->addToPropertyCtrl("class", $value, array("celled", "internally celled"));
235 235
 	}
236 236
 
237 237
 	/**
238 238
 	 * A grid can have its columns centered
239 239
 	 */
240 240
 	public function setCentered() {
241
-		return $this->addToPropertyCtrl("class", "centered", array ("centered" ));
241
+		return $this->addToPropertyCtrl("class", "centered", array("centered"));
242 242
 	}
243 243
 
244 244
 	/**
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 	 */
257 257
 	public function setPadded($value=NULL) {
258 258
 		if (isset($value))
259
-			$this->addToPropertyCtrl("class", $value, array ("vertically","horizontally" ));
259
+			$this->addToPropertyCtrl("class", $value, array("vertically", "horizontally"));
260 260
 		return $this->addToProperty("class", "padded");
261 261
 	}
262 262
 
@@ -266,12 +266,12 @@  discard block
 block discarded – undo
266 266
 	 * @return \Ajax\semantic\html\collections\HtmlGrid
267 267
 	 */
268 268
 	public function setRelaxed($very=false) {
269
-		$value=($very === true) ? "very relaxed" : "relaxed";
270
-		return $this->addToPropertyCtrl("class", $value, array ("relaxed","very relaxed" ));
269
+		$value=($very===true) ? "very relaxed" : "relaxed";
270
+		return $this->addToPropertyCtrl("class", $value, array("relaxed", "very relaxed"));
271 271
 	}
272 272
 
273 273
 	public function setVerticalAlignment($value=VerticalAlignment::MIDDLE) {
274
-		return $this->addToPropertyCtrl("class", $value . " aligned", VerticalAlignment::getConstantValues("aligned"));
274
+		return $this->addToPropertyCtrl("class", $value." aligned", VerticalAlignment::getConstantValues("aligned"));
275 275
 	}
276 276
 
277 277
 	/**
@@ -281,9 +281,9 @@  discard block
 block discarded – undo
281 281
 	 * @see \Ajax\common\html\HtmlCollection::createItem()
282 282
 	 */
283 283
 	protected function createItem($value) {
284
-		if ($this->_createCols === false)
284
+		if ($this->_createCols===false)
285 285
 			$value=null;
286
-		$item=new HtmlGridRow($this->identifier . "-row-" . ($this->count() + 1), $value, $this->_colSizing, $this->_implicitRows);
286
+		$item=new HtmlGridRow($this->identifier."-row-".($this->count()+1), $value, $this->_colSizing, $this->_implicitRows);
287 287
 		return $item;
288 288
 	}
289 289
 
@@ -294,15 +294,15 @@  discard block
 block discarded – undo
294 294
 	public function setValues($values, $force=true) {
295 295
 		$count=$this->count();
296 296
 		$valuesSize=\sizeof($values);
297
-		if ($this->_createCols === false || $force === true) {
298
-			for($i=$count; $i < $valuesSize; $i++) {
297
+		if ($this->_createCols===false || $force===true) {
298
+			for ($i=$count; $i<$valuesSize; $i++) {
299 299
 				$colSize=\sizeof($values[$i]);
300
-				$this->addItem(new HtmlGridRow($this->identifier . "-row-" . ($this->count() + 1), $colSize, $this->_colSizing, $this->_implicitRows));
300
+				$this->addItem(new HtmlGridRow($this->identifier."-row-".($this->count()+1), $colSize, $this->_colSizing, $this->_implicitRows));
301 301
 			}
302 302
 		}
303
-		$count=\min(array ($this->count(),$valuesSize ));
304
-		for($i=0; $i < $count; $i++) {
305
-			$this->content[$i]->setValues($values[$i], $this->_createCols === false);
303
+		$count=\min(array($this->count(), $valuesSize));
304
+		for ($i=0; $i<$count; $i++) {
305
+			$this->content[$i]->setValues($values[$i], $this->_createCols===false);
306 306
 		}
307 307
 	}
308 308
 
Please login to merge, or discard this patch.