Completed
Push — master ( 2c01a5...172c54 )
by Jean-Christophe
03:09
created
Ajax/common/html/html5/HtmlInput.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 
8 8
 class HtmlInput extends HtmlSingleElement {
9 9
 
10
-	public function __construct($identifier,$type="text",$value=NULL,$placeholder=NULL) {
10
+	public function __construct($identifier, $type="text", $value=NULL, $placeholder=NULL) {
11 11
 		parent::__construct($identifier, "input");
12 12
 		$this->setProperty("name", $identifier);
13 13
 		$this->setValue($value);
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 	}
17 17
 
18 18
 	public function setValue($value) {
19
-		if(isset($value))
19
+		if (isset($value))
20 20
 		$this->setProperty("value", $value);
21 21
 		return $this;
22 22
 	}
@@ -25,12 +25,12 @@  discard block
 block discarded – undo
25 25
 		return $this->setProperty("type", $value);
26 26
 	}
27 27
 
28
-	public function setPlaceholder($value){
29
-		if(JString::isNull($value)){
30
-			if(JString::isNotNull($this->identifier))
28
+	public function setPlaceholder($value) {
29
+		if (JString::isNull($value)) {
30
+			if (JString::isNotNull($this->identifier))
31 31
 				$value=\ucfirst($this->identifier);
32 32
 		}
33
-		if(JString::isNotNull($value))
33
+		if (JString::isNotNull($value))
34 34
 			$this->setProperty("placeholder", $value);
35 35
 		return $this;
36 36
 	}
Please login to merge, or discard this patch.
Ajax/common/html/html5/HtmlOption.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 class HtmlOption extends HtmlDoubleElement {
11 11
 	protected $value;
12 12
 	protected $selected;
13
-	public function __construct($identifier,$caption,$value="") {
13
+	public function __construct($identifier, $caption, $value="") {
14 14
 		parent::__construct($identifier, "option");
15 15
 		$this->_template='<option id="%identifier%" value="%value%" %selected% %properties%>%content%</option>';
16 16
 		$this->content=$caption;
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 		$this->selected="";
19 19
 	}
20 20
 
21
-	public function select(){
21
+	public function select() {
22 22
 		$this->selected="selected";
23 23
 		return $this;
24 24
 	}
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		return $this->value;
28 28
 	}
29 29
 	public function setValue($value) {
30
-		$this->value = $value;
30
+		$this->value=$value;
31 31
 		return $this;
32 32
 	}
33 33
 
Please login to merge, or discard this patch.
Ajax/common/html/html5/HtmlImg.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 
8 8
 class HtmlImg extends HtmlSingleElement {
9 9
 
10
-	public function __construct($identifier,$src="",$alt="") {
10
+	public function __construct($identifier, $src="", $alt="") {
11 11
 		parent::__construct($identifier, "img");
12 12
 		$this->setSrc($src);
13 13
 		$this->setAlt($alt);
Please login to merge, or discard this patch.
Ajax/common/html/html5/HtmlTextarea.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,26 +7,26 @@
 block discarded – undo
7 7
 
8 8
 class HtmlTextarea extends HtmlDoubleElement {
9 9
 
10
-	public function __construct($identifier,$value=NULL,$placeholder=NULL,$rows=NULL) {
10
+	public function __construct($identifier, $value=NULL, $placeholder=NULL, $rows=NULL) {
11 11
 		parent::__construct($identifier, "textarea");
12 12
 		$this->setValue($value);
13 13
 		$this->setPlaceholder($placeholder);
14
-		if(isset($rows))
14
+		if (isset($rows))
15 15
 			$this->setRows($rows);
16 16
 	}
17 17
 	public function setValue($value) {
18
-		if(isset($value))
18
+		if (isset($value))
19 19
 			$this->setContent($value);
20 20
 		return $this;
21 21
 	}
22 22
 
23
-	public function setPlaceholder($value){
24
-		if(JString::isNotNull($value))
23
+	public function setPlaceholder($value) {
24
+		if (JString::isNotNull($value))
25 25
 			$this->setProperty("placeholder", $value);
26 26
 		return $this;
27 27
 	}
28 28
 
29
-	public function setRows($count){
29
+	public function setRows($count) {
30 30
 		$this->setProperty("rows", $count);
31 31
 	}
32 32
 }
33 33
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/common/html/html5/HtmlList.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@
 block discarded – undo
14 14
 		parent::__construct($identifier, "ul");
15 15
 		$this->addItems($items);
16 16
 	}
17
-	public function setOrdered($ordered=true){
18
-		$this->tagName=($ordered===true)?"ol":"ul";
17
+	public function setOrdered($ordered=true) {
18
+		$this->tagName=($ordered===true) ? "ol" : "ul";
19 19
 	}
20 20
 
21 21
 	/**
Please login to merge, or discard this patch.
Ajax/common/html/PropertyWrapper.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
 			$output=$input;
13 13
 		}
14 14
 		if (is_array($input)) {
15
-			if (sizeof($input) > 0) {
16
-				if (self::containsElement($input) === false) {
15
+			if (sizeof($input)>0) {
16
+				if (self::containsElement($input)===false) {
17 17
 					$output=self::wrapStrings($input, $js, $separator=' ', $valueQuote='"');
18 18
 				} else {
19 19
 					$output=self::wrapObjects($input, $js, $separator, $valueQuote);
@@ -24,17 +24,17 @@  discard block
 block discarded – undo
24 24
 	}
25 25
 
26 26
 	private static function containsElement($input) {
27
-		foreach ( $input as $v ) {
28
-			if (\is_object($v) === true || \is_array($v))
27
+		foreach ($input as $v) {
28
+			if (\is_object($v)===true || \is_array($v))
29 29
 				return true;
30 30
 		}
31 31
 		return false;
32 32
 	}
33 33
 
34 34
 	public static function wrapStrings($input, $js, $separator=' ', $valueQuote='"') {
35
-		if (JArray::isAssociative($input) === true) {
36
-			$result=implode($separator, array_map(function ($v, $k) use($valueQuote) {
37
-				return $k . '=' . $valueQuote . $v . $valueQuote;
35
+		if (JArray::isAssociative($input)===true) {
36
+			$result=implode($separator, array_map(function($v, $k) use($valueQuote) {
37
+				return $k.'='.$valueQuote.$v.$valueQuote;
38 38
 			}, $input, array_keys($input)));
39 39
 		} else {
40 40
 			$result=implode($separator, array_values($input));
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	}
44 44
 
45 45
 	public static function wrapObjects($input, $js=NULL, $separator=' ', $valueQuote='"') {
46
-		return implode($separator, array_map(function ($v) use($js, $separator, $valueQuote) {
46
+		return implode($separator, array_map(function($v) use($js, $separator, $valueQuote) {
47 47
 			if (is_object($v))
48 48
 				return $v->compile($js);
49 49
 			elseif (\is_array($v)) {
Please login to merge, or discard this patch.
Ajax/common/html/HtmlCollection.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -13,36 +13,36 @@  discard block
 block discarded – undo
13 13
  */
14 14
 abstract class HtmlCollection extends HtmlDoubleElement {
15 15
 
16
-	public function __construct($identifier,$tagName="div"){
17
-		parent::__construct($identifier,$tagName);
16
+	public function __construct($identifier, $tagName="div") {
17
+		parent::__construct($identifier, $tagName);
18 18
 		$this->content=array();
19 19
 	}
20 20
 
21
-	public function addItems($items){
22
-		if(JArray::isAssociative($items)){
23
-			foreach ($items as $k=>$v){
24
-				$this->addItem([$k,$v]);
21
+	public function addItems($items) {
22
+		if (JArray::isAssociative($items)) {
23
+			foreach ($items as $k=>$v) {
24
+				$this->addItem([$k, $v]);
25 25
 			}
26
-		}else{
27
-			foreach ($items as $item){
26
+		} else {
27
+			foreach ($items as $item) {
28 28
 				$this->addItem($item);
29 29
 			}
30 30
 		}
31 31
 		return $this;
32 32
 	}
33 33
 
34
-	public function setItems($items){
34
+	public function setItems($items) {
35 35
 		$this->content=$items;
36 36
 		return $this;
37 37
 	}
38 38
 
39
-	public function getItems(){
39
+	public function getItems() {
40 40
 		return $this->content;
41 41
 	}
42 42
 
43
-	protected function getItemToAdd($item){
43
+	protected function getItemToAdd($item) {
44 44
 		$itemO=$item;
45
-		if($this->createCondition($item)===true){
45
+		if ($this->createCondition($item)===true) {
46 46
 			$itemO=$this->createItem($item);
47 47
 		}
48 48
 		return $itemO;
@@ -53,15 +53,15 @@  discard block
 block discarded – undo
53 53
 	 * @param HtmlDoubleElement|string $item
54 54
 	 * @return \Ajax\common\html\HtmlDoubleElement
55 55
 	 */
56
-	public function addItem($item){
56
+	public function addItem($item) {
57 57
 		$itemO=$this->getItemToAdd($item);
58 58
 		$this->addContent($itemO);
59 59
 		return $itemO;
60 60
 	}
61 61
 
62
-	public function insertItem($item,$position=0){
62
+	public function insertItem($item, $position=0) {
63 63
 		$itemO=$this->getItemToAdd($item);
64
-		\array_splice( $this->content, $position, 0, array($itemO));
64
+		\array_splice($this->content, $position, 0, array($itemO));
65 65
 		return $itemO;
66 66
 	}
67 67
 
@@ -84,11 +84,11 @@  discard block
 block discarded – undo
84 84
 		return $this;
85 85
 	}
86 86
 
87
-	public function removeItem($index){
87
+	public function removeItem($index) {
88 88
 		return array_splice($this->content, $index, 1);
89 89
 	}
90 90
 
91
-	public function count(){
91
+	public function count() {
92 92
 		return \sizeof($this->content);
93 93
 	}
94 94
 
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
 		return $this->addItem($function($object));
100 100
 	}
101 101
 
102
-	public function apply($callBack){
103
-		foreach ($this->content as $item){
102
+	public function apply($callBack) {
103
+		foreach ($this->content as $item) {
104 104
 			$callBack($item);
105 105
 		}
106 106
 		return $this;
@@ -120,12 +120,12 @@  discard block
 block discarded – undo
120 120
 	 */
121 121
 	protected abstract function createItem($value);
122 122
 
123
-	protected function createCondition($value){
123
+	protected function createCondition($value) {
124 124
 		return \is_object($value)===false;
125 125
 	}
126 126
 
127
-	protected function contentAs($tagName){
128
-		foreach ($this->content as $item){
127
+	protected function contentAs($tagName) {
128
+		foreach ($this->content as $item) {
129 129
 			$item->setTagName($tagName);
130 130
 		}
131 131
 		return $this;
Please login to merge, or discard this patch.
Ajax/common/html/HtmlSingleElement.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 	}
14 14
 
15 15
 	public function setClass($classNames) {
16
-		if(is_array($classNames)){
16
+		if (is_array($classNames)) {
17 17
 			$classNames=implode(" ", $classNames);
18 18
 		}
19 19
 		$this->setProperty("class", $classNames);
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	 */
45 45
 	public function fromArray($array) {
46 46
 		$array=parent::fromArray($array);
47
-		foreach ( $array as $key => $value ) {
47
+		foreach ($array as $key => $value) {
48 48
 			$this->setProperty($key, $value);
49 49
 		}
50 50
 		return $array;
Please login to merge, or discard this patch.
Ajax/common/html/BaseHtml.php 1 patch
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -16,10 +16,10 @@  discard block
 block discarded – undo
16 16
 abstract class BaseHtml extends BaseWidget {
17 17
 	protected $_template;
18 18
 	protected $tagName;
19
-	protected $properties=array ();
20
-	protected $_events=array ();
21
-	protected $_wrapBefore=array ();
22
-	protected $_wrapAfter=array ();
19
+	protected $properties=array();
20
+	protected $_events=array();
21
+	protected $_wrapBefore=array();
22
+	protected $_wrapAfter=array();
23 23
 	protected $_bsComponent;
24 24
 
25 25
 	public function getBsComponent() {
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	}
33 33
 
34 34
 	protected function getTemplate(JsUtils $js=NULL) {
35
-		return PropertyWrapper::wrap($this->_wrapBefore, $js) . $this->_template . PropertyWrapper::wrap($this->_wrapAfter, $js);
35
+		return PropertyWrapper::wrap($this->_wrapBefore, $js).$this->_template.PropertyWrapper::wrap($this->_wrapAfter, $js);
36 36
 	}
37 37
 
38 38
 	public function getProperties() {
@@ -56,13 +56,13 @@  discard block
 block discarded – undo
56 56
 
57 57
 	public function addToProperty($name, $value, $separator=" ") {
58 58
 		if (\is_array($value)) {
59
-			foreach ( $value as $v ) {
59
+			foreach ($value as $v) {
60 60
 				$this->addToProperty($name, $v, $separator);
61 61
 			}
62
-		} else if ($value !== "" && $this->propertyContains($name, $value) === false) {
62
+		} else if ($value!=="" && $this->propertyContains($name, $value)===false) {
63 63
 			$v=@$this->properties[$name];
64
-			if (isset($v) && $v !== "")
65
-				$v=$v . $separator . $value;
64
+			if (isset($v) && $v!=="")
65
+				$v=$v.$separator.$value;
66 66
 			else
67 67
 				$v=$value;
68 68
 
@@ -78,19 +78,19 @@  discard block
 block discarded – undo
78 78
 
79 79
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
80 80
 		$result=$this->getTemplate($js);
81
-		foreach ( $this as $key => $value ) {
82
-			if (JString::startswith($key, "_") === false && $key !== "events") {
81
+		foreach ($this as $key => $value) {
82
+			if (JString::startswith($key, "_")===false && $key!=="events") {
83 83
 				if (is_array($value)) {
84 84
 					$v=PropertyWrapper::wrap($value, $js);
85 85
 				} else {
86 86
 					$v=$value;
87 87
 				}
88
-				$result=str_ireplace("%" . $key . "%", $v, $result);
88
+				$result=str_ireplace("%".$key."%", $v, $result);
89 89
 			}
90 90
 		}
91 91
 		if (isset($js)===true) {
92 92
 			$this->run($js);
93
-			if (isset($view) === true) {
93
+			if (isset($view)===true) {
94 94
 				$js->addViewElement($this->identifier, $result, $view);
95 95
 			}
96 96
 		}
@@ -99,12 +99,12 @@  discard block
 block discarded – undo
99 99
 
100 100
 	protected function ctrl($name, $value, $typeCtrl) {
101 101
 		if (is_array($typeCtrl)) {
102
-			if (array_search($value, $typeCtrl) === false) {
103
-				throw new \Exception("La valeur passée `" . $value . "` à la propriété `" . $name . "` ne fait pas partie des valeurs possibles : {" . implode(",", $typeCtrl) . "}");
102
+			if (array_search($value, $typeCtrl)===false) {
103
+				throw new \Exception("La valeur passée `".$value."` à la propriété `".$name."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
104 104
 			}
105 105
 		} else {
106 106
 			if (!$typeCtrl($value)) {
107
-				throw new \Exception("La fonction " . $typeCtrl . " a retourné faux pour l'affectation de la propriété " . $name);
107
+				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$name);
108 108
 			}
109 109
 		}
110 110
 		return true;
@@ -119,13 +119,13 @@  discard block
 block discarded – undo
119 119
 	}
120 120
 
121 121
 	protected function setPropertyCtrl($name, $value, $typeCtrl) {
122
-		if ($this->ctrl($name, $value, $typeCtrl) === true)
122
+		if ($this->ctrl($name, $value, $typeCtrl)===true)
123 123
 			return $this->setProperty($name, $value);
124 124
 		return $this;
125 125
 	}
126 126
 
127 127
 	protected function setMemberCtrl(&$name, $value, $typeCtrl) {
128
-		if ($this->ctrl($name, $value, $typeCtrl) === true) {
128
+		if ($this->ctrl($name, $value, $typeCtrl)===true) {
129 129
 			return $name=$value;
130 130
 		}
131 131
 		return $this;
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 	protected function addToMemberUnique(&$name, $value, $typeCtrl, $separator=" ") {
135 135
 		if (is_array($typeCtrl)) {
136 136
 			$this->removeOldValues($name, $typeCtrl);
137
-			$name.=$separator . $value;
137
+			$name.=$separator.$value;
138 138
 		}
139 139
 		return $this;
140 140
 	}
@@ -156,17 +156,17 @@  discard block
 block discarded – undo
156 156
 	}
157 157
 
158 158
 	protected function addToMemberCtrl(&$name, $value, $typeCtrl, $separator=" ") {
159
-		if ($this->ctrl($name, $value, $typeCtrl) === true) {
159
+		if ($this->ctrl($name, $value, $typeCtrl)===true) {
160 160
 			if (is_array($typeCtrl)) {
161 161
 				$this->removeOldValues($name, $typeCtrl);
162 162
 			}
163
-			$name.=$separator . $value;
163
+			$name.=$separator.$value;
164 164
 		}
165 165
 		return $this;
166 166
 	}
167 167
 
168 168
 	protected function addToMember(&$name, $value, $separator=" ") {
169
-		$name=str_ireplace($value, "", $name) . $separator . $value;
169
+		$name=str_ireplace($value, "", $name).$separator.$value;
170 170
 		return $this;
171 171
 	}
172 172
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 	}
185 185
 
186 186
 	public function addToPropertyCtrlCheck($name, $value, $typeCtrl) {
187
-		if ($this->ctrl($name, $value, $typeCtrl) === true) {
187
+		if ($this->ctrl($name, $value, $typeCtrl)===true) {
188 188
 			return $this->addToProperty($name, $value);
189 189
 		}
190 190
 		return $this;
@@ -212,28 +212,28 @@  discard block
 block discarded – undo
212 212
 	}
213 213
 
214 214
 	public function fromArray($array) {
215
-		foreach ( $this as $key => $value ) {
215
+		foreach ($this as $key => $value) {
216 216
 			if (array_key_exists($key, $array) && !JString::startswith($key, "_")) {
217
-				$setter="set" . ucfirst($key);
217
+				$setter="set".ucfirst($key);
218 218
 				$this->$setter($array[$key]);
219 219
 				unset($array[$key]);
220 220
 			}
221 221
 		}
222
-		foreach ( $array as $key => $value ) {
222
+		foreach ($array as $key => $value) {
223 223
 			if (method_exists($this, $key)) {
224 224
 				try {
225 225
 					$this->$key($value);
226 226
 					unset($array[$key]);
227
-				} catch ( \Exception $e ) {
227
+				}catch (\Exception $e) {
228 228
 					// Nothing to do
229 229
 				}
230 230
 			} else {
231
-				$setter="set" . ucfirst($key);
231
+				$setter="set".ucfirst($key);
232 232
 				if (method_exists($this, $setter)) {
233 233
 					try {
234 234
 						$this->$setter($value);
235 235
 						unset($array[$key]);
236
-					} catch ( \Exception $e ) {
236
+					}catch (\Exception $e) {
237 237
 						// Nothing to do
238 238
 					}
239 239
 				}
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 
245 245
 	public function fromDatabaseObjects($objects, $function) {
246 246
 		if (isset($objects)) {
247
-			foreach ( $objects as $object ) {
247
+			foreach ($objects as $object) {
248 248
 				$this->fromDatabaseObject($object, $function);
249 249
 			}
250 250
 		}
@@ -264,11 +264,11 @@  discard block
 block discarded – undo
264 264
 	}
265 265
 
266 266
 	public function addEvent($event, $jsCode, $stopPropagation=false, $preventDefault=false) {
267
-		if ($stopPropagation === true) {
268
-			$jsCode="event.stopPropagation();" . $jsCode;
267
+		if ($stopPropagation===true) {
268
+			$jsCode="event.stopPropagation();".$jsCode;
269 269
 		}
270
-		if ($preventDefault === true) {
271
-			$jsCode="event.preventDefault();" . $jsCode;
270
+		if ($preventDefault===true) {
271
+			$jsCode="event.preventDefault();".$jsCode;
272 272
 		}
273 273
 		return $this->_addEvent($event, $jsCode);
274 274
 	}
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 			if (is_array($this->_events[$event])) {
279 279
 				$this->_events[$event][]=$jsCode;
280 280
 			} else {
281
-				$this->_events[$event]=array ($this->_events[$event],$jsCode );
281
+				$this->_events[$event]=array($this->_events[$event], $jsCode);
282 282
 			}
283 283
 		} else {
284 284
 			$this->_events[$event]=$jsCode;
@@ -300,15 +300,15 @@  discard block
 block discarded – undo
300 300
 
301 301
 	public function addEventsOnRun(JsUtils $js) {
302 302
 		if (isset($this->_bsComponent)) {
303
-			foreach ( $this->_events as $event => $jsCode ) {
303
+			foreach ($this->_events as $event => $jsCode) {
304 304
 				$code=$jsCode;
305 305
 				if (is_array($jsCode)) {
306 306
 					$code="";
307
-					foreach ( $jsCode as $jsC ) {
307
+					foreach ($jsCode as $jsC) {
308 308
 						if ($jsC instanceof AjaxCall) {
309
-							$code.="\n" . $jsC->compile($js);
309
+							$code.="\n".$jsC->compile($js);
310 310
 						} else {
311
-							$code.="\n" . $jsC;
311
+							$code.="\n".$jsC;
312 312
 						}
313 313
 					}
314 314
 				} elseif ($jsCode instanceof AjaxCall) {
@@ -316,12 +316,12 @@  discard block
 block discarded – undo
316 316
 				}
317 317
 				$this->_bsComponent->addEvent($event, $code);
318 318
 			}
319
-			$this->_events=array ();
319
+			$this->_events=array();
320 320
 		}
321 321
 	}
322 322
 
323 323
 	public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) {
324
-		$params=array ("url" => $url,"responseElement" => $responseElement );
324
+		$params=array("url" => $url, "responseElement" => $responseElement);
325 325
 		$params=array_merge($params, $parameters);
326 326
 		$this->_addEvent($event, new AjaxCall($operation, $params));
327 327
 		return $this;
@@ -357,33 +357,33 @@  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
-					$flag=($elements[$index]->getIdentifier() === $identifier);
362
+					$flag=($elements[$index]->getIdentifier()===$identifier);
363 363
 				$index++;
364 364
 			}
365
-			if ($flag === true)
366
-				return $elements[$index - 1];
365
+			if ($flag===true)
366
+				return $elements[$index-1];
367 367
 		} elseif ($elements instanceof BaseHtml) {
368
-			if ($elements->getIdentifier() === $identifier)
368
+			if ($elements->getIdentifier()===$identifier)
369 369
 				return $elements;
370 370
 		}
371 371
 		return null;
372 372
 	}
373 373
 
374
-	protected function getElementByPropertyValue($propertyName,$value, $elements) {
374
+	protected function getElementByPropertyValue($propertyName, $value, $elements) {
375 375
 		if (is_array($elements)) {
376 376
 			$flag=false;
377 377
 			$index=0;
378
-			while ( !$flag && $index < sizeof($elements) ) {
378
+			while (!$flag && $index<sizeof($elements)) {
379 379
 				if ($elements[$index] instanceof BaseHtml)
380
-					$flag=($elements[$index]->propertyContains($propertyName, $value) === true);
380
+					$flag=($elements[$index]->propertyContains($propertyName, $value)===true);
381 381
 					$index++;
382 382
 			}
383
-			if ($flag === true)
384
-				return $elements[$index - 1];
383
+			if ($flag===true)
384
+				return $elements[$index-1];
385 385
 		} elseif ($elements instanceof BaseHtml) {
386
-			if ($elements->propertyContains($propertyName, $value) === true)
386
+			if ($elements->propertyContains($propertyName, $value)===true)
387 387
 				return $elements;
388 388
 		}
389 389
 		return null;
@@ -405,14 +405,14 @@  discard block
 block discarded – undo
405 405
 		if (is_array($value)) {
406 406
 			$value=implode(",", $value);
407 407
 		}
408
-		if (strrpos($value, 'this') === false && strrpos($value, 'event') === false) {
409
-			$value='"' . $value . '"';
408
+		if (strrpos($value, 'this')===false && strrpos($value, 'event')===false) {
409
+			$value='"'.$value.'"';
410 410
 		}
411 411
 		return $value;
412 412
 	}
413 413
 
414 414
 	public function jsDoJquery($jqueryCall, $param="") {
415
-		return "$('#" . $this->identifier . "')." . $jqueryCall . "(" . $this->_prep_value($param) . ");";
415
+		return "$('#".$this->identifier."').".$jqueryCall."(".$this->_prep_value($param).");";
416 416
 	}
417 417
 
418 418
 	public function executeOnRun($jsCode) {
Please login to merge, or discard this patch.