Completed
Push — master ( 864cd0...5654ad )
by Jean-Christophe
03:12
created
Ajax/bootstrap/html/HtmlCarousel.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -16,12 +16,12 @@  discard block
 block discarded – undo
16 16
  * @version 1.001
17 17
  */
18 18
 class HtmlCarousel extends BaseHtml {
19
-	protected $indicators=array ();
20
-	protected $slides=array ();
19
+	protected $indicators=array();
20
+	protected $slides=array();
21 21
 	protected $leftControl="";
22 22
 	protected $rightControl="";
23 23
 	protected $_base="";
24
-	protected $_glyphs=array ();
24
+	protected $_glyphs=array();
25 25
 
26 26
 	public function __construct($identifier, $images=NULL) {
27 27
 		parent::__construct($identifier);
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	}
39 39
 
40 40
 	public function setBase($_base) {
41
-		foreach ($this->slides as $slide){
41
+		foreach ($this->slides as $slide) {
42 42
 			$imgSrc=$slide->getImageSrc();
43 43
 			$slide->setImageSrc(str_replace($this->_base.$imgSrc, $_base.$imgSrc, $imgSrc));
44 44
 		}
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
 	}
94 94
 
95 95
 	public function addImage($imageSrc, $imageAlt="", $caption=NULL, $description=NULL) {
96
-		if(\is_array($imageSrc)){
97
-			$this->addImage($imageSrc[0],@$imageSrc[1],@$imageSrc[2],@$imageSrc[3]);
98
-		}else{
96
+		if (\is_array($imageSrc)) {
97
+			$this->addImage($imageSrc[0], @$imageSrc[1], @$imageSrc[2], @$imageSrc[3]);
98
+		} else {
99 99
 			$image=new HtmlCarouselItem("item-".$this->identifier);
100 100
 			$image->setImageSrc($this->_base.$imageSrc);
101 101
 			$image->setImageAlt($imageAlt);
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 	 */
119 119
 	public function fromArray($array) {
120 120
 		if (\is_array($array) && sizeof($array)>0) {
121
-			foreach ( $array as $value ) {
121
+			foreach ($array as $value) {
122 122
 				if (\is_array($value)) {
123 123
 					$this->addImage($value ["src"], @$value ["alt"], @$value ["caption"], @$value ["description"]);
124 124
 				} else {
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlBreadcrumbs.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -41,15 +41,15 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
124 124
 	 * @see \Ajax\bootstrap\html\BaseHtml::compile()
125 125
 	 */
126 126
 	public function compile(JsUtils $js=NULL, &$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
 block discarded – undo
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;
@@ -166,18 +166,18 @@  discard block
 block discarded – undo
166 166
 	 * @param string $targetSelector the target of the get
167 167
 	 * @return HtmlBreadcrumbs
168 168
 	 */
169
-	public function autoGetOnClick($targetSelector){
170
-		return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr));
169
+	public function autoGetOnClick($targetSelector) {
170
+		return $this->getOnClick($this->root, $targetSelector, array("attr"=>$this->attr));
171 171
 	}
172 172
 
173
-	public function contentAsString(){
174
-		if($this->autoActive){
173
+	public function contentAsString() {
174
+		if ($this->autoActive) {
175 175
 			$this->setActive();
176 176
 		}
177 177
 		return parent::contentAsString();
178 178
 	}
179 179
 
180
-	public function getElement($index){
180
+	public function getElement($index) {
181 181
 		return $this->content[$index];
182 182
 	}
183 183
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 	 * @param mixed $glyph
187 187
 	 * @param int $index
188 188
 	 */
189
-	public function addGlyph($glyph,$index=0){
189
+	public function addGlyph($glyph, $index=0) {
190 190
 		$elm=$this->getElement($index);
191 191
 		return $elm->wrapContentWithGlyph($glyph);
192 192
 	}
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 	 * @param Dispatcher $dispatcher the request dispatcher
198 198
 	 * @return \Ajax\bootstrap\html\HtmlBreadcrumbs
199 199
 	 */
200
-	public function fromDispatcher(JsUtils $js,$dispatcher,$startIndex=0){
200
+	public function fromDispatcher(JsUtils $js, $dispatcher, $startIndex=0) {
201 201
 		$this->startIndex=$startIndex;
202 202
 		return $this->addElements($js->fromDispatcher($dispatcher));
203 203
 	}
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 	 * @return \Ajax\bootstrap\html\HtmlBreadcrumbs
210 210
 	 */
211 211
 	public function setHrefFunction($_hrefFunction) {
212
-		$this->_hrefFunction = $_hrefFunction;
212
+		$this->_hrefFunction=$_hrefFunction;
213 213
 		return $this;
214 214
 	}
215 215
 
Please login to merge, or discard this patch.
Ajax/php/cakephp/_JsUtils.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -8,23 +8,23 @@  discard block
 block discarded – undo
8 8
 use Cake\Network\Response;
9 9
 use Cake\Core\App;
10 10
 
11
-class _JsUtils extends \Ajax\JsUtils{
12
-	public function getUrl($url){
11
+class _JsUtils extends \Ajax\JsUtils {
12
+	public function getUrl($url) {
13 13
 		return Router::url($url);
14 14
 	}
15
-	public function addViewElement($identifier,$content,&$view){
15
+	public function addViewElement($identifier, $content, &$view) {
16 16
 		$viewVars=$view->viewVars;
17
-		if (isset($viewVars["q"]) === false) {
18
-			$controls=array ();
19
-		}else{
17
+		if (isset($viewVars["q"])===false) {
18
+			$controls=array();
19
+		} else {
20 20
 			$controls=$viewVars["q"];
21 21
 		}
22 22
 		$controls[$identifier]=$content;
23 23
 		$view->set("q", $controls);
24 24
 	}
25 25
 
26
-	public function createScriptVariable(&$view,$view_var, $output){
27
-		$view->set($view_var,$output);
26
+	public function createScriptVariable(&$view, $view_var, $output) {
27
+		$view->set($view_var, $output);
28 28
 	}
29 29
 
30 30
 	/**
@@ -34,18 +34,18 @@  discard block
 block discarded – undo
34 34
 	 * @param array $params
35 35
 	 * @see \Ajax\JsUtils::forward()
36 36
 	 */
37
-	public function forward($initialControllerInstance,$controllerName,$actionName,$params=array()){
37
+	public function forward($initialControllerInstance, $controllerName, $actionName, $params=array()) {
38 38
 		\ob_start();
39
-		if(isset($params) && !\is_array($params)){
39
+		if (isset($params) && !\is_array($params)) {
40 40
 			$params=[$params];
41 41
 		}
42 42
 		$url=h(Router::url(\array_merge([
43 43
 				'controller' => $controllerName,
44
-				'action' => $actionName],$params),false
44
+				'action' => $actionName], $params), false
45 45
 		));
46 46
 		$base=Router::url("/");
47
-		if (substr($url, 0, strlen($base)) == $base) {
48
-			$url = substr($url, strlen($base));
47
+		if (substr($url, 0, strlen($base))==$base) {
48
+			$url=substr($url, strlen($base));
49 49
 		}
50 50
 		$initialControllerInstance->requestAction($url);
51 51
 		$result=\ob_get_contents();
@@ -53,17 +53,17 @@  discard block
 block discarded – undo
53 53
 		return $result;
54 54
 	}
55 55
 
56
-	public function renderContent($initialControllerInstance,$viewName, $params=NULL) {
57
-		$view = new View(Router::getRequest(true), new Response());
58
-		if(\is_array($params)){
59
-			foreach ($params as $k=>$v){
56
+	public function renderContent($initialControllerInstance, $viewName, $params=NULL) {
57
+		$view=new View(Router::getRequest(true), new Response());
58
+		if (\is_array($params)) {
59
+			foreach ($params as $k=>$v) {
60 60
 				$view->set($k, $v);
61 61
 			}
62 62
 		}
63 63
 		return $view->render($viewName);
64 64
 	}
65 65
 
66
-	public function fromDispatcher($dispatcher){
66
+	public function fromDispatcher($dispatcher) {
67 67
 		return \explode("/", Router::getRequest(true)->url);
68 68
 	}
69 69
 }
70 70
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/components/search/SearchResults.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 	private $elements;
9 9
 
10 10
 	public function __construct($objects=NULL) {
11
-		$this->elements=array ();
11
+		$this->elements=array();
12 12
 		if (isset($objects)) {
13 13
 			if (\is_array($objects)) {
14 14
 				$this->addResults($objects);
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
 			$this->elements[]=$object;
24 24
 			return $this;
25 25
 		}
26
-		if (\is_array($object) === false) {
27
-			$object=[ "title" => $object ];
26
+		if (\is_array($object)===false) {
27
+			$object=["title" => $object];
28 28
 		}
29 29
 		$this->elements[]=new SearchResult($object);
30 30
 		return $this;
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
 		if (!\is_array($objects)) {
35 35
 			return $this->addResult($objects);
36 36
 		}
37
-		if (JArray::dimension($objects) === 1) {
38
-			foreach ( $objects as $object ) {
39
-				$this->addResult([ "title" => $object ]);
37
+		if (JArray::dimension($objects)===1) {
38
+			foreach ($objects as $object) {
39
+				$this->addResult(["title" => $object]);
40 40
 			}
41 41
 		} else
42 42
 			$this->elements=\array_merge($this->elements, $objects);
@@ -44,21 +44,21 @@  discard block
 block discarded – undo
44 44
 	}
45 45
 
46 46
 	public function _search($query, $field="title") {
47
-		$result=array ();
48
-		foreach ( $this->elements as $element ) {
47
+		$result=array();
48
+		foreach ($this->elements as $element) {
49 49
 			if ($element instanceof SearchResult) {
50
-				if ($element->search($query, $field) !== false)
50
+				if ($element->search($query, $field)!==false)
51 51
 					$result[]=$element->asArray();
52 52
 			} else {
53 53
 				if (\array_key_exists($field, $element)) {
54 54
 					$value=$element[$field];
55
-					if (\stripos($value, $query) !== false) {
55
+					if (\stripos($value, $query)!==false) {
56 56
 						$result[]=$element;
57 57
 					}
58 58
 				}
59 59
 			}
60 60
 		}
61
-		if (\sizeof($result) > 0) {
61
+		if (\sizeof($result)>0) {
62 62
 			return $result;
63 63
 		}
64 64
 		return false;
@@ -66,13 +66,13 @@  discard block
 block discarded – undo
66 66
 
67 67
 	public function search($query, $field="title") {
68 68
 		$result=$this->_search($query, $field);
69
-		if ($result === false)
69
+		if ($result===false)
70 70
 			$result=NULL;
71 71
 		return new SearchResults($result);
72 72
 	}
73 73
 
74 74
 	public function __toString() {
75
-		$result="\"results\": " . \json_encode($this->elements);
75
+		$result="\"results\": ".\json_encode($this->elements);
76 76
 		return $result;
77 77
 	}
78 78
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	}
82 82
 
83 83
 	public function getResponse() {
84
-		return "{" . $this . "}";
84
+		return "{".$this."}";
85 85
 	}
86 86
 
87 87
 	/**
Please login to merge, or discard this patch.
Ajax/semantic/html/content/table/HtmlTableContent.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  *
12 12
  */
13 13
 class HtmlTableContent extends HtmlSemCollection {
14
-	protected $_tdTagNames=[ "thead" => "th","tbody" => "td","tfoot" => "th" ];
14
+	protected $_tdTagNames=["thead" => "th", "tbody" => "td", "tfoot" => "th"];
15 15
 
16 16
 	/**
17 17
 	 *
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 */
35 35
 	public function setRowCount($rowCount, $colCount) {
36 36
 		$count=$this->count();
37
-		for($i=$count; $i < $rowCount; $i++) {
37
+		for ($i=$count; $i<$rowCount; $i++) {
38 38
 			$this->addItem($colCount);
39 39
 		}
40 40
 		return $this;
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 		$tr=new HtmlTR("", $value);
57 57
 		$tr->setContainer($this, $count);
58 58
 		$tr->setTdTagName($this->_tdTagNames[$this->tagName]);
59
-		if (isset($value) === true) {
59
+		if (isset($value)===true) {
60 60
 			$tr->setColCount($value);
61 61
 		}
62 62
 		return $tr;
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 	 */
115 115
 	public function setCellValue($row, $col, $value="") {
116 116
 		$cell=$this->getCell($row, $col);
117
-		if (isset($cell) === true) {
117
+		if (isset($cell)===true) {
118 118
 			$cell->setValue($value);
119 119
 		}
120 120
 		return $this;
@@ -131,12 +131,12 @@  discard block
 block discarded – undo
131 131
 			$values=\array_fill(0, $count, $values);
132 132
 			$isArray=false;
133 133
 		}
134
-		if (JArray::dimension($values) == 1 && $isArray)
135
-			$values=[ $values ];
134
+		if (JArray::dimension($values)==1 && $isArray)
135
+			$values=[$values];
136 136
 
137 137
 		$count=\min(\sizeof($values), $count);
138 138
 
139
-		for($i=0; $i < $count; $i++) {
139
+		for ($i=0; $i<$count; $i++) {
140 140
 			$row=$this->content[$i];
141 141
 			$row->setValues($values[$i]);
142 142
 		}
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 			$values=\array_fill(0, $count, $values);
150 150
 		}
151 151
 		$count=\min(\sizeof($values), $count);
152
-		for($i=0; $i < $count; $i++) {
152
+		for ($i=0; $i<$count; $i++) {
153 153
 			$this->getCell($i, $colIndex)->setValue($values[$i]);
154 154
 		}
155 155
 		return $this;
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
 	public function addColVariations($colIndex, $variations=array()) {
159 159
 		$count=$this->count();
160
-		for($i=0; $i < $count; $i++) {
160
+		for ($i=0; $i<$count; $i++) {
161 161
 			$this->getCell($i, $colIndex)->addVariations($variations);
162 162
 		}
163 163
 		return $this;
@@ -174,9 +174,9 @@  discard block
 block discarded – undo
174 174
 
175 175
 	private function colAlign($colIndex, $function) {
176 176
 		$count=$this->count();
177
-		for($i=0; $i < $count; $i++) {
177
+		for ($i=0; $i<$count; $i++) {
178 178
 			$index=$this->content[$i]->getColPosition($colIndex);
179
-			if ($index !== NULL)
179
+			if ($index!==NULL)
180 180
 				$this->getCell($i, $index)->$function();
181 181
 		}
182 182
 		return $this;
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 	 */
209 209
 	public function getColCount() {
210 210
 		$result=0;
211
-		if ($this->count() > 0)
211
+		if ($this->count()>0)
212 212
 			$result=$this->getItem(0)->getColCount();
213 213
 		return $result;
214 214
 	}
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 	public function delete($rowIndex, $colIndex=NULL) {
223 223
 		if (isset($colIndex)) {
224 224
 			$row=$this->getItem($rowIndex);
225
-			if (isset($row) === true) {
225
+			if (isset($row)===true) {
226 226
 				$row->delete($colIndex);
227 227
 			}
228 228
 		} else {
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 	 */
255 255
 	public function conditionalCellFormat($callback, $format) {
256 256
 		$rows=$this->content;
257
-		foreach ( $rows as $row ) {
257
+		foreach ($rows as $row) {
258 258
 			$row->conditionalCellFormat($callback, $format);
259 259
 		}
260 260
 		return $this;
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 	 */
268 268
 	public function conditionalRowFormat($callback, $format) {
269 269
 		$rows=$this->content;
270
-		foreach ( $rows as $row ) {
270
+		foreach ($rows as $row) {
271 271
 			$row->conditionalRowFormat($callback, $format);
272 272
 		}
273 273
 		return $this;
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 	 */
280 280
 	public function applyCells($callback) {
281 281
 		$rows=$this->content;
282
-		foreach ( $rows as $row ) {
282
+		foreach ($rows as $row) {
283 283
 			$row->applyCells($callback);
284 284
 		}
285 285
 		return $this;
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 	 */
292 292
 	public function applyRows($callback) {
293 293
 		$rows=$this->content;
294
-		foreach ( $rows as $row ) {
294
+		foreach ($rows as $row) {
295 295
 			$row->apply($callback);
296 296
 		}
297 297
 		return $this;
Please login to merge, or discard this patch.
Ajax/semantic/html/content/table/HtmlTR.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -20,12 +20,12 @@  discard block
 block discarded – undo
20 20
 
21 21
 	public function __construct($identifier) {
22 22
 		parent::__construct($identifier, "tr", "");
23
-		$this->_states=[ State::ACTIVE,State::POSITIVE,State::NEGATIVE,State::WARNING,State::ERROR,State::DISABLED ];
23
+		$this->_states=[State::ACTIVE, State::POSITIVE, State::NEGATIVE, State::WARNING, State::ERROR, State::DISABLED];
24 24
 	}
25 25
 
26 26
 	public function setColCount($colCount) {
27 27
 		$count=$this->count();
28
-		for($i=$count; $i < $colCount; $i++) {
28
+		for ($i=$count; $i<$colCount; $i++) {
29 29
 			$item=$this->addItem(NULL);
30 30
 			$item->setTagName($this->_tdTagName);
31 31
 		}
@@ -68,13 +68,13 @@  discard block
 block discarded – undo
68 68
 		if (!\is_array($values)) {
69 69
 			$values=\array_fill(0, $count, $values);
70 70
 		} else {
71
-			if (JArray::isAssociative($values) === true) {
71
+			if (JArray::isAssociative($values)===true) {
72 72
 				$values=\array_values($values);
73 73
 			}
74 74
 		}
75 75
 		$count=\min(\sizeof($values), $count);
76 76
 
77
-		for($i=0; $i < $count; $i++) {
77
+		for ($i=0; $i<$count; $i++) {
78 78
 			$cell=$this->content[$i];
79 79
 			$cell->setValue($values[$i]);
80 80
 		}
@@ -101,20 +101,20 @@  discard block
 block discarded – undo
101 101
 	public function getColPosition($colIndex) {
102 102
 		$pos=0;
103 103
 		$rows=$this->_container->getContent();
104
-		for($i=0; $i < $this->_row; $i++) {
104
+		for ($i=0; $i<$this->_row; $i++) {
105 105
 			$max=\min($colIndex, $rows[$i]->count());
106
-			for($j=0; $j < $max; $j++) {
106
+			for ($j=0; $j<$max; $j++) {
107 107
 				$rowspan=$rows[$i]->getItem($j)->getRowspan();
108
-				if ($rowspan + $i > $this->_row)
108
+				if ($rowspan+$i>$this->_row)
109 109
 					$pos++;
110 110
 			}
111 111
 		}
112
-		if ($pos > $colIndex)
112
+		if ($pos>$colIndex)
113 113
 			return NULL;
114 114
 		$count=$this->count();
115
-		for($i=0; $i < $count; $i++) {
115
+		for ($i=0; $i<$count; $i++) {
116 116
 			$pos+=$this->content[$i]->getColspan();
117
-			if ($pos >= $colIndex + 1)
117
+			if ($pos>=$colIndex+1)
118 118
 				return $i;
119 119
 		}
120 120
 		return null;
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 
123 123
 	public function conditionalCellFormat($callback, $format) {
124 124
 		$cells=$this->content;
125
-		foreach ( $cells as $cell ) {
125
+		foreach ($cells as $cell) {
126 126
 			$cell->conditionalCellFormat($callback, $format);
127 127
 		}
128 128
 		return $this;
@@ -137,8 +137,8 @@  discard block
 block discarded – undo
137 137
 
138 138
 	public function containsStr($needle) {
139 139
 		$cells=$this->content;
140
-		foreach ( $cells as $cell ) {
141
-			if (\strpos($cell->getContent(), $needle) !== false)
140
+		foreach ($cells as $cell) {
141
+			if (\strpos($cell->getContent(), $needle)!==false)
142 142
 				return true;
143 143
 		}
144 144
 		return false;
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
 	public function applyCells($callback) {
153 153
 		$cells=$this->content;
154
-		foreach ( $cells as $cell ) {
154
+		foreach ($cells as $cell) {
155 155
 			$cell->apply($callback);
156 156
 		}
157 157
 		return $this;
Please login to merge, or discard this patch.
Ajax/semantic/html/base/HtmlSemNavElement.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
 	protected $_contentSeparator="";
26 26
 
27 27
 
28
-	public function __construct($identifier,$tagName,$baseClass){
29
-		parent::__construct($identifier,$tagName,$baseClass);
28
+	public function __construct($identifier, $tagName, $baseClass) {
29
+		parent::__construct($identifier, $tagName, $baseClass);
30 30
 		$this->root="";
31 31
 		$this->attr="data-ajax";
32 32
 	}
@@ -36,11 +36,11 @@  discard block
 block discarded – undo
36 36
 	 * @param string $targetSelector the target of the get
37 37
 	 * @return HtmlNavElement
38 38
 	 */
39
-	public function autoGetOnClick($targetSelector){
40
-		return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr));
39
+	public function autoGetOnClick($targetSelector) {
40
+		return $this->getOnClick($this->root, $targetSelector, array("attr"=>$this->attr));
41 41
 	}
42 42
 
43
-	public function contentAsString(){
43
+	public function contentAsString() {
44 44
 		return JArray::implode($this->_contentSeparator, $this->content);
45 45
 	}
46 46
 
@@ -48,15 +48,15 @@  discard block
 block discarded – undo
48 48
 	 * Generate the jquery script to set the elements to the HtmlNavElement
49 49
 	 * @param JsUtils $jsUtils
50 50
 	 */
51
-	public function jsSetContent(JsUtils $jsUtils){
52
-		$jsUtils->html("#".$this->identifier,str_replace("\"","'", $this->contentAsString()),true);
51
+	public function jsSetContent(JsUtils $jsUtils) {
52
+		$jsUtils->html("#".$this->identifier, str_replace("\"", "'", $this->contentAsString()), true);
53 53
 	}
54 54
 
55 55
 	public function getRoot() {
56 56
 		return $this->root;
57 57
 	}
58 58
 	public function setRoot($root) {
59
-		$this->root = $root;
59
+		$this->root=$root;
60 60
 		return $this;
61 61
 	}
62 62
 	public function getAttr() {
@@ -69,12 +69,12 @@  discard block
 block discarded – undo
69 69
 	 * @return HtmlNavElement
70 70
 	 */
71 71
 	public function setAttr($attr) {
72
-		$this->attr = $attr;
72
+		$this->attr=$attr;
73 73
 		return $this;
74 74
 	}
75 75
 
76 76
 	public function __call($method, $args) {
77
-		if(isset($this->$method) && is_callable($this->$method)) {
77
+		if (isset($this->$method) && is_callable($this->$method)) {
78 78
 			return call_user_func_array(
79 79
 					$this->$method,
80 80
 					$args
@@ -82,32 +82,32 @@  discard block
 block discarded – undo
82 82
 		}
83 83
 	}
84 84
 
85
-	abstract public function fromDispatcher(JsUtils $js,$dispatcher, $startIndex=0);
85
+	abstract public function fromDispatcher(JsUtils $js, $dispatcher, $startIndex=0);
86 86
 
87 87
 
88
-	public function setContentDivider($divider,$index=NULL) {
88
+	public function setContentDivider($divider, $index=NULL) {
89 89
 		$divider="<div class='divider'> {$divider} </div>";
90 90
 		return $this->setDivider($divider, $index);
91 91
 	}
92 92
 
93
-	public function setIconContentDivider($iconContentDivider,$index=NULL) {
93
+	public function setIconContentDivider($iconContentDivider, $index=NULL) {
94 94
 		$contentDivider="<i class='".$iconContentDivider." icon divider'></i>";
95 95
 		return $this->setDivider($contentDivider, $index);
96 96
 	}
97 97
 
98
-	protected function setDivider($divider,$index){
99
-		if(isset($index)){
100
-			if(!\is_array($this->_contentSeparator))
101
-				$this->_contentSeparator=array_fill (0, $this->count()-1,$this->_contentSeparator);
98
+	protected function setDivider($divider, $index) {
99
+		if (isset($index)) {
100
+			if (!\is_array($this->_contentSeparator))
101
+				$this->_contentSeparator=array_fill(0, $this->count()-1, $this->_contentSeparator);
102 102
 			$this->_contentSeparator[$index]=$divider;
103
-		}else{
103
+		} else {
104 104
 			$this->_contentSeparator=$divider;
105 105
 		}
106 106
 		return $this;
107 107
 	}
108 108
 
109
-	protected function getContentDivider($index){
110
-		if(\is_array($this->_contentSeparator)){
109
+	protected function getContentDivider($index) {
110
+		if (\is_array($this->_contentSeparator)) {
111 111
 			return @$this->_contentSeparator[$index];
112 112
 		}
113 113
 		return $this->_contentSeparator;
Please login to merge, or discard this patch.
Ajax/semantic/html/base/constants/State.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 			$state=\explode(" ", $state);
14 14
 		}
15 15
 		if (\is_array($elements)) {
16
-			foreach ( $elements as $element ) {
16
+			foreach ($elements as $element) {
17 17
 				if ($element instanceof BaseHtml) {
18 18
 					self::_add($state, $element);
19 19
 				}
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
 	}
23 23
 
24 24
 	private static function _add($states, $element) {
25
-		foreach ( $states as $state ) {
26
-			$element->addToPropertyCtrl("class", $state, array ($state ));
25
+		foreach ($states as $state) {
26
+			$element->addToPropertyCtrl("class", $state, array($state));
27 27
 		}
28 28
 	}
29 29
 }
30 30
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/widgets/datatable/Pagination.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -8,34 +8,34 @@  discard block
 block discarded – undo
8 8
 	private $page_count;
9 9
 	private $pages_visibles;
10 10
 
11
-	public function __construct($items_per_page=10,$pages_visibles=4,$page=1){
11
+	public function __construct($items_per_page=10, $pages_visibles=4, $page=1) {
12 12
 		$this->items_per_page=$items_per_page;
13 13
 		$this->page=$page;
14 14
 		$this->pages_visibles=$pages_visibles;
15 15
 		$this->visible=true;
16 16
 	}
17 17
 
18
-	public function getObjects($objects){
19
-		$offset = ($this->page - 1) * $this->items_per_page;
18
+	public function getObjects($objects) {
19
+		$offset=($this->page-1)*$this->items_per_page;
20 20
 		$os=$objects;
21
-		if(!\is_array($os)){
21
+		if (!\is_array($os)) {
22 22
 			$os=[];
23
-			foreach ($objects as $o){
23
+			foreach ($objects as $o) {
24 24
 				$os[]=$o;
25 25
 			}
26 26
 		}
27
-		$this->page_count = 0;
27
+		$this->page_count=0;
28 28
 		$row_count=\sizeof($os);
29
-		if (0 === $row_count) {
29
+		if (0===$row_count) {
30 30
 			$this->visible=false;
31 31
 		} else {
32 32
 			$this->visible=true;
33
-			$this->page_count = (int)ceil($row_count / $this->items_per_page);
34
-			if($this->page > $this->page_count+1) {
35
-				$this->page = 1;
33
+			$this->page_count=(int)ceil($row_count/$this->items_per_page);
34
+			if ($this->page>$this->page_count+1) {
35
+				$this->page=1;
36 36
 			}
37 37
 		}
38
-		return array_slice($os, $offset,$this->items_per_page);
38
+		return array_slice($os, $offset, $this->items_per_page);
39 39
 	}
40 40
 
41 41
 	public function getItemsPerPage() {
@@ -69,14 +69,14 @@  discard block
 block discarded – undo
69 69
 		return $this->page_count;
70 70
 	}
71 71
 
72
-	public function getPagesNumbers(){
73
-		$middle= (int)ceil(($this->pages_visibles-1)/ 2);
72
+	public function getPagesNumbers() {
73
+		$middle=(int)ceil(($this->pages_visibles-1)/2);
74 74
 		$first=$this->page-$middle;
75
-		if($first<1){
75
+		if ($first<1) {
76 76
 			$first=1;
77 77
 		}
78 78
 		$last=$first+$this->pages_visibles-1;
79
-		if($last>$this->page_count){
79
+		if ($last>$this->page_count) {
80 80
 			$last=$this->page_count;
81 81
 		}
82 82
 		return \range($first, $last);
Please login to merge, or discard this patch.