Completed
Push — master ( 5db14f...017cb5 )
by Jean-Christophe
03:16
created
Ajax/semantic/html/views/HtmlCard.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -17,19 +17,19 @@  discard block
 block discarded – undo
17 17
 class HtmlCard extends HtmlSemDoubleElement {
18 18
 
19 19
 	public function __construct($identifier) {
20
-		parent::__construct($identifier, "div", "ui card", array ());
20
+		parent::__construct($identifier, "div", "ui card", array());
21 21
 	}
22 22
 
23 23
 	private function createContent($content, $baseClass="content") {
24 24
 		$count=\sizeof($this->content);
25
-		$result=new HtmlCardContent("content-" . $count . "-" . $this->identifier, $content);
25
+		$result=new HtmlCardContent("content-".$count."-".$this->identifier, $content);
26 26
 		$result->setClass($baseClass);
27 27
 		return $result;
28 28
 	}
29 29
 
30 30
 	private function addElementInContent($key, $element) {
31
-		if (\array_key_exists($key, $this->content) === false) {
32
-			$this->content[$key]=array ();
31
+		if (\array_key_exists($key, $this->content)===false) {
32
+			$this->content[$key]=array();
33 33
 		}
34 34
 		$this->content[$key][]=$element;
35 35
 		return $element;
@@ -46,14 +46,14 @@  discard block
 block discarded – undo
46 46
 
47 47
 	public function addHeader($header, $niveau=4, $type="page") {
48 48
 		if (!$header instanceof HtmlHeader) {
49
-			$header=new HtmlHeader("header-" . $this->identifier, $niveau, $header, $type);
49
+			$header=new HtmlHeader("header-".$this->identifier, $niveau, $header, $type);
50 50
 		}
51 51
 		$this->content["header"]=$this->createContent($header);
52 52
 	}
53 53
 
54 54
 	public function addImage($image, $title="") {
55 55
 		if (!$image instanceof HtmlImage) {
56
-			$image=new HtmlImage("image-" . $this->identifier, $image, $title);
56
+			$image=new HtmlImage("image-".$this->identifier, $image, $title);
57 57
 		}
58 58
 		$image->setClass("image");
59 59
 		return $this->addElementInContent("content", $image);
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	public function addReveal($visibleContent, $hiddenContent=NULL, $type=RevealType::FADE, $attributeType=NULL) {
63 63
 		$reveal=$visibleContent;
64 64
 		if (!$visibleContent instanceof HtmlReveal) {
65
-			$reveal=new HtmlReveal("reveral-" . $this->identifier, $visibleContent, $hiddenContent, $type, $attributeType);
65
+			$reveal=new HtmlReveal("reveral-".$this->identifier, $visibleContent, $hiddenContent, $type, $attributeType);
66 66
 		}
67 67
 		return $this->addElementInContent("content", $reveal);
68 68
 	}
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
 	 * @param boolean $asIcons
92 92
 	 * @return \Ajax\semantic\html\elements\HtmlButtonGroups
93 93
 	 */
94
-	public function addButtons($elements=array(), $asIcons=false){
95
-		$buttons=new HtmlButtonGroups("buttons-".$this->identifier,$elements,$asIcons);
94
+	public function addButtons($elements=array(), $asIcons=false) {
95
+		$buttons=new HtmlButtonGroups("buttons-".$this->identifier, $elements, $asIcons);
96 96
 		$this->addElementInContent("content", $buttons);
97 97
 		return $buttons;
98 98
 	}
@@ -101,12 +101,12 @@  discard block
 block discarded – undo
101 101
 
102 102
 	public function addCardHeaderContent($header, $metas=array(), $description=NULL) {
103 103
 		$count=\sizeof($this->content);
104
-		return $this->addElementInContent("content", new HtmlCardHeaderContent("content-" . $count . "-" . $this->identifier, $header, $metas, $description));
104
+		return $this->addElementInContent("content", new HtmlCardHeaderContent("content-".$count."-".$this->identifier, $header, $metas, $description));
105 105
 	}
106 106
 
107 107
 	public function addCardContent($content=array()) {
108 108
 		$count=\sizeof($this->content);
109
-		return $this->addElementInContent("content", new HtmlCardContent("content-" . $count . "-" . $this->identifier, $content));
109
+		return $this->addElementInContent("content", new HtmlCardContent("content-".$count."-".$this->identifier, $content));
110 110
 	}
111 111
 
112 112
 	public function getCardContent($index=NULL) {
@@ -132,13 +132,13 @@  discard block
 block discarded – undo
132 132
 	 * @see HtmlSemDoubleElement::compile()
133 133
 	 */
134 134
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
135
-		$this->content=JArray::sortAssociative($this->content, [ "header","image","content","extra-content" ]);
135
+		$this->content=JArray::sortAssociative($this->content, ["header", "image", "content", "extra-content"]);
136 136
 		return parent::compile($js, $view);
137 137
 	}
138 138
 
139
-	public function asLink($href="",$target=NULL) {
139
+	public function asLink($href="", $target=NULL) {
140 140
 		$this->addToProperty("class", "link");
141
-		if ($href !== "") {
141
+		if ($href!=="") {
142 142
 			$this->setProperty("href", $href);
143 143
 			if (isset($target))
144 144
 				$this->setProperty("target", $target);
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,8 +37,9 @@  discard block
 block discarded – undo
37 37
 
38 38
 	private function getPart($part, $index=NULL) {
39 39
 		if (\array_key_exists($part, $this->content)) {
40
-			if (isset($index))
41
-				return $this->content[$part][$index];
40
+			if (isset($index)) {
41
+							return $this->content[$part][$index];
42
+			}
42 43
 			return $this->content[$part];
43 44
 		}
44 45
 		return NULL;
@@ -140,8 +141,9 @@  discard block
 block discarded – undo
140 141
 		$this->addToProperty("class", "link");
141 142
 		if ($href !== "") {
142 143
 			$this->setProperty("href", $href);
143
-			if (isset($target))
144
-				$this->setProperty("target", $target);
144
+			if (isset($target)) {
145
+							$this->setProperty("target", $target);
146
+			}
145 147
 		}
146 148
 		return $this;
147 149
 	}
Please login to merge, or discard this patch.
Ajax/service/AjaxCall.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -28,27 +28,27 @@
 block discarded – undo
28 28
 		$method="get";
29 29
 		extract($this->parameters);
30 30
 		$result=$this->_evenPreparing($preventDefault, $stopPropagation);
31
-		switch($this->method) {
31
+		switch ($this->method) {
32 32
 			case "get":
33
-				$result.=$js->getDeferred($url, $responseElement, $params, $jsCallback, $attr,$jqueryDone,$ajaxTransition);
33
+				$result.=$js->getDeferred($url, $responseElement, $params, $jsCallback, $attr, $jqueryDone, $ajaxTransition);
34 34
 				break;
35 35
 			case "post":
36
-				$result.=$js->postDeferred($url, $responseElement, $params, $jsCallback, $attr,$hasLoader,$jqueryDone,$ajaxTransition);
36
+				$result.=$js->postDeferred($url, $responseElement, $params, $jsCallback, $attr, $hasLoader, $jqueryDone, $ajaxTransition);
37 37
 				break;
38 38
 			case "postForm":
39
-				$result.=$js->postFormDeferred($url, $form, $responseElement, $validation, $jsCallback, $attr,$hasLoader,$jqueryDone,$ajaxTransition);
39
+				$result.=$js->postFormDeferred($url, $form, $responseElement, $validation, $jsCallback, $attr, $hasLoader, $jqueryDone, $ajaxTransition);
40 40
 				break;
41 41
 			case "json":
42
-				$result.=$js->jsonDeferred($url,$method,$params,$jsCallback);
42
+				$result.=$js->jsonDeferred($url, $method, $params, $jsCallback);
43 43
 				break;
44 44
 			case "jsonArray":
45
-				$result.=$js->jsonArrayDeferred($modelSelector, $url,$method,$params,$jsCallback);
45
+				$result.=$js->jsonArrayDeferred($modelSelector, $url, $method, $params, $jsCallback);
46 46
 				break;
47 47
 		}
48 48
 		return $result;
49 49
 	}
50 50
 
51
-	protected function _evenPreparing($preventDefault,$stopPropagation){
51
+	protected function _evenPreparing($preventDefault, $stopPropagation) {
52 52
 		$result="";
53 53
 		if ($preventDefault===true) {
54 54
 			$result.=Javascript::$preventDefault;
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,9 @@
 block discarded – undo
14 14
 	}
15 15
 
16 16
 	public function compile(JsUtils $js=null) {
17
-		if ($js==null)
18
-			return;
17
+		if ($js==null) {
18
+					return;
19
+		}
19 20
 		$params="{}";
20 21
 		$jsCallback=NULL;
21 22
 		$attr="id";
Please login to merge, or discard this patch.