Completed
Push — master ( 06f62d...424d4e )
by Jean-Christophe
03:13
created
Ajax/semantic/components/Popup.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 		return $this->setParam("onShow", "%function(){".$jsCode."}%");
31 31
 	}
32 32
 
33
-	public function setExclusive($value){
33
+	public function setExclusive($value) {
34 34
 		return $this->setParam("exclusive", $value);
35 35
 	}
36 36
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	 * @param string $popup the css selector of the popup
40 40
 	 * @return \Ajax\semantic\components\Popup
41 41
 	 */
42
-	public function setPopup($popup){
42
+	public function setPopup($popup) {
43 43
 		return $this->setParam("popup", $popup);
44 44
 	}
45 45
 	//TODO other events implementation
Please login to merge, or discard this patch.
Ajax/bootstrap/html/base/HtmlNavElement.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
 	protected $attr;
20 20
 
21 21
 
22
-	public function __construct($identifier,$tagName){
23
-		parent::__construct($identifier,$tagName);
22
+	public function __construct($identifier, $tagName) {
23
+		parent::__construct($identifier, $tagName);
24 24
 		$this->root="";
25 25
 		$this->attr="data-ajax";
26 26
 	}
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
 	 * @param string $attr the html attribute used to build the elements url
33 33
 	 * @return HtmlNavElement
34 34
 	 */
35
-	public function autoGetOnClick($targetSelector){
36
-		return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr));
35
+	public function autoGetOnClick($targetSelector) {
36
+		return $this->getOnClick($this->root, $targetSelector, array("attr"=>$this->attr));
37 37
 	}
38 38
 
39
-	public function contentAsString(){
39
+	public function contentAsString() {
40 40
 		return implode("", $this->content);
41 41
 	}
42 42
 
@@ -44,15 +44,15 @@  discard block
 block discarded – undo
44 44
 	 * Generate the jquery script to set the elements to the HtmlNavElement
45 45
 	 * @param JsUtils $jsUtils
46 46
 	 */
47
-	public function jsSetContent(JsUtils $jsUtils){
48
-		$jsUtils->html("#".$this->identifier,str_replace("\"","'", $this->contentAsString()),true);
47
+	public function jsSetContent(JsUtils $jsUtils) {
48
+		$jsUtils->html("#".$this->identifier, str_replace("\"", "'", $this->contentAsString()), true);
49 49
 	}
50 50
 
51 51
 	public function getRoot() {
52 52
 		return $this->root;
53 53
 	}
54 54
 	public function setRoot($root) {
55
-		$this->root = $root;
55
+		$this->root=$root;
56 56
 		return $this;
57 57
 	}
58 58
 	public function getAttr() {
@@ -65,12 +65,12 @@  discard block
 block discarded – undo
65 65
 	 * @return HtmlNavElement
66 66
 	 */
67 67
 	public function setAttr($attr) {
68
-		$this->attr = $attr;
68
+		$this->attr=$attr;
69 69
 		return $this;
70 70
 	}
71 71
 
72 72
 	public function __call($method, $args) {
73
-		if(isset($this->$method) && is_callable($this->$method)) {
73
+		if (isset($this->$method) && is_callable($this->$method)) {
74 74
 			return call_user_func_array(
75 75
 					$this->$method,
76 76
 					$args
@@ -78,6 +78,6 @@  discard block
 block discarded – undo
78 78
 		}
79 79
 	}
80 80
 
81
-	public abstract function fromDispatcher($dispatcher,$startIndex=0);
81
+	public abstract function fromDispatcher($dispatcher, $startIndex=0);
82 82
 
83 83
 }
84 84
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlPagination.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -44,70 +44,70 @@  discard block
 block discarded – undo
44 44
 	/**
45 45
 	 * @param string $identifier
46 46
 	 */
47
-	public function __construct($identifier,$from=1,$to=1,$active=NULL,$countVisible=NULL){
48
-		parent::__construct($identifier,"ul");
47
+	public function __construct($identifier, $from=1, $to=1, $active=NULL, $countVisible=NULL) {
48
+		parent::__construct($identifier, "ul");
49 49
 		$this->setProperty("class", "pagination");
50 50
 		$this->active=$active;
51 51
 		$this->from=$from;
52 52
 		$this->to=$to;
53 53
 		$this->urlMask="%page%";
54
-		if(!isset($countVisible))
54
+		if (!isset($countVisible))
55 55
 			$this->countVisible=$to-$from+1;
56 56
 		else
57 57
 			$this->countVisible=$countVisible;
58 58
 		$this->createContent();
59 59
 	}
60 60
 
61
-	private function createElement($num,$content,$disabled=false,$current=false){
61
+	private function createElement($num, $content, $disabled=false, $current=false) {
62 62
 		$count=sizeof($this->content)+1;
63
-		$elem=new HtmlBsDoubleElement("li-".$this->identifier."-".$count,"li");
64
-		if($disabled){
63
+		$elem=new HtmlBsDoubleElement("li-".$this->identifier."-".$count, "li");
64
+		if ($disabled) {
65 65
 			$elem->setProperty("class", "disabled");
66 66
 		}
67
-		if($current){
67
+		if ($current) {
68 68
 			$content.="<span class='sr-only'>(current)</span>";
69 69
 			$elem->setProperty("class", "active");
70 70
 		}
71
-		if(!$disabled){
71
+		if (!$disabled) {
72 72
 			$url=$this->getUrl($num);
73
-			$href=new HtmlLink("a-".$this->identifier."-".$count,$url,$content);
73
+			$href=new HtmlLink("a-".$this->identifier."-".$count, $url, $content);
74 74
 			$href->setProperty($this->attr, $url);
75 75
 			$elem->setContent($href);
76
-		}else{
76
+		}else {
77 77
 			$elem->setContent($content);
78 78
 		}
79 79
 		$this->content[]=$elem;
80 80
 		return $this;
81 81
 	}
82 82
 
83
-	protected function createContent(){
83
+	protected function createContent() {
84 84
 		$this->content=array();
85
-		$this->createElement($this->active-1,"<span aria-hidden='true'>&laquo;</span>",$this->active===1);
85
+		$this->createElement($this->active-1, "<span aria-hidden='true'>&laquo;</span>", $this->active===1);
86 86
 		$start=$this->getStart();
87
-		$end=min($start+$this->countVisible-1,$this->to);
88
-		for($index=$start;$index<=$end;$index++){
89
-			$this->createElement($index,$index,false,$index===$this->active);
87
+		$end=min($start+$this->countVisible-1, $this->to);
88
+		for ($index=$start; $index<=$end; $index++) {
89
+			$this->createElement($index, $index, false, $index===$this->active);
90 90
 		}
91
-		$this->createElement($this->active+1,"<span aria-hidden='true'>&raquo;</span>",$this->active===$this->to);
91
+		$this->createElement($this->active+1, "<span aria-hidden='true'>&raquo;</span>", $this->active===$this->to);
92 92
 	}
93 93
 
94
-	protected function half(){
95
-		return (int)($this->countVisible/2);
94
+	protected function half() {
95
+		return (int) ($this->countVisible / 2);
96 96
 	}
97 97
 
98
-	protected function getStart(){
98
+	protected function getStart() {
99 99
 		$result=1;
100
-		if($this->countVisible!==$this->to-$this->from+1){
101
-			$result=max($this->active-$this->half(),$result);
100
+		if ($this->countVisible!==$this->to-$this->from+1) {
101
+			$result=max($this->active-$this->half(), $result);
102 102
 		}
103 103
 		return $result;
104 104
 	}
105 105
 
106 106
 	public function _addEvent($event, $jsCode) {
107
-		foreach ($this->content as $li){
107
+		foreach ($this->content as $li) {
108 108
 			$content=$li->getContent();
109
-			if($content instanceof BaseHtml)
110
-				$content->_addEvent($event,$jsCode);
109
+			if ($content instanceof BaseHtml)
110
+				$content->_addEvent($event, $jsCode);
111 111
 		}
112 112
 	}
113 113
 	/**
@@ -115,15 +115,15 @@  discard block
 block discarded – undo
115 115
 	 * @param Dispatcher $dispatcher the request dispatcher
116 116
 	 * @return \Ajax\bootstrap\html\HtmlPagination
117 117
 	 */
118
-	public function fromDispatcher($dispatcher,$startIndex=0){
119
-		$items=array($dispatcher->getControllerName(),$dispatcher->getActionName());
120
-		$items=array_merge($items,$dispatcher->getParams());
118
+	public function fromDispatcher($dispatcher, $startIndex=0) {
119
+		$items=array($dispatcher->getControllerName(), $dispatcher->getActionName());
120
+		$items=array_merge($items, $dispatcher->getParams());
121 121
 		$url=implode("/", $items);
122
-		if($this->urlMask==="%page%"){
122
+		if ($this->urlMask==="%page%") {
123 123
 			$this->urlMask=preg_replace("/[0-9]/", "%page%", $url);
124 124
 		}
125
-		for($index=$this->from;$index<=$this->to;$index++){
126
-			if($this->getUrl($index)==$url){
125
+		for ($index=$this->from; $index<=$this->to; $index++) {
126
+			if ($this->getUrl($index)==$url) {
127 127
 				$this->setActive($index);
128 128
 				break;
129 129
 			}
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 		return $this;
132 132
 	}
133 133
 
134
-	public function getUrl($index){
134
+	public function getUrl($index) {
135 135
 		return str_ireplace("%page%", $index, $this->urlMask);
136 136
 	}
137 137
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 		if (is_int($size)) {
146 146
 			return $this->addToPropertyUnique("class", CssRef::sizes("pagination")[$size], CssRef::sizes("pagination"));
147 147
 		}
148
-		if(!PhalconUtils::startsWith($size, "pagination-") && $size!=="")
148
+		if (!PhalconUtils::startsWith($size, "pagination-") && $size!=="")
149 149
 			$size="pagination-".$size;
150 150
 		return $this->addToPropertyCtrl("class", $size, CssRef::sizes("pagination"));
151 151
 	}
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 		return $this->from;
155 155
 	}
156 156
 	public function setFrom($from) {
157
-		$this->from = $from;
157
+		$this->from=$from;
158 158
 		$this->createContent();
159 159
 		return $this;
160 160
 	}
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 		return $this->to;
163 163
 	}
164 164
 	public function setTo($to) {
165
-		$this->to = $to;
165
+		$this->to=$to;
166 166
 		$this->createContent();
167 167
 		return $this;
168 168
 	}
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 		return $this->active;
171 171
 	}
172 172
 	public function setActive($active) {
173
-		$this->active = $active;
173
+		$this->active=$active;
174 174
 		$this->createContent();
175 175
 		return $this;
176 176
 	}
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 		return $this->urlMask;
179 179
 	}
180 180
 	public function setUrlMask($urlMask) {
181
-		$this->urlMask = $urlMask;
181
+		$this->urlMask=$urlMask;
182 182
 		$this->createContent();
183 183
 		return $this;
184 184
 	}
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 		return $this->countVisible;
187 187
 	}
188 188
 	public function setCountVisible($countVisible) {
189
-		$this->countVisible = $countVisible;
189
+		$this->countVisible=$countVisible;
190 190
 		$this->createContent();
191 191
 		return $this;
192 192
 	}
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlBreadcrumbs.php 1 patch
Spacing   +38 added lines, -38 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 $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;
@@ -167,18 +167,18 @@  discard block
 block discarded – undo
167 167
 	 * @param string $attr the html attribute used to build the elements url
168 168
 	 * @return HtmlBreadcrumbs
169 169
 	 */
170
-	public function autoGetOnClick($targetSelector){
171
-		return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr));
170
+	public function autoGetOnClick($targetSelector) {
171
+		return $this->getOnClick($this->root, $targetSelector, array("attr"=>$this->attr));
172 172
 	}
173 173
 
174
-	public function contentAsString(){
175
-		if($this->autoActive){
174
+	public function contentAsString() {
175
+		if ($this->autoActive) {
176 176
 			$this->setActive();
177 177
 		}
178 178
 		return parent::contentAsString();
179 179
 	}
180 180
 
181
-	public function getElement($index){
181
+	public function getElement($index) {
182 182
 		return $this->content[$index];
183 183
 	}
184 184
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 	 * @param mixed $glyph
188 188
 	 * @param int $index
189 189
 	 */
190
-	public function addGlyph($glyph,$index=0){
190
+	public function addGlyph($glyph, $index=0) {
191 191
 		$elm=$this->getElement($index);
192 192
 		return $elm->wrapContentWithGlyph($glyph);
193 193
 	}
@@ -197,15 +197,15 @@  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($dispatcher,$startIndex=0){
200
+	public function fromDispatcher($dispatcher, $startIndex=0) {
201 201
 		$this->startIndex=$startIndex;
202 202
 		$params=$dispatcher->getParams();
203 203
 		$action=$dispatcher->getActionName();
204 204
 		$items=array($dispatcher->getControllerName());
205
-		if(\sizeof($params)>0 || \strtolower($action)!="index" ){
205
+		if (\sizeof($params)>0 || \strtolower($action)!="index") {
206 206
 			$items[]=$action;
207
-			foreach ($params as $p){
208
-				if(\is_object($p)===false)
207
+			foreach ($params as $p) {
208
+				if (\is_object($p)===false)
209 209
 				$items[]=$p;
210 210
 			}
211 211
 		}
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 	 * @return \Ajax\bootstrap\html\HtmlBreadcrumbs
220 220
 	 */
221 221
 	public function setHrefFunction($_hrefFunction) {
222
-		$this->_hrefFunction = $_hrefFunction;
222
+		$this->_hrefFunction=$_hrefFunction;
223 223
 		return $this;
224 224
 	}
225 225
 
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlIconMenu.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,15 +12,15 @@  discard block
 block discarded – undo
12 12
  * @author jc
13 13
  * @version 1.001
14 14
  */
15
-class HtmlIconMenu extends HtmlMenu{
15
+class HtmlIconMenu extends HtmlMenu {
16 16
 
17 17
 
18 18
 	/**
19 19
 	 * @param string $identifier
20 20
 	 * @param array $items icons
21 21
 	 */
22
-	public function __construct( $identifier, $items=array()){
23
-		parent::__construct( $identifier, $items);
22
+	public function __construct($identifier, $items=array()) {
23
+		parent::__construct($identifier, $items);
24 24
 		$this->addToProperty("class", "icon");
25 25
 	}
26 26
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	protected function createItem($value) {
33 33
 		$count=\sizeof($this->content);
34 34
 		$value=new HtmlIcon("icon-".$count, $value);
35
-		$itemO=new HtmlLink("item-".$count,"",$value);
35
+		$itemO=new HtmlLink("item-".$count, "", $value);
36 36
 		return $itemO->setClass("item");
37 37
 	}
38 38
 }
39 39
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlLabeledIconMenu.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,15 +12,15 @@  discard block
 block discarded – undo
12 12
  * @author jc
13 13
  * @version 1.001
14 14
  */
15
-class HtmlLabeledIconMenu extends HtmlMenu{
15
+class HtmlLabeledIconMenu extends HtmlMenu {
16 16
 
17 17
 
18 18
 	/**
19 19
 	 * @param string $identifier
20 20
 	 * @param array $items icons
21 21
 	 */
22
-	public function __construct( $identifier, $items=array()){
23
-		parent::__construct( $identifier, $items);
22
+	public function __construct($identifier, $items=array()) {
23
+		parent::__construct($identifier, $items);
24 24
 		$this->addToProperty("class", "labeled icon");
25 25
 	}
26 26
 
@@ -31,14 +31,14 @@  discard block
 block discarded – undo
31 31
 	protected function createItem($value) {
32 32
 		$text="";
33 33
 		$v=$value;
34
-		if(\is_array($value)){
34
+		if (\is_array($value)) {
35 35
 			$v=@$value[0];
36 36
 			$text=@$value[1];
37 37
 		}
38 38
 		$count=\sizeof($this->content);
39 39
 		$value=new HtmlIcon("icon-".$count, $v);
40
-		$value->wrap("",$text);
41
-		$itemO=new HtmlLink("item-".$count,"",$value);
40
+		$value->wrap("", $text);
41
+		$itemO=new HtmlLink("item-".$count, "", $value);
42 42
 		return $itemO->setClass("item");
43 43
 	}
44 44
 }
45 45
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlPopup.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 class HtmlPopup extends HtmlSemDoubleElement {
11 11
 	private $params;
12 12
 	private $_container;
13
-	public function __construct(BaseHtml $container,$identifier, $content="") {
13
+	public function __construct(BaseHtml $container, $identifier, $content="") {
14 14
 		parent::__construct($identifier, "div");
15 15
 		$this->_container=$container;
16 16
 		$this->setClass("ui popup");
@@ -18,11 +18,11 @@  discard block
 block discarded – undo
18 18
 		$this->params=array("on"=>"click");
19 19
 	}
20 20
 
21
-	public function setFlowing(){
21
+	public function setFlowing() {
22 22
 		return $this->addToProperty("class", "flowing");
23 23
 	}
24 24
 
25
-	public function setBasic(){
25
+	public function setBasic() {
26 26
 		return $this->addToProperty("class", "basic");
27 27
 	}
28 28
 
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
 	 * {@inheritDoc}
31 31
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run()
32 32
 	 */
33
-	public function run(JsUtils $js){
33
+	public function run(JsUtils $js) {
34 34
 		$this->params["popup"]="#".$this->identifier;
35
-		$js->semantic()->popup("#".$this->_container->getIdentifier(),$this->params);
35
+		$js->semantic()->popup("#".$this->_container->getIdentifier(), $this->params);
36 36
 	}
37 37
 }
38 38
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/common/BaseEnum.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 	public static function getConstants() {
15 15
 		if (self::$constCacheArray==NULL) {
16
-			self::$constCacheArray=[ ];
16
+			self::$constCacheArray=[];
17 17
 		}
18 18
 		$calledClass=get_called_class();
19 19
 		if (!array_key_exists($calledClass, self::$constCacheArray)) {
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
 		return self::$constCacheArray [$calledClass];
24 24
 	}
25 25
 
26
-	public static function getConstantValues($postFix=""){
27
-		if($postFix!=="")
26
+	public static function getConstantValues($postFix="") {
27
+		if ($postFix!=="")
28 28
 			return \array_values(self::getConstants());
29
-		else{
30
-			return \array_map(function ($elem) use ($postFix) {return $elem." ".$postFix;},\array_values(self::getConstants()));
29
+		else {
30
+			return \array_map(function($elem) use ($postFix) {return $elem." ".$postFix; },\array_values(self::getConstants()));
31 31
 		}
32 32
 	}
33 33
 
Please login to merge, or discard this patch.
Ajax/common/html/BaseHtml.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  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 ();
19
+	protected $properties=array();
20
+	protected $events=array();
21 21
 	protected $wrapBefore="";
22 22
 	protected $wrapAfter="";
23 23
 	protected $_bsComponent;
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
 	public function addToProperty($name, $value, $separator=" ") {
58 58
 		$v=@$this->properties[$name];
59
-		if (isset($v)&&$v!=="")
59
+		if (isset($v) && $v!=="")
60 60
 			$v=$v.$separator.$value;
61 61
 		else
62 62
 			$v=$value;
@@ -71,11 +71,11 @@  discard block
 block discarded – undo
71 71
 
72 72
 	public function compile(JsUtils $js=NULL, View $view=NULL) {
73 73
 		$result=$this->getTemplate();
74
-		foreach ( $this as $key => $value ) {
75
-			if (PhalconUtils::startsWith($key, "_")===false&&$key!=="events") {
74
+		foreach ($this as $key => $value) {
75
+			if (PhalconUtils::startsWith($key, "_")===false && $key!=="events") {
76 76
 				if (is_array($value)) {
77 77
 					$v=PropertyWrapper::wrap($value, $js);
78
-				} else {
78
+				}else {
79 79
 					$v=$value;
80 80
 				}
81 81
 				$result=str_ireplace("%".$key."%", $v, $result);
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 		if (isset($view)===true) {
88 88
 			$controls=$view->getVar("q");
89 89
 			if (isset($controls)===false) {
90
-				$controls=array ();
90
+				$controls=array();
91 91
 			}
92 92
 			$controls [$this->identifier]=$result;
93 93
 			$view->setVar("q", $controls);
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 			if (array_search($value, $typeCtrl)===false) {
101 101
 				throw new \Exception("La valeur passée a propriété `".$name."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
102 102
 			}
103
-		} else {
103
+		}else {
104 104
 			if (!$typeCtrl($value)) {
105 105
 				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$name);
106 106
 			}
@@ -108,9 +108,9 @@  discard block
 block discarded – undo
108 108
 		return true;
109 109
 	}
110 110
 
111
-	protected function propertyContains($propertyName,$value){
111
+	protected function propertyContains($propertyName, $value) {
112 112
 		$values=$this->getProperty($propertyName);
113
-		if(isset($values)){
113
+		if (isset($values)) {
114 114
 			return JString::contains($values, $value);
115 115
 		}
116 116
 		return false;
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 		return $this;
138 138
 	}
139 139
 
140
-	protected function removePropertyValue($name,$value){
140
+	protected function removePropertyValue($name, $value) {
141 141
 		$this->properties[$name]=\str_replace($value, "", $this->properties[$name]);
142 142
 	}
143 143
 
@@ -189,28 +189,28 @@  discard block
 block discarded – undo
189 189
 	}
190 190
 
191 191
 	public function fromArray($array) {
192
-		foreach ( $this as $key => $value ) {
192
+		foreach ($this as $key => $value) {
193 193
 			if (array_key_exists($key, $array) && !PhalconUtils::startsWith($key, "_")) {
194 194
 					$setter="set".ucfirst($key);
195 195
 					$this->$setter($array [$key]);
196 196
 				unset($array [$key]);
197 197
 			}
198 198
 		}
199
-		foreach ( $array as $key => $value ) {
199
+		foreach ($array as $key => $value) {
200 200
 			if (method_exists($this, $key)) {
201 201
 				try {
202 202
 					$this->$key($value);
203 203
 					unset($array [$key]);
204
-				} catch ( \Exception $e ) {
204
+				} catch (\Exception $e) {
205 205
 					// Nothing to do
206 206
 				}
207
-			} else {
207
+			}else {
208 208
 				$setter="set".ucfirst($key);
209 209
 				if (method_exists($this, $setter)) {
210 210
 					try {
211 211
 						$this->$setter($value);
212 212
 						unset($array [$key]);
213
-					} catch ( \Exception $e ) {
213
+					} catch (\Exception $e) {
214 214
 						// Nothing to do
215 215
 					}
216 216
 				}
@@ -219,21 +219,21 @@  discard block
 block discarded – undo
219 219
 		return $array;
220 220
 	}
221 221
 
222
-	public function fromDatabaseObjects($objects,$function) {
223
-		if(isset($objects)){
224
-			foreach ($objects as $object){
225
-				$this->fromDatabaseObject($object,$function);
222
+	public function fromDatabaseObjects($objects, $function) {
223
+		if (isset($objects)) {
224
+			foreach ($objects as $object) {
225
+				$this->fromDatabaseObject($object, $function);
226 226
 			}
227 227
 		}
228 228
 		return $this;
229 229
 	}
230 230
 
231
-	public function fromDatabaseObject($object,$function){
231
+	public function fromDatabaseObject($object, $function) {
232 232
 
233 233
 	}
234 234
 
235 235
 	public function wrap($before, $after="") {
236
-		if(isset($before)){
236
+		if (isset($before)) {
237 237
 			$this->wrapBefore.=$before;
238 238
 		}
239 239
 		$this->wrapAfter=$after.$this->wrapAfter;
@@ -255,13 +255,13 @@  discard block
 block discarded – undo
255 255
 		if (array_key_exists($event, $this->events)) {
256 256
 			if (is_array($this->events [$event])) {
257 257
 				$this->events [$event] []=$jsCode;
258
-			} else {
259
-				$this->events [$event]=array (
258
+			}else {
259
+				$this->events [$event]=array(
260 260
 						$this->events [$event],
261 261
 						$jsCode
262 262
 				);
263 263
 			}
264
-		} else {
264
+		}else {
265 265
 			$this->events [$event]=$jsCode;
266 266
 		}
267 267
 	}
@@ -280,14 +280,14 @@  discard block
 block discarded – undo
280 280
 
281 281
 	public function addEventsOnRun(JsUtils $js) {
282 282
 		if (isset($this->_bsComponent)) {
283
-			foreach ( $this->events as $event => $jsCode ) {
283
+			foreach ($this->events as $event => $jsCode) {
284 284
 				$code=$jsCode;
285 285
 				if (is_array($jsCode)) {
286 286
 					$code="";
287
-					foreach ( $jsCode as $jsC ) {
287
+					foreach ($jsCode as $jsC) {
288 288
 						if ($jsC instanceof AjaxCall) {
289 289
 							$code.="\n".$jsC->compile($js);
290
-						} else {
290
+						}else {
291 291
 							$code.="\n".$jsC;
292 292
 						}
293 293
 					}
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 	}
302 302
 
303 303
 	public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) {
304
-		$params=array (
304
+		$params=array(
305 305
 				"url" => $url,
306 306
 				"responseElement" => $responseElement
307 307
 		);
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 		if (is_array($elements)) {
341 341
 			$flag=false;
342 342
 			$index=0;
343
-			while ( !$flag&&$index<sizeof($elements) ) {
343
+			while (!$flag && $index<sizeof($elements)) {
344 344
 				if ($elements [$index] instanceof BaseHtml)
345 345
 					$flag=($elements [$index]->getIdentifier()===$identifier);
346 346
 				$index++;
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 		return null;
355 355
 	}
356 356
 
357
-	public function __toString(){
357
+	public function __toString() {
358 358
 		return $this->compile();
359 359
 	}
360 360
 
@@ -370,25 +370,25 @@  discard block
 block discarded – undo
370 370
 		if (is_array($value)) {
371 371
 			$value=implode(",", $value);
372 372
 		}
373
-		if (strrpos($value, 'this')===false&&strrpos($value, 'event')===false) {
373
+		if (strrpos($value, 'this')===false && strrpos($value, 'event')===false) {
374 374
 			$value='"'.$value.'"';
375 375
 		}
376 376
 		return $value;
377 377
 	}
378 378
 
379
-	public function jsDoJquery($jqueryCall, $param=""){
379
+	public function jsDoJquery($jqueryCall, $param="") {
380 380
 		return "$('#".$this->identifier."').".$jqueryCall."(".$this->_prep_value($param).");";
381 381
 	}
382 382
 
383
-	public function jsHtml($content=""){
384
-		return $this->jsDoJquery("html",$content);
383
+	public function jsHtml($content="") {
384
+		return $this->jsDoJquery("html", $content);
385 385
 	}
386 386
 
387
-	public function jsShow(){
387
+	public function jsShow() {
388 388
 		return $this->jsDoJquery("show");
389 389
 	}
390 390
 
391
-	public function jsHide(){
391
+	public function jsHide() {
392 392
 		return $this->jsDoJquery("hide");
393 393
 	}
394 394
 }
395 395
\ No newline at end of file
Please login to merge, or discard this patch.