Completed
Push — master ( d88325...fa0c00 )
by Jean-Christophe
03:31
created
Ajax/semantic/html/base/traits/TextAlignmentTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 	 * @param string $value
11 11
 	 * @return \Ajax\semantic\html\base\HtmlSemDoubleElement
12 12
 	 */
13
-	public function setTextAlignment($value=TextAlignment::LEFT){
14
-		return $this->addToPropertyCtrl("class", $value,TextAlignment::getConstants());
13
+	public function setTextAlignment($value=TextAlignment::LEFT) {
14
+		return $this->addToPropertyCtrl("class", $value, TextAlignment::getConstants());
15 15
 	}
16 16
 }
17 17
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlIconGroups.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,21 +11,21 @@
 block discarded – undo
11 11
  */
12 12
 class HtmlIconGroups extends HtmlSemDoubleElement {
13 13
 
14
-	public function __construct($identifier,$size="") {
15
-		parent::__construct($identifier, "i","icons");
14
+	public function __construct($identifier, $size="") {
15
+		parent::__construct($identifier, "i", "icons");
16 16
 		$this->setSize($size);
17 17
 	}
18 18
 
19
-	public function add($icon,$size=""){
19
+	public function add($icon, $size="") {
20 20
 		$iconO=$icon;
21
-		if(\is_string($icon)){
21
+		if (\is_string($icon)) {
22 22
 			$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
23 23
 			$iconO->setSize($size);
24 24
 		}
25 25
 		$this->addContent($iconO);
26 26
 	}
27 27
 
28
-	public function getIcon($index){
28
+	public function getIcon($index) {
29 29
 		return $this->content[$index];
30 30
 	}
31 31
 }
32 32
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlSegment.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -17,11 +17,11 @@  discard block
 block discarded – undo
17 17
  * @version 1.001
18 18
  */
19 19
 class HtmlSegment extends HtmlSemDoubleElement {
20
-	use AttachedTrait,TextAlignmentTrait;
20
+	use AttachedTrait, TextAlignmentTrait;
21 21
 	public function __construct($identifier, $content="") {
22
-		parent::__construct($identifier, "div","ui segment");
23
-		$this->_variations=\array_merge($this->_variations,[Variation::PADDED,Variation::COMPACT]);
24
-		$this->_states=\array_merge($this->_states,[State::LOADING]);
22
+		parent::__construct($identifier, "div", "ui segment");
23
+		$this->_variations=\array_merge($this->_variations, [Variation::PADDED, Variation::COMPACT]);
24
+		$this->_states=\array_merge($this->_states, [State::LOADING]);
25 25
 		$this->content=$content;
26 26
 	}
27 27
 
@@ -30,36 +30,36 @@  discard block
 block discarded – undo
30 30
 	 * @param string $type one of "raised","stacked","piled" default : ""
31 31
 	 * @return \Ajax\semantic\html\elements\HtmlSegment
32 32
 	 */
33
-	public function setType($type){
33
+	public function setType($type) {
34 34
 		return $this->addToPropertyCtrl("class", $type, SegmentType::getConstants());
35 35
 	}
36 36
 
37
-	public function setSens($sens="vertical"){
38
-		return $this->addToPropertyCtrl("class", $sens, array("vertical","horizontal"));
37
+	public function setSens($sens="vertical") {
38
+		return $this->addToPropertyCtrl("class", $sens, array("vertical", "horizontal"));
39 39
 	}
40 40
 
41 41
 
42
-	public function setEmphasis($value=Emphasis::SECONDARY){
42
+	public function setEmphasis($value=Emphasis::SECONDARY) {
43 43
 		return $this->addToPropertyCtrl("class", $value, Emphasis::getConstants());
44 44
 	}
45 45
 
46
-	public function setCircular(){
46
+	public function setCircular() {
47 47
 		return $this->addToProperty("class", "circular");
48 48
 	}
49 49
 
50
-	public function clear(){
50
+	public function clear() {
51 51
 		return $this->addToProperty("class", "clearing");
52 52
 	}
53 53
 
54
-	public function setFloating($value="left"){
55
-		return $this->addToPropertyCtrl("class", "floated ".$value,array("floated right","floated left"));
54
+	public function setFloating($value="left") {
55
+		return $this->addToPropertyCtrl("class", "floated ".$value, array("floated right", "floated left"));
56 56
 	}
57 57
 
58
-	public function setCompact(){
58
+	public function setCompact() {
59 59
 		return $this->addToProperty("class", "compact");
60 60
 	}
61 61
 
62
-	public function setBasic(){
62
+	public function setBasic() {
63 63
 		return $this->setProperty("class", "ui basic segment");
64 64
 	}
65 65
 
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlListItem.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@
 block discarded – undo
7 7
 
8 8
 class HtmlListItem extends HtmlSemDoubleElement {
9 9
 	protected $image;
10
-	public function __construct($identifier,$content) {
10
+	public function __construct($identifier, $content) {
11 11
 		parent::__construct($identifier, "div", "item");
12 12
 		$this->_template='<%tagName% id="%identifier%" %properties%>%image%%content%</%tagName%>';
13 13
 		$this->content=$content;
14 14
 	}
15
-	public function addIcon($icon){
15
+	public function addIcon($icon) {
16 16
 		$content=$this->content;
17
-		$this->content=new HtmlSemDoubleElement("content-".$this->identifier,"div","content");
17
+		$this->content=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content");
18 18
 		$this->content->setContent($content);
19
-		$this->content->addContent(new HtmlIcon("icon".$this->identifier, $icon),true);
19
+		$this->content->addContent(new HtmlIcon("icon".$this->identifier, $icon), true);
20 20
 	}
21 21
 }
22 22
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/base/constants/Variation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,5 +5,5 @@
 block discarded – undo
5 5
 use Ajax\common\BaseEnum;
6 6
 
7 7
 abstract class Variation extends BaseEnum {
8
-	const ANIMATED="animated",AVATAR="avatar",COMPACT="compact",FLUID="fluid",INVERTED="inverted",PADDED="padded",TRANSPARENT="transparent";
8
+	const ANIMATED="animated", AVATAR="avatar", COMPACT="compact", FLUID="fluid", INVERTED="inverted", PADDED="padded", TRANSPARENT="transparent";
9 9
 }
10 10
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlMenuItem.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@
 block discarded – undo
7 7
 
8 8
 class HtmlListItem extends HtmlSemDoubleElement {
9 9
 	protected $image;
10
-	public function __construct($identifier,$content) {
10
+	public function __construct($identifier, $content) {
11 11
 		parent::__construct($identifier, "div", "item");
12 12
 		$this->_template='<%tagName% id="%identifier%" %properties%>%image%%content%</%tagName%>';
13 13
 		$this->content=$content;
14 14
 	}
15
-	public function addIcon($icon){
15
+	public function addIcon($icon) {
16 16
 		$content=$this->content;
17
-		$this->content=new HtmlSemDoubleElement("content-".$this->identifier,"div","content");
17
+		$this->content=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content");
18 18
 		$this->content->setContent($content);
19
-		$this->content->addContent(new HtmlIcon("icon".$this->identifier, $icon),true);
19
+		$this->content->addContent(new HtmlIcon("icon".$this->identifier, $icon), true);
20 20
 	}
21 21
 }
22 22
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlSegmentGroups.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -6,20 +6,20 @@  discard block
 block discarded – undo
6 6
 use Ajax\semantic\html\base\HtmlSemCollection;
7 7
 use Ajax\semantic\html\base\constants\Sens;
8 8
 
9
-class HtmlSegmentGroups extends HtmlSemCollection{
9
+class HtmlSegmentGroups extends HtmlSemCollection {
10 10
 
11 11
 
12
-	public function __construct( $identifier, $items=array()){
13
-		parent::__construct( $identifier, "div","ui segments");
12
+	public function __construct($identifier, $items=array()) {
13
+		parent::__construct($identifier, "div", "ui segments");
14 14
 		$this->addItems($items);
15 15
 	}
16 16
 
17 17
 
18
-	protected function createItem($value){
19
-		return new HtmlSegment("segment-".$this->count(),$value);
18
+	protected function createItem($value) {
19
+		return new HtmlSegment("segment-".$this->count(), $value);
20 20
 	}
21 21
 
22
-	protected function createCondition($value){
22
+	protected function createCondition($value) {
23 23
 		return !($value instanceof HtmlSegment);
24 24
 	}
25 25
 
@@ -28,16 +28,16 @@  discard block
 block discarded – undo
28 28
 	 * @param string $type one of "raised","stacked","piled" default : ""
29 29
 	 * @return \Ajax\semantic\html\elements\HtmlSegmentGroups
30 30
 	 */
31
-	public function setType($type){
31
+	public function setType($type) {
32 32
 		return $this->addToPropertyCtrl("class", $type, SegmentType::getConstants());
33 33
 	}
34 34
 
35
-	public function setSens($sens=Sens::VERTICAL){
35
+	public function setSens($sens=Sens::VERTICAL) {
36 36
 		return $this->addToPropertyCtrl("class", $sens, Sens::getConstants());
37 37
 	}
38 38
 
39
-	public static function group($identifier,$items=array(),$type="",$sens=Sens::VERTICAL){
40
-		$group=new HtmlSegmentGroups($identifier,$items);
39
+	public static function group($identifier, $items=array(), $type="", $sens=Sens::VERTICAL) {
40
+		$group=new HtmlSegmentGroups($identifier, $items);
41 41
 		$group->setSens($sens);
42 42
 		return $group->setType($type);
43 43
 	}
Please login to merge, or discard this patch.
Ajax/common/html/BaseHtml.php 3 patches
Braces   +26 added lines, -18 removed lines patch added patch discarded remove patch
@@ -50,16 +50,18 @@  discard block
 block discarded – undo
50 50
 	}
51 51
 
52 52
 	public function getProperty($name) {
53
-		if (array_key_exists($name, $this->properties))
54
-			return $this->properties [$name];
53
+		if (array_key_exists($name, $this->properties)) {
54
+					return $this->properties [$name];
55
+		}
55 56
 	}
56 57
 
57 58
 	public function addToProperty($name, $value, $separator=" ") {
58 59
 		$v=@$this->properties[$name];
59
-		if (isset($v)&&$v!=="")
60
-			$v=$v.$separator.$value;
61
-		else
62
-			$v=$value;
60
+		if (isset($v)&&$v!=="") {
61
+					$v=$v.$separator.$value;
62
+		} else {
63
+					$v=$value;
64
+		}
63 65
 
64 66
 		return $this->setProperty($name, $v);
65 67
 	}
@@ -117,8 +119,9 @@  discard block
 block discarded – undo
117 119
 	}
118 120
 
119 121
 	protected function setPropertyCtrl($name, $value, $typeCtrl) {
120
-		if ($this->ctrl($name, $value, $typeCtrl)===true)
121
-			return $this->setProperty($name, $value);
122
+		if ($this->ctrl($name, $value, $typeCtrl)===true) {
123
+					return $this->setProperty($name, $value);
124
+		}
122 125
 		return $this;
123 126
 	}
124 127
 
@@ -143,8 +146,9 @@  discard block
 block discarded – undo
143 146
 	}
144 147
 
145 148
 	protected function removeProperty($name){
146
-		if(\array_key_exists($name, $this->properties))
147
-			unset($this->properties[$name]);
149
+		if(\array_key_exists($name, $this->properties)) {
150
+					unset($this->properties[$name]);
151
+		}
148 152
 		return $this;
149 153
 	}
150 154
 
@@ -164,8 +168,9 @@  discard block
 block discarded – undo
164 168
 	}
165 169
 
166 170
 	protected function addToPropertyUnique($name, $value, $typeCtrl) {
167
-		if (@class_exists($typeCtrl, true))
168
-			$typeCtrl=$typeCtrl::getConstants();
171
+		if (@class_exists($typeCtrl, true)) {
172
+					$typeCtrl=$typeCtrl::getConstants();
173
+		}
169 174
 		if (is_array($typeCtrl)) {
170 175
 			$this->removeOldValues($this->properties [$name], $typeCtrl);
171 176
 		}
@@ -348,15 +353,18 @@  discard block
 block discarded – undo
348 353
 			$flag=false;
349 354
 			$index=0;
350 355
 			while ( !$flag&&$index<sizeof($elements) ) {
351
-				if ($elements [$index] instanceof BaseHtml)
352
-					$flag=($elements [$index]->getIdentifier()===$identifier);
356
+				if ($elements [$index] instanceof BaseHtml) {
357
+									$flag=($elements [$index]->getIdentifier()===$identifier);
358
+				}
353 359
 				$index++;
354 360
 			}
355
-			if ($flag===true)
356
-				return $elements [$index-1];
361
+			if ($flag===true) {
362
+							return $elements [$index-1];
363
+			}
357 364
 		} elseif ($elements instanceof BaseHtml) {
358
-			if ($elements->getIdentifier()===$identifier)
359
-				return $elements;
365
+			if ($elements->getIdentifier()===$identifier) {
366
+							return $elements;
367
+			}
360 368
 		}
361 369
 		return null;
362 370
 	}
Please login to merge, or discard this patch.
Doc Comments   +39 added lines patch added patch discarded remove patch
@@ -109,6 +109,10 @@  discard block
 block discarded – undo
109 109
 		return true;
110 110
 	}
111 111
 
112
+	/**
113
+	 * @param string $propertyName
114
+	 * @param string $value
115
+	 */
112 116
 	protected function propertyContains($propertyName,$value){
113 117
 		$values=$this->getProperty($propertyName);
114 118
 		if(isset($values)){
@@ -138,22 +142,36 @@  discard block
 block discarded – undo
138 142
 		return $this;
139 143
 	}
140 144
 
145
+	/**
146
+	 * @param string $name
147
+	 * @param string $value
148
+	 */
141 149
 	protected function removePropertyValue($name,$value){
142 150
 		$this->properties[$name]=\str_replace($value, "", $this->properties[$name]);
143 151
 		return $this;
144 152
 	}
145 153
 
154
+	/**
155
+	 * @param string $name
156
+	 */
146 157
 	protected function removePropertyValues($name,$values){
147 158
 		$this->removeOldValues($this->properties[$name], $values);
148 159
 		return $this;
149 160
 	}
150 161
 
162
+	/**
163
+	 * @param string $name
164
+	 */
151 165
 	protected function removeProperty($name){
152 166
 		if(\array_key_exists($name, $this->properties))
153 167
 			unset($this->properties[$name]);
154 168
 		return $this;
155 169
 	}
156 170
 
171
+	/**
172
+	 * @param string $name
173
+	 * @param string[] $typeCtrl
174
+	 */
157 175
 	protected function addToMemberCtrl(&$name, $value, $typeCtrl, $separator=" ") {
158 176
 		if ($this->ctrl($name, $value, $typeCtrl)===true) {
159 177
 			if (is_array($typeCtrl)) {
@@ -178,6 +196,9 @@  discard block
 block discarded – undo
178 196
 		return $this->addToProperty($name, $value);
179 197
 	}
180 198
 
199
+	/**
200
+	 * @param string $name
201
+	 */
181 202
 	public function addToPropertyCtrl($name, $value, $typeCtrl) {
182 203
 		// if($this->ctrl($name, $value, $typeCtrl)===true){
183 204
 		return $this->addToPropertyUnique($name, $value, $typeCtrl);
@@ -317,6 +338,9 @@  discard block
 block discarded – undo
317 338
 		}
318 339
 	}
319 340
 
341
+	/**
342
+	 * @param string $operation
343
+	 */
320 344
 	public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) {
321 345
 		$params=array (
322 346
 				"url" => $url,
@@ -327,14 +351,23 @@  discard block
 block discarded – undo
327 351
 		return $this;
328 352
 	}
329 353
 
354
+	/**
355
+	 * @param string $event
356
+	 */
330 357
 	public function getOn($event, $url, $responseElement="", $parameters=array()) {
331 358
 		return $this->_ajaxOn("get", $event, $url, $responseElement, $parameters);
332 359
 	}
333 360
 
361
+	/**
362
+	 * @param string $url
363
+	 */
334 364
 	public function getOnClick($url, $responseElement="", $parameters=array()) {
335 365
 		return $this->getOn("click", $url, $responseElement, $parameters);
336 366
 	}
337 367
 
368
+	/**
369
+	 * @param string $event
370
+	 */
338 371
 	public function postOn($event, $url, $params="{}", $responseElement="", $parameters=array()) {
339 372
 		$parameters ["params"]=$params;
340 373
 		return $this->_ajaxOn("post", $event, $url, $responseElement, $parameters);
@@ -344,6 +377,9 @@  discard block
 block discarded – undo
344 377
 		return $this->postOn("click", $url, $params, $responseElement, $parameters);
345 378
 	}
346 379
 
380
+	/**
381
+	 * @param string $event
382
+	 */
347 383
 	public function postFormOn($event, $url, $form, $responseElement="", $parameters=array()) {
348 384
 		$parameters ["form"]=$form;
349 385
 		return $this->_ajaxOn("postForm", $event, $url, $responseElement, $parameters);
@@ -393,6 +429,9 @@  discard block
 block discarded – undo
393 429
 		return $value;
394 430
 	}
395 431
 
432
+	/**
433
+	 * @param string $jqueryCall
434
+	 */
396 435
 	public function jsDoJquery($jqueryCall, $param=""){
397 436
 		return "$('#".$this->identifier."').".$jqueryCall."(".$this->_prep_value($param).");";
398 437
 	}
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
 abstract class BaseHtml extends BaseWidget {
18 18
 	protected $_template;
19 19
 	protected $tagName;
20
-	protected $properties=array ();
21
-	protected $_events=array ();
20
+	protected $properties=array();
21
+	protected $_events=array();
22 22
 	protected $_wrapBefore=array();
23 23
 	protected $_wrapAfter=array();
24 24
 	protected $_bsComponent;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
 	public function addToProperty($name, $value, $separator=" ") {
59 59
 		$v=@$this->properties[$name];
60
-		if (isset($v)&&$v!=="")
60
+		if (isset($v) && $v!=="")
61 61
 			$v=$v.$separator.$value;
62 62
 		else
63 63
 			$v=$value;
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
 
73 73
 	public function compile(JsUtils $js=NULL, View $view=NULL) {
74 74
 		$result=$this->getTemplate($js);
75
-		foreach ( $this as $key => $value ) {
76
-			if (PhalconUtils::startsWith($key, "_")===false&&$key!=="events") {
75
+		foreach ($this as $key => $value) {
76
+			if (PhalconUtils::startsWith($key, "_")===false && $key!=="events") {
77 77
 				if (is_array($value)) {
78 78
 					$v=PropertyWrapper::wrap($value, $js);
79
-				} else {
79
+				}else {
80 80
 					$v=$value;
81 81
 				}
82 82
 				$result=str_ireplace("%".$key."%", $v, $result);
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 		if (isset($view)===true) {
89 89
 			$controls=$view->getVar("q");
90 90
 			if (isset($controls)===false) {
91
-				$controls=array ();
91
+				$controls=array();
92 92
 			}
93 93
 			$controls [$this->identifier]=$result;
94 94
 			$view->setVar("q", $controls);
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 			if (array_search($value, $typeCtrl)===false) {
102 102
 				throw new \Exception("La valeur passée a propriété `".$name."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
103 103
 			}
104
-		} else {
104
+		}else {
105 105
 			if (!$typeCtrl($value)) {
106 106
 				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$name);
107 107
 			}
@@ -109,9 +109,9 @@  discard block
 block discarded – undo
109 109
 		return true;
110 110
 	}
111 111
 
112
-	protected function propertyContains($propertyName,$value){
112
+	protected function propertyContains($propertyName, $value) {
113 113
 		$values=$this->getProperty($propertyName);
114
-		if(isset($values)){
114
+		if (isset($values)) {
115 115
 			return JString::contains($values, $value);
116 116
 		}
117 117
 		return false;
@@ -138,18 +138,18 @@  discard block
 block discarded – undo
138 138
 		return $this;
139 139
 	}
140 140
 
141
-	protected function removePropertyValue($name,$value){
141
+	protected function removePropertyValue($name, $value) {
142 142
 		$this->properties[$name]=\str_replace($value, "", $this->properties[$name]);
143 143
 		return $this;
144 144
 	}
145 145
 
146
-	protected function removePropertyValues($name,$values){
146
+	protected function removePropertyValues($name, $values) {
147 147
 		$this->removeOldValues($this->properties[$name], $values);
148 148
 		return $this;
149 149
 	}
150 150
 
151
-	protected function removeProperty($name){
152
-		if(\array_key_exists($name, $this->properties))
151
+	protected function removeProperty($name) {
152
+		if (\array_key_exists($name, $this->properties))
153 153
 			unset($this->properties[$name]);
154 154
 		return $this;
155 155
 	}
@@ -206,28 +206,28 @@  discard block
 block discarded – undo
206 206
 	}
207 207
 
208 208
 	public function fromArray($array) {
209
-		foreach ( $this as $key => $value ) {
209
+		foreach ($this as $key => $value) {
210 210
 			if (array_key_exists($key, $array) && !PhalconUtils::startsWith($key, "_")) {
211 211
 					$setter="set".ucfirst($key);
212 212
 					$this->$setter($array [$key]);
213 213
 				unset($array [$key]);
214 214
 			}
215 215
 		}
216
-		foreach ( $array as $key => $value ) {
216
+		foreach ($array as $key => $value) {
217 217
 			if (method_exists($this, $key)) {
218 218
 				try {
219 219
 					$this->$key($value);
220 220
 					unset($array [$key]);
221
-				} catch ( \Exception $e ) {
221
+				} catch (\Exception $e) {
222 222
 					// Nothing to do
223 223
 				}
224
-			} else {
224
+			}else {
225 225
 				$setter="set".ucfirst($key);
226 226
 				if (method_exists($this, $setter)) {
227 227
 					try {
228 228
 						$this->$setter($value);
229 229
 						unset($array [$key]);
230
-					} catch ( \Exception $e ) {
230
+					} catch (\Exception $e) {
231 231
 						// Nothing to do
232 232
 					}
233 233
 				}
@@ -236,21 +236,21 @@  discard block
 block discarded – undo
236 236
 		return $array;
237 237
 	}
238 238
 
239
-	public function fromDatabaseObjects($objects,$function) {
240
-		if(isset($objects)){
241
-			foreach ($objects as $object){
242
-				$this->fromDatabaseObject($object,$function);
239
+	public function fromDatabaseObjects($objects, $function) {
240
+		if (isset($objects)) {
241
+			foreach ($objects as $object) {
242
+				$this->fromDatabaseObject($object, $function);
243 243
 			}
244 244
 		}
245 245
 		return $this;
246 246
 	}
247 247
 
248
-	public function fromDatabaseObject($object,$function){
248
+	public function fromDatabaseObject($object, $function) {
249 249
 
250 250
 	}
251 251
 
252 252
 	public function wrap($before, $after="") {
253
-		if(isset($before)){
253
+		if (isset($before)) {
254 254
 			$this->_wrapBefore[]=$before;
255 255
 		}
256 256
 		$this->_wrapAfter[]=$after;
@@ -271,13 +271,13 @@  discard block
 block discarded – undo
271 271
 		if (array_key_exists($event, $this->_events)) {
272 272
 			if (is_array($this->_events [$event])) {
273 273
 				$this->_events [$event] []=$jsCode;
274
-			} else {
275
-				$this->_events [$event]=array (
274
+			}else {
275
+				$this->_events [$event]=array(
276 276
 						$this->_events [$event],
277 277
 						$jsCode
278 278
 				);
279 279
 			}
280
-		} else {
280
+		}else {
281 281
 			$this->_events [$event]=$jsCode;
282 282
 		}
283 283
 		return $this;
@@ -297,14 +297,14 @@  discard block
 block discarded – undo
297 297
 
298 298
 	public function addEventsOnRun(JsUtils $js) {
299 299
 		if (isset($this->_bsComponent)) {
300
-			foreach ( $this->_events as $event => $jsCode ) {
300
+			foreach ($this->_events as $event => $jsCode) {
301 301
 				$code=$jsCode;
302 302
 				if (is_array($jsCode)) {
303 303
 					$code="";
304
-					foreach ( $jsCode as $jsC ) {
304
+					foreach ($jsCode as $jsC) {
305 305
 						if ($jsC instanceof AjaxCall) {
306 306
 							$code.="\n".$jsC->compile($js);
307
-						} else {
307
+						}else {
308 308
 							$code.="\n".$jsC;
309 309
 						}
310 310
 					}
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 	}
319 319
 
320 320
 	public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) {
321
-		$params=array (
321
+		$params=array(
322 322
 				"url" => $url,
323 323
 				"responseElement" => $responseElement
324 324
 		);
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 		if (is_array($elements)) {
358 358
 			$flag=false;
359 359
 			$index=0;
360
-			while ( !$flag&&$index<sizeof($elements) ) {
360
+			while (!$flag && $index<sizeof($elements)) {
361 361
 				if ($elements [$index] instanceof BaseHtml)
362 362
 					$flag=($elements [$index]->getIdentifier()===$identifier);
363 363
 				$index++;
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 		return null;
372 372
 	}
373 373
 
374
-	public function __toString(){
374
+	public function __toString() {
375 375
 		return $this->compile();
376 376
 	}
377 377
 
@@ -387,29 +387,29 @@  discard block
 block discarded – undo
387 387
 		if (is_array($value)) {
388 388
 			$value=implode(",", $value);
389 389
 		}
390
-		if (strrpos($value, 'this')===false&&strrpos($value, 'event')===false) {
390
+		if (strrpos($value, 'this')===false && strrpos($value, 'event')===false) {
391 391
 			$value='"'.$value.'"';
392 392
 		}
393 393
 		return $value;
394 394
 	}
395 395
 
396
-	public function jsDoJquery($jqueryCall, $param=""){
396
+	public function jsDoJquery($jqueryCall, $param="") {
397 397
 		return "$('#".$this->identifier."').".$jqueryCall."(".$this->_prep_value($param).");";
398 398
 	}
399 399
 
400
-	public function executeOnRun($jsCode){
400
+	public function executeOnRun($jsCode) {
401 401
 		return $this->_addEvent("execute", $jsCode);
402 402
 	}
403 403
 
404
-	public function jsHtml($content=""){
405
-		return $this->jsDoJquery("html",$content);
404
+	public function jsHtml($content="") {
405
+		return $this->jsDoJquery("html", $content);
406 406
 	}
407 407
 
408
-	public function jsShow(){
408
+	public function jsShow() {
409 409
 		return $this->jsDoJquery("show");
410 410
 	}
411 411
 
412
-	public function jsHide(){
412
+	public function jsHide() {
413 413
 		return $this->jsDoJquery("hide");
414 414
 	}
415 415
 
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlBreadcrumb.php 3 patches
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
  * @author jc
15 15
  * @version 1.001
16 16
  */
17
-class HtmlBreadcrumb extends HtmlSemNavElement{
17
+class HtmlBreadcrumb extends HtmlSemNavElement {
18 18
 	/**
19 19
 	 * @var integer the start index for href generation
20 20
 	 */
@@ -40,13 +40,13 @@  discard block
 block discarded – undo
40 40
 	 * @param boolean $autoActive sets the last element's class to <b>active</b> if true
41 41
 	 * @param function $hrefFunction the function who generates the href elements. default : function($e){return $e->getContent()}
42 42
 	 */
43
-	public function __construct( $identifier,$items=array(),$autoActive=true,$startIndex=0,$hrefFunction=NULL){
44
-		parent::__construct( $identifier, "div", "ui breadcrumb");
43
+	public function __construct($identifier, $items=array(), $autoActive=true, $startIndex=0, $hrefFunction=NULL) {
44
+		parent::__construct($identifier, "div", "ui breadcrumb");
45 45
 		$this->startIndex=$startIndex;
46 46
 		$this->autoActive=$autoActive;
47 47
 		$this->_contentSeparator="<div class='divider'> / </div>";
48
-		$this->_hrefFunction=function ($e){return $e->getContent();};
49
-		if(isset($hrefFunction)){
48
+		$this->_hrefFunction=function($e) {return $e->getContent(); };
49
+		if (isset($hrefFunction)) {
50 50
 			$this->_hrefFunction=$hrefFunction;
51 51
 		}
52 52
 		$this->addItems($items);
@@ -59,23 +59,23 @@  discard block
 block discarded – undo
59 59
 	 * @param string $attr the html attribute used to build the elements url
60 60
 	 * @return HtmlBreadcrumbs
61 61
 	 */
62
-	public function autoGetOnClick($targetSelector){
63
-		return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr));
62
+	public function autoGetOnClick($targetSelector) {
63
+		return $this->getOnClick($this->root, $targetSelector, array("attr"=>$this->attr));
64 64
 	}
65 65
 
66
-	public function contentAsString(){
67
-		if($this->autoActive){
66
+	public function contentAsString() {
67
+		if ($this->autoActive) {
68 68
 			$this->setActive();
69 69
 		}
70 70
 		return parent::contentAsString();
71 71
 	}
72 72
 
73
-	public function setActive($index=null){
74
-		if(!isset($index)){
73
+	public function setActive($index=null) {
74
+		if (!isset($index)) {
75 75
 			$index=sizeof($this->content)-1;
76 76
 		}
77 77
 		$activeItem=$this->content[$index];
78
-		$activeItem->addToProperty("class","active");
78
+		$activeItem->addToProperty("class", "active");
79 79
 		$activeItem->setTagName("div");
80 80
 	}
81 81
 
@@ -84,15 +84,15 @@  discard block
 block discarded – undo
84 84
 	 * @param Dispatcher $dispatcher the request dispatcher
85 85
 	 * @return \Ajax\bootstrap\html\HtmlBreadcrumbs
86 86
 	 */
87
-	public function fromDispatcher($dispatcher,$startIndex=0){
87
+	public function fromDispatcher($dispatcher, $startIndex=0) {
88 88
 		$this->startIndex=$startIndex;
89 89
 		$params=$dispatcher->getParams();
90 90
 		$action=$dispatcher->getActionName();
91 91
 		$items=array($dispatcher->getControllerName());
92
-		if(\sizeof($params)>0 || \strtolower($action)!="index" ){
92
+		if (\sizeof($params)>0 || \strtolower($action)!="index") {
93 93
 			$items[]=$action;
94
-			foreach ($params as $p){
95
-				if(\is_object($p)===false)
94
+			foreach ($params as $p) {
95
+				if (\is_object($p)===false)
96 96
 					$items[]=$p;
97 97
 			}
98 98
 		}
@@ -105,14 +105,14 @@  discard block
 block discarded – undo
105 105
 	 * @param string $separator
106 106
 	 * @return string
107 107
 	 */
108
-	public function getHref($index=null,$separator="/"){
109
-		if(!isset($index)){
108
+	public function getHref($index=null, $separator="/") {
109
+		if (!isset($index)) {
110 110
 			$index=sizeof($this->content);
111 111
 		}
112
-		if($this->absolutePaths===true){
112
+		if ($this->absolutePaths===true) {
113 113
 			return $this->_hrefFunction($this->content[$index]);
114
-		}else{
115
-			return $this->root.implode($separator, array_slice(array_map(function($e){return $this->_hrefFunction($e);}, $this->content),$this->startIndex,$index+1));
114
+		}else {
115
+			return $this->root.implode($separator, array_slice(array_map(function($e) {return $this->_hrefFunction($e); }, $this->content), $this->startIndex, $index+1));
116 116
 		}
117 117
 	}
118 118
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 	 * @return \Ajax\bootstrap\html\HtmlBreadcrumbs
123 123
 	 */
124 124
 	public function setHrefFunction($_hrefFunction) {
125
-		$this->_hrefFunction = $_hrefFunction;
125
+		$this->_hrefFunction=$_hrefFunction;
126 126
 		return $this;
127 127
 	}
128 128
 
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 	}
133 133
 
134 134
 	public function setAutoActive($autoActive) {
135
-		$this->autoActive = $autoActive;
135
+		$this->autoActive=$autoActive;
136 136
 		return $this;
137 137
 	}
138 138
 
@@ -141,11 +141,11 @@  discard block
 block discarded – undo
141 141
 	 * @see \Ajax\bootstrap\html\BaseHtml::compile()
142 142
 	 */
143 143
 	public function compile(JsUtils $js=NULL, View $view=NULL) {
144
-		if($this->autoActive){
144
+		if ($this->autoActive) {
145 145
 			$this->setActive();
146 146
 		}
147 147
 		$count=$this->count();
148
-		for($i=1;$i<$count;$i++){
148
+		for ($i=1; $i<$count; $i++) {
149 149
 			$this->content[$i]->wrap($this->getContentDivider($i-1));
150 150
 		}
151 151
 		return parent::compile($js, $view);
@@ -156,16 +156,16 @@  discard block
 block discarded – undo
156 156
 	 * @see \Ajax\bootstrap\html\base\BaseHtml::on()
157 157
 	 */
158 158
 	public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) {
159
-		foreach ($this->content as $element){
160
-				$element->on($event,$jsCode,$stopPropagation,$preventDefault);
159
+		foreach ($this->content as $element) {
160
+				$element->on($event, $jsCode, $stopPropagation, $preventDefault);
161 161
 		}
162 162
 		return $this;
163 163
 	}
164 164
 
165 165
 
166 166
 	public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) {
167
-		foreach ($this->content as $element){
168
-			if($element->getProperty($this->attr)!=NULL)
167
+		foreach ($this->content as $element) {
168
+			if ($element->getProperty($this->attr)!=NULL)
169 169
 				$element->_ajaxOn($operation, $event, $url, $responseElement, $parameters);
170 170
 		}
171 171
 		return $this;
@@ -177,35 +177,35 @@  discard block
 block discarded – undo
177 177
 	 */
178 178
 	protected function createItem($value) {
179 179
 		$count=$this->count();
180
-		$itemO=new HtmlSemDoubleElement("item-".$this->identifier."-".$count,"a","section");
181
-		if(\is_array($value))
180
+		$itemO=new HtmlSemDoubleElement("item-".$this->identifier."-".$count, "a", "section");
181
+		if (\is_array($value))
182 182
 			$itemO->fromArray($value);
183
-		else{
183
+		else {
184 184
 			$itemO->setContent($value);
185 185
 			$itemO->setProperty($this->attr, $this->getHref($count));
186 186
 		}
187 187
 		return $itemO;
188 188
 	}
189 189
 
190
-	public function addIcon($icon,$index){
190
+	public function addIcon($icon, $index) {
191 191
 		$item=$this->getItem($index);
192
-		if(isset($item)){
192
+		if (isset($item)) {
193 193
 			$icon=new HtmlIcon("icon-".$this->identifier, $icon);
194 194
 			$item->wrapContent($icon);
195 195
 		}
196 196
 	}
197 197
 
198
-	public function addItem($item){
198
+	public function addItem($item) {
199 199
 		$itemO=parent::addItem($item);
200 200
 		$this->addToPropertyCtrl("class", "section", array("section"));
201 201
 		return $itemO;
202 202
 	}
203 203
 
204
-	public function asLinks(){
204
+	public function asLinks() {
205 205
 		$this->contentAs("a");
206 206
 	}
207 207
 
208
-	public function asTexts(){
208
+	public function asTexts() {
209 209
 		$this->contentAs("div");
210 210
 	}
211 211
 
Please login to merge, or discard this patch.
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -92,8 +92,9 @@  discard block
 block discarded – undo
92 92
 		if(\sizeof($params)>0 || \strtolower($action)!="index" ){
93 93
 			$items[]=$action;
94 94
 			foreach ($params as $p){
95
-				if(\is_object($p)===false)
96
-					$items[]=$p;
95
+				if(\is_object($p)===false) {
96
+									$items[]=$p;
97
+				}
97 98
 			}
98 99
 		}
99 100
 		return $this->addItems($items);
@@ -111,7 +112,7 @@  discard block
 block discarded – undo
111 112
 		}
112 113
 		if($this->absolutePaths===true){
113 114
 			return $this->_hrefFunction($this->content[$index]);
114
-		}else{
115
+		} else{
115 116
 			return $this->root.implode($separator, array_slice(array_map(function($e){return $this->_hrefFunction($e);}, $this->content),$this->startIndex,$index+1));
116 117
 		}
117 118
 	}
@@ -165,8 +166,9 @@  discard block
 block discarded – undo
165 166
 
166 167
 	public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) {
167 168
 		foreach ($this->content as $element){
168
-			if($element->getProperty($this->attr)!=NULL)
169
-				$element->_ajaxOn($operation, $event, $url, $responseElement, $parameters);
169
+			if($element->getProperty($this->attr)!=NULL) {
170
+							$element->_ajaxOn($operation, $event, $url, $responseElement, $parameters);
171
+			}
170 172
 		}
171 173
 		return $this;
172 174
 	}
@@ -178,9 +180,9 @@  discard block
 block discarded – undo
178 180
 	protected function createItem($value) {
179 181
 		$count=$this->count();
180 182
 		$itemO=new HtmlSemDoubleElement("item-".$this->identifier."-".$count,"a","section");
181
-		if(\is_array($value))
182
-			$itemO->fromArray($value);
183
-		else{
183
+		if(\is_array($value)) {
184
+					$itemO->fromArray($value);
185
+		} else{
184 186
 			$itemO->setContent($value);
185 187
 			$itemO->setProperty($this->attr, $this->getHref($count));
186 188
 		}
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,8 +57,7 @@  discard block
 block discarded – undo
57 57
 	 * Associate an ajax get to the breadcrumb elements, displayed in $targetSelector
58 58
 	 * $attr member is used to build each element url
59 59
 	 * @param string $targetSelector the target of the get
60
-	 * @param string $attr the html attribute used to build the elements url
61
-	 * @return HtmlBreadcrumbs
60
+	 * @return HtmlBreadcrumb
62 61
 	 */
63 62
 	public function autoGetOnClick($targetSelector){
64 63
 		return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr));
@@ -83,7 +82,7 @@  discard block
 block discarded – undo
83 82
 	/**
84 83
 	 * Add new elements in breadcrumbs corresponding to request dispatcher : controllerName, actionName, parameters
85 84
 	 * @param Dispatcher $dispatcher the request dispatcher
86
-	 * @return \Ajax\bootstrap\html\HtmlBreadcrumbs
85
+	 * @return HtmlBreadcrumb
87 86
 	 */
88 87
 	public function fromDispatcher($dispatcher,$startIndex=0){
89 88
 		$this->startIndex=$startIndex;
@@ -120,7 +119,7 @@  discard block
 block discarded – undo
120 119
 	/**
121 120
 	 * sets the function who generates the href elements. default : function($element){return $element->getContent()}
122 121
 	 * @param function $_hrefFunction
123
-	 * @return \Ajax\bootstrap\html\HtmlBreadcrumbs
122
+	 * @return HtmlBreadcrumb
124 123
 	 */
125 124
 	public function setHrefFunction($_hrefFunction) {
126 125
 		$this->_hrefFunction = $_hrefFunction;
Please login to merge, or discard this patch.