Completed
Push — master ( c8eebb...4924e4 )
by Jean-Christophe
02:55
created
Ajax/php/cakephp/_JsUtils.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -8,23 +8,23 @@  discard block
 block discarded – undo
8 8
 use Cake\Network\Response;
9 9
 use Cake\Core\App;
10 10
 
11
-class _JsUtils extends \Ajax\JsUtils{
12
-	public function getUrl($url){
11
+class _JsUtils extends \Ajax\JsUtils {
12
+	public function getUrl($url) {
13 13
 		return Router::url($url);
14 14
 	}
15
-	public function addViewElement($identifier,$content,&$view){
15
+	public function addViewElement($identifier, $content, &$view) {
16 16
 		$viewVars=$view->viewVars;
17
-		if (isset($viewVars["q"]) === false) {
18
-			$controls=array ();
19
-		}else{
17
+		if (isset($viewVars["q"])===false) {
18
+			$controls=array();
19
+		} else {
20 20
 			$controls=$viewVars["q"];
21 21
 		}
22 22
 		$controls[$identifier]=$content;
23 23
 		$view->set("q", $controls);
24 24
 	}
25 25
 
26
-	public function createScriptVariable(&$view,$view_var, $output){
27
-		$view->set($view_var,$output);
26
+	public function createScriptVariable(&$view, $view_var, $output) {
27
+		$view->set($view_var, $output);
28 28
 	}
29 29
 
30 30
 	/**
@@ -34,18 +34,18 @@  discard block
 block discarded – undo
34 34
 	 * @param array $params
35 35
 	 * @see \Ajax\JsUtils::forward()
36 36
 	 */
37
-	public function forward($initialControllerInstance,$controllerName,$actionName,$params=array()){
37
+	public function forward($initialControllerInstance, $controllerName, $actionName, $params=array()) {
38 38
 		\ob_start();
39
-		if(isset($params) && \is_array($params)===false){
39
+		if (isset($params) && \is_array($params)===false) {
40 40
 			$params=[$params];
41 41
 		}
42 42
 		$url=h(Router::url(\array_merge([
43 43
 				'controller' => $controllerName,
44
-				'action' => $actionName],$params),false
44
+				'action' => $actionName], $params), false
45 45
 		));
46 46
 		$base=Router::url("/");
47
-		if (substr($url, 0, strlen($base)) == $base) {
48
-			$url = substr($url, strlen($base));
47
+		if (substr($url, 0, strlen($base))==$base) {
48
+			$url=substr($url, strlen($base));
49 49
 		}
50 50
 		$initialControllerInstance->requestAction($url);
51 51
 		$result=\ob_get_contents();
@@ -53,17 +53,17 @@  discard block
 block discarded – undo
53 53
 		return $result;
54 54
 	}
55 55
 
56
-	public function renderContent($initialControllerInstance,$viewName, $params=NULL) {
57
-		$view = new View(Router::getRequest(true), new Response());
58
-		if(\is_array($params)){
59
-			foreach ($params as $k=>$v){
56
+	public function renderContent($initialControllerInstance, $viewName, $params=NULL) {
57
+		$view=new View(Router::getRequest(true), new Response());
58
+		if (\is_array($params)) {
59
+			foreach ($params as $k=>$v) {
60 60
 				$view->set($k, $v);
61 61
 			}
62 62
 		}
63 63
 		return $view->render($viewName);
64 64
 	}
65 65
 
66
-	public function fromDispatcher($dispatcher){
66
+	public function fromDispatcher($dispatcher) {
67 67
 		return \explode("/", Router::getRequest(true)->url);
68 68
 	}
69 69
 }
70 70
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/HtmlBreadcrumb.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 		$this->startIndex=$startIndex;
52 52
 		$this->autoActive=$autoActive;
53 53
 		$this->_contentSeparator="<div class='divider'> / </div>";
54
-		$this->_hrefFunction=function ($e) {
54
+		$this->_hrefFunction=function($e) {
55 55
 			return $e->getContent();
56 56
 		};
57 57
 		if (isset($hrefFunction)) {
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 * @return HtmlBreadcrumbs
69 69
 	 */
70 70
 	public function autoGetOnClick($targetSelector) {
71
-		return $this->getOnClick($this->root, $targetSelector, array ("attr" => $this->attr ));
71
+		return $this->getOnClick($this->root, $targetSelector, array("attr" => $this->attr));
72 72
 	}
73 73
 
74 74
 	public function contentAsString() {
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
 	public function setActive($index=null) {
82 82
 		if (!isset($index)) {
83
-			$index=sizeof($this->content) - 1;
83
+			$index=sizeof($this->content)-1;
84 84
 		}
85 85
 		$activeItem=$this->content[$index];
86 86
 		$activeItem->addToProperty("class", "active");
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	 * @param Dispatcher $dispatcher the request dispatcher
94 94
 	 * @return \Ajax\bootstrap\html\HtmlBreadcrumbs
95 95
 	 */
96
-	public function fromDispatcher(JsUtils $js,$dispatcher, $startIndex=0) {
96
+	public function fromDispatcher(JsUtils $js, $dispatcher, $startIndex=0) {
97 97
 		return $this->addItems($js->fromDispatcher($dispatcher));
98 98
 	}
99 99
 
@@ -107,12 +107,12 @@  discard block
 block discarded – undo
107 107
 		if (!isset($index)) {
108 108
 			$index=sizeof($this->content);
109 109
 		}
110
-		if ($this->absolutePaths === true) {
110
+		if ($this->absolutePaths===true) {
111 111
 			return $this->_hrefFunction($this->content[$index]);
112 112
 		} else {
113
-			return $this->root . implode($separator, array_slice(array_map(function ($e) {
113
+			return $this->root.implode($separator, array_slice(array_map(function($e) {
114 114
 				return $this->_hrefFunction($e);
115
-			}, $this->content), $this->startIndex, $index + 1));
115
+			}, $this->content), $this->startIndex, $index+1));
116 116
 		}
117 117
 	}
118 118
 
@@ -146,8 +146,8 @@  discard block
 block discarded – undo
146 146
 			$this->setActive();
147 147
 		}
148 148
 		$count=$this->count();
149
-		for($i=1; $i < $count; $i++) {
150
-			$this->content[$i]->wrap($this->getContentDivider($i - 1));
149
+		for ($i=1; $i<$count; $i++) {
150
+			$this->content[$i]->wrap($this->getContentDivider($i-1));
151 151
 		}
152 152
 		return parent::compile($js, $view);
153 153
 	}
@@ -157,15 +157,15 @@  discard block
 block discarded – undo
157 157
 	 * @see \Ajax\bootstrap\html\base\BaseHtml::on()
158 158
 	 */
159 159
 	public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) {
160
-		foreach ( $this->content as $element ) {
160
+		foreach ($this->content as $element) {
161 161
 			$element->on($event, $jsCode, $stopPropagation, $preventDefault);
162 162
 		}
163 163
 		return $this;
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
 		}
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 	 */
181 181
 	protected function createItem($value) {
182 182
 		$count=$this->count();
183
-		$itemO=new HtmlSemDoubleElement("item-" . $this->identifier . "-" . $count, "a", "section");
183
+		$itemO=new HtmlSemDoubleElement("item-".$this->identifier."-".$count, "a", "section");
184 184
 		if (\is_array($value))
185 185
 			$itemO->fromArray($value);
186 186
 		else {
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	public function addIconAt($icon, $index) {
193 193
 		$item=$this->getItem($index);
194 194
 		if (isset($item)) {
195
-			$icon=new HtmlIcon("icon-" . $this->identifier, $icon);
195
+			$icon=new HtmlIcon("icon-".$this->identifier, $icon);
196 196
 			$item->wrapContent($icon);
197 197
 		}
198 198
 	}
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 	public function addItem($item) {
201 201
 		$count=$this->count();
202 202
 		$itemO=parent::addItem($item);
203
-		$this->addToPropertyCtrl("class", "section", array ("section" ));
203
+		$this->addToPropertyCtrl("class", "section", array("section"));
204 204
 		$itemO->setProperty($this->attr, $this->getHref($count));
205 205
 		return $itemO;
206 206
 	}
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 	public function setAbsolutePaths($absolutePaths) {
217 217
 		$this->absolutePaths=$absolutePaths;
218 218
 		$size=\sizeof($this->content);
219
-		for($i=0;$i<$size;$i++){
219
+		for ($i=0; $i<$size; $i++) {
220 220
 			$this->content[$i]->setProperty($this->attr, $this->getHref($i));
221 221
 		}
222 222
 		return $this;
Please login to merge, or discard this patch.
Ajax/php/micro/JsUtils.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -4,34 +4,34 @@
 block discarded – undo
4 4
 
5 5
 use micro\controllers\Startup;
6 6
 use micro\utils\RequestUtils;
7
-class JsUtils extends \Ajax\JsUtils{
7
+class JsUtils extends \Ajax\JsUtils {
8 8
 
9
-	public function getUrl($url){
9
+	public function getUrl($url) {
10 10
 		return RequestUtils::getUrl($url);
11 11
 	}
12 12
 
13
-	public function addViewElement($identifier,$content,&$view){
13
+	public function addViewElement($identifier, $content, &$view) {
14 14
 		$controls=$view->getVar("q");
15
-		if (isset($controls) === false) {
16
-			$controls=array ();
15
+		if (isset($controls)===false) {
16
+			$controls=array();
17 17
 		}
18 18
 		$controls[$identifier]=$content;
19 19
 		$view->setVar("q", $controls);
20 20
 	}
21 21
 
22
-	public function createScriptVariable(&$view,$view_var, $output){
23
-		$view->setVar($view_var,$output);
22
+	public function createScriptVariable(&$view, $view_var, $output) {
23
+		$view->setVar($view_var, $output);
24 24
 	}
25 25
 
26
-	public function forward($initialController,$controller,$action,$params=array()){
27
-		return $initialController->forward($controller,$action,$params,true,true,true);
26
+	public function forward($initialController, $controller, $action, $params=array()) {
27
+		return $initialController->forward($controller, $action, $params, true, true, true);
28 28
 	}
29 29
 
30
-	public function renderContent($initialControllerInstance,$viewName, $params=NULL) {
31
-		return $initialControllerInstance->loadView($viewName,$params,true);
30
+	public function renderContent($initialControllerInstance, $viewName, $params=NULL) {
31
+		return $initialControllerInstance->loadView($viewName, $params, true);
32 32
 	}
33 33
 
34
-	public function fromDispatcher($dispatcher){
34
+	public function fromDispatcher($dispatcher) {
35 35
 		return Startup::$urlParts;
36 36
 	}
37 37
 }
38 38
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlAbsractItem.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 abstract class HtmlAbsractItem extends HtmlSemDoubleElement {
13 13
 
14
-	public function __construct($identifier, $baseClass,$content=NULL) {
14
+	public function __construct($identifier, $baseClass, $content=NULL) {
15 15
 		parent::__construct($identifier, "div", $baseClass);
16 16
 		$this->content=array();
17 17
 		$this->initContent($content);
@@ -19,41 +19,41 @@  discard block
 block discarded – undo
19 19
 
20 20
 	protected abstract function initContent($content);
21 21
 
22
-	public function setIcon($icon){
22
+	public function setIcon($icon) {
23 23
 		$this->content["icon"]=new HtmlIcon("icon-".$this->identifier, $icon);
24 24
 	}
25 25
 
26
-	public function setImage($image){
26
+	public function setImage($image) {
27 27
 		$image=new HtmlImg("icon-".$this->identifier, $image);
28 28
 		$image->asAvatar();
29 29
 		$this->content["image"]=$image;
30 30
 	}
31 31
 
32
-	private function createContent(){
33
-		$this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier,"div","content");
32
+	private function createContent() {
33
+		$this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content");
34 34
 		return $this->content["content"];
35 35
 	}
36 36
 
37
-	public function setTitle($title,$description=NULL,$baseClass="title"){
38
-		$title=new HtmlSemDoubleElement("","div",$baseClass,$title);
39
-		if(\array_key_exists("content", $this->content)===false){
37
+	public function setTitle($title, $description=NULL, $baseClass="title") {
38
+		$title=new HtmlSemDoubleElement("", "div", $baseClass, $title);
39
+		if (\array_key_exists("content", $this->content)===false) {
40 40
 			$this->createContent();
41 41
 		}
42 42
 		$this->content["content"]->addContent($title);
43
-		if(isset($description)){
44
-			$description=new HtmlSemDoubleElement("","div","description",$description);
43
+		if (isset($description)) {
44
+			$description=new HtmlSemDoubleElement("", "div", "description", $description);
45 45
 			$this->content["content"]->addContent($description);
46 46
 		}
47 47
 		return $this;
48 48
 	}
49 49
 
50
-	public function getPart($partName="header"){
51
-		$content=\array_merge($this->content["content"]->getContent(),array(@$this->content["icon"],@$this->content["image"]));
50
+	public function getPart($partName="header") {
51
+		$content=\array_merge($this->content["content"]->getContent(), array(@$this->content["icon"], @$this->content["image"]));
52 52
 		return $this->getElementByPropertyValue("class", $partName, $content);
53 53
 	}
54 54
 
55
-	public function setActive($value=true){
56
-		if($value){
55
+	public function setActive($value=true) {
56
+		if ($value) {
57 57
 			$this->setTagName("div");
58 58
 			$this->removeProperty("href");
59 59
 			$this->addToPropertyCtrl("class", "active", array("active"));
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
 		return $this;
62 62
 	}
63 63
 
64
-	public function asLink($href=NULL,$part=NULL){
64
+	public function asLink($href=NULL, $part=NULL) {
65 65
 		$this->setTagName("a");
66
-		if(isset($href))
66
+		if (isset($href))
67 67
 			$this->setProperty("href", $href);
68 68
 		return $this;
69 69
 	}
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile()
76 76
 	 */
77 77
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
78
-		if(\is_array($this->content))
79
-			$this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]);
78
+		if (\is_array($this->content))
79
+			$this->content=JArray::sortAssociative($this->content, ["icon", "image", "content"]);
80 80
 		return parent::compile($js, $view);
81 81
 	}
82 82
 }
83 83
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlStepItem.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -8,52 +8,52 @@
 block discarded – undo
8 8
 class HtmlStepItem extends HtmlAbsractItem {
9 9
 
10 10
 	public function __construct($identifier, $content) {
11
-		parent::__construct($identifier,"step",$content);
11
+		parent::__construct($identifier, "step", $content);
12 12
 	}
13
-	protected function initContent($content){
14
-		if(\is_array($content)){
15
-			if(JArray::isAssociative($content)===false){
13
+	protected function initContent($content) {
14
+		if (\is_array($content)) {
15
+			if (JArray::isAssociative($content)===false) {
16 16
 				$icon=@$content[0];
17 17
 				$title=@$content[1];
18 18
 				$desc=@$content[2];
19 19
 				$status=@$content[3];
20
-			}else{
20
+			} else {
21 21
 				$icon=@$content["icon"];
22 22
 				$title=@$content["title"];
23 23
 				$desc=@$content["description"];
24 24
 				$status=@$content["status"];
25 25
 			}
26
-			if(isset($icon)===true){
26
+			if (isset($icon)===true) {
27 27
 				$this->setIcon($icon);
28 28
 			}
29
-			if(isset($status)===true){
29
+			if (isset($status)===true) {
30 30
 				$this->setStatus($status);
31 31
 			}
32
-			if(isset($title)===true){
33
-				$this->setTitle($title,$desc);
32
+			if (isset($title)===true) {
33
+				$this->setTitle($title, $desc);
34 34
 			}
35
-		}else{
35
+		} else {
36 36
 			$this->setContent($content);
37 37
 		}
38 38
 	}
39 39
 
40
-	public function setActive($value=true){
41
-		if($value)
40
+	public function setActive($value=true) {
41
+		if ($value)
42 42
 			$this->setStatus(StepStatus::ACTIVE);
43 43
 		else
44 44
 			$this->setStatus(StepStatus::NONE);
45 45
 		return $this;
46 46
 	}
47 47
 
48
-	public function setCompleted(){
48
+	public function setCompleted() {
49 49
 		return $this->setStatus(StepStatus::COMPLETED);
50 50
 	}
51 51
 
52
-	public function setStatus($status){
52
+	public function setStatus($status) {
53 53
 		return $this->addToPropertyCtrl("class", $status, StepStatus::getConstants());
54 54
 	}
55 55
 
56
-	public function removeStatus(){
56
+	public function removeStatus() {
57 57
 		$this->removePropertyValues("class", StepStatus::getConstants());
58 58
 	}
59 59
 }
60 60
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/base/traits/BaseTrait.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@  discard block
 block discarded – undo
8 8
 use Ajax\semantic\html\elements\HtmlIcon;
9 9
 
10 10
 trait BaseTrait {
11
-	protected $_variations=[ ];
12
-	protected $_states=[ ];
11
+	protected $_variations=[];
12
+	protected $_states=[];
13 13
 	protected $_baseClass;
14 14
 
15 15
 	protected abstract function setPropertyCtrl($name, $value, $typeCtrl);
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 		$this->setProperty("class", $this->_baseClass);
38 38
 		if (\is_string($variations))
39 39
 			$variations=\explode(" ", $variations);
40
-		foreach ( $variations as $variation ) {
40
+		foreach ($variations as $variation) {
41 41
 			$this->addVariation($variation);
42 42
 		}
43 43
 		return $this;
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	public function addVariations($variations=array()) {
52 52
 		if (\is_string($variations))
53 53
 			$variations=\explode(" ", $variations);
54
-		foreach ( $variations as $variation ) {
54
+		foreach ($variations as $variation) {
55 55
 			$this->addVariation($variation);
56 56
 		}
57 57
 		return $this;
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	public function addStates($states=array()) {
61 61
 		if (\is_string($states))
62 62
 			$states=\explode(" ", $states);
63
-		foreach ( $states as $state ) {
63
+		foreach ($states as $state) {
64 64
 			$this->addState($state);
65 65
 		}
66 66
 		return $this;
@@ -70,14 +70,14 @@  discard block
 block discarded – undo
70 70
 		$this->setProperty("class", $this->_baseClass);
71 71
 		if (\is_string($states))
72 72
 			$states=\explode(" ", $states);
73
-		foreach ( $states as $state ) {
73
+		foreach ($states as $state) {
74 74
 			$this->addState($state);
75 75
 		}
76 76
 		return $this;
77 77
 	}
78 78
 
79 79
 	public function addIcon($icon, $before=true) {
80
-		return $this->addContent(new HtmlIcon("icon-" . $this->identifier, $icon), $before);
80
+		return $this->addContent(new HtmlIcon("icon-".$this->identifier, $icon), $before);
81 81
 	}
82 82
 
83 83
 	/**
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 * show it is currently the active user selection
120 120
 	 * @return \Ajax\semantic\html\base\HtmlSemDoubleElement
121 121
 	 */
122
-	public function setActive($value=true){
122
+	public function setActive($value=true) {
123 123
 		return $this->addToProperty("class", "active");
124 124
 	}
125 125
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 	}
136 136
 
137 137
 	public function setFloated($direction="right") {
138
-		return $this->addToPropertyCtrl("class", $direction . " floated", Direction::getConstantValues("floated"));
138
+		return $this->addToPropertyCtrl("class", $direction." floated", Direction::getConstantValues("floated"));
139 139
 	}
140 140
 
141 141
 	public function floatRight() {
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlModal.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -15,117 +15,117 @@  discard block
 block discarded – undo
15 15
 	protected $_paramParts=array();
16 16
 
17 17
 	public function __construct($identifier, $header="", $content="", $actions=array()) {
18
-		parent::__construct($identifier, "div","ui modal");
19
-		if(isset($header)){
18
+		parent::__construct($identifier, "div", "ui modal");
19
+		if (isset($header)) {
20 20
 			$this->setHeader($header);
21 21
 		}
22
-		if(isset($content)){
22
+		if (isset($content)) {
23 23
 			$this->setContent($content);
24 24
 		}
25
-		if(isset($actions)){
25
+		if (isset($actions)) {
26 26
 			$this->setActions($actions);
27 27
 		}
28 28
 	}
29 29
 
30 30
 	public function setHeader($value) {
31
-		$this->content["header"]=new HtmlSemDoubleElement("header-" . $this->identifier, "a", "header", $value);
31
+		$this->content["header"]=new HtmlSemDoubleElement("header-".$this->identifier, "a", "header", $value);
32 32
 		return $this;
33 33
 	}
34 34
 
35 35
 	public function setContent($value) {
36
-		$this->content["content"]=new HtmlSemDoubleElement("content-" . $this->identifier, "div", "content", $value);
36
+		$this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content", $value);
37 37
 		return $this;
38 38
 	}
39 39
 
40 40
 	public function setActions($actions) {
41
-		$this->content["actions"]=new HtmlSemDoubleElement("content-" . $this->identifier, "div", "actions");
42
-		if(\is_array($actions)){
43
-			foreach ($actions as $action){
41
+		$this->content["actions"]=new HtmlSemDoubleElement("content-".$this->identifier, "div", "actions");
42
+		if (\is_array($actions)) {
43
+			foreach ($actions as $action) {
44 44
 				$this->addAction($action);
45 45
 			}
46 46
 		}
47
-		else{
47
+		else {
48 48
 			$this->addAction($actions);
49 49
 		}
50 50
 		return $this;
51 51
 	}
52 52
 
53
-	public function addAction($action){
54
-		if(!$action instanceof BaseHtml){
53
+	public function addAction($action) {
54
+		if (!$action instanceof BaseHtml) {
55 55
 			$class="";
56
-			if(\array_search($action, ["Okay","Yes"])!==false){
56
+			if (\array_search($action, ["Okay", "Yes"])!==false) {
57 57
 				$class="approve";
58 58
 			}
59
-			if(\array_search($action, ["Cancel","No"])!==false){
59
+			if (\array_search($action, ["Cancel", "No"])!==false) {
60 60
 				$class="cancel";
61 61
 			}
62
-			$action=new HtmlButton("action-".$this->identifier,$action);
63
-			if($class!=="")
62
+			$action=new HtmlButton("action-".$this->identifier, $action);
63
+			if ($class!=="")
64 64
 				$action->addToProperty("class", $class);
65 65
 		}
66 66
 		return $this->addElementInPart($action, "actions");
67 67
 	}
68 68
 
69
-	public function addContent($content,$before=false){
70
-		$this->content["content"]->addContent($content,$before);
69
+	public function addContent($content, $before=false) {
70
+		$this->content["content"]->addContent($content, $before);
71 71
 		return $this;
72 72
 	}
73 73
 
74
-	public function addImageContent($image,$description=NULL){
74
+	public function addImageContent($image, $description=NULL) {
75 75
 		$content=$this->content["content"];
76
-		if(isset($description)){
77
-			$description=new HtmlSemDoubleElement("description-".$this->identifier,"div","description",$description);
78
-			$content->addContent($description,true);
76
+		if (isset($description)) {
77
+			$description=new HtmlSemDoubleElement("description-".$this->identifier, "div", "description", $description);
78
+			$content->addContent($description, true);
79 79
 		}
80
-		if($image!==""){
81
-			$img=new HtmlImage("image-".$this->identifier,$image,"","medium");
82
-			$content->addContent($img,true);
83
-			$content->addToProperty("class","image");
80
+		if ($image!=="") {
81
+			$img=new HtmlImage("image-".$this->identifier, $image, "", "medium");
82
+			$content->addContent($img, true);
83
+			$content->addToProperty("class", "image");
84 84
 		}
85 85
 		return $this;
86 86
 	}
87 87
 
88
-	public function addIconContent($icon,$description=NULL){
88
+	public function addIconContent($icon, $description=NULL) {
89 89
 		$content=$this->content["content"];
90
-		if(isset($description)){
91
-			$description=new HtmlSemDoubleElement("description-".$this->identifier,"div","description",$description);
92
-			$content->addContent($description,true);
90
+		if (isset($description)) {
91
+			$description=new HtmlSemDoubleElement("description-".$this->identifier, "div", "description", $description);
92
+			$content->addContent($description, true);
93 93
 		}
94
-		if($icon!==""){
95
-			$img=new HtmlIcon("image-".$this->identifier,$icon);
96
-			$content->addContent($img,true);
97
-			$content->addToProperty("class","image");
94
+		if ($icon!=="") {
95
+			$img=new HtmlIcon("image-".$this->identifier, $icon);
96
+			$content->addContent($img, true);
97
+			$content->addToProperty("class", "image");
98 98
 		}
99 99
 		return $this;
100 100
 	}
101 101
 
102
-	private function addContentInPart($content,$uiClass,$part) {
103
-		return $this->addElementInPart(new HtmlSemDoubleElement($part."-" . $this->identifier, "div", $uiClass, $content), $part);
102
+	private function addContentInPart($content, $uiClass, $part) {
103
+		return $this->addElementInPart(new HtmlSemDoubleElement($part."-".$this->identifier, "div", $uiClass, $content), $part);
104 104
 	}
105 105
 
106
-	private function addElementInPart($element,$part) {
106
+	private function addElementInPart($element, $part) {
107 107
 		$this->content[$part]->addContent($element);
108 108
 		return $element;
109 109
 	}
110 110
 
111
-	public function showDimmer($value){
112
-		$value=$value?"show":"hide";
111
+	public function showDimmer($value) {
112
+		$value=$value ? "show" : "hide";
113 113
 		$this->_paramParts[]=["'".$value." dimmer'"];
114 114
 		return $this;
115 115
 	}
116 116
 
117
-	public function setInverted(){
117
+	public function setInverted() {
118 118
 		$this->_params["inverted"]=true;
119 119
 		return $this;
120 120
 	}
121 121
 
122
-	public function setBasic(){
122
+	public function setBasic() {
123 123
 		return $this->addToProperty("class", "basic");
124 124
 	}
125 125
 
126 126
 
127
-	public function setTransition($value){
128
-		$this->_paramParts[]=["'setting'","'transition'","'".$value."'"];
127
+	public function setTransition($value) {
128
+		$this->_paramParts[]=["'setting'", "'transition'", "'".$value."'"];
129 129
 	}
130 130
 
131 131
 	/**
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
 	 * @param string $viewName
136 136
 	 * @param $params The parameters to pass to the view
137 137
 	 */
138
-	public function renderView(JsUtils $js,$initialController,$viewName, $params=array()) {
139
-		return $this->setContent($js->renderContent($initialController, $viewName,$params));
138
+	public function renderView(JsUtils $js, $initialController, $viewName, $params=array()) {
139
+		return $this->setContent($js->renderContent($initialController, $viewName, $params));
140 140
 	}
141 141
 
142 142
 	/**
@@ -147,8 +147,8 @@  discard block
 block discarded – undo
147 147
 	 * @param string $controllerName the controller name
148 148
 	 * @param string $actionName the action name
149 149
 	 */
150
-	public function forward(JsUtils $js,$initialControllerInstance,$controllerName,$actionName,$params=NULL){
151
-		return $this->setContent($js->forward($initialControllerInstance, $controllerName, $actionName,$params));
150
+	public function forward(JsUtils $js, $initialControllerInstance, $controllerName, $actionName, $params=NULL) {
151
+		return $this->setContent($js->forward($initialControllerInstance, $controllerName, $actionName, $params));
152 152
 	}
153 153
 
154 154
 	/**
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile()
159 159
 	 */
160 160
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
161
-		$this->content=JArray::sortAssociative($this->content, ["header","content","actions" ]);
161
+		$this->content=JArray::sortAssociative($this->content, ["header", "content", "actions"]);
162 162
 		return parent::compile($js, $view);
163 163
 	}
164 164
 	/*
@@ -166,8 +166,8 @@  discard block
 block discarded – undo
166 166
 	 * @see BaseHtml::run()
167 167
 	 */
168 168
 	public function run(JsUtils $js) {
169
-		if(isset($this->_bsComponent)===false)
170
-			$this->_bsComponent=$js->semantic()->modal("#".$this->identifier,$this->_params,$this->_paramParts);
169
+		if (isset($this->_bsComponent)===false)
170
+			$this->_bsComponent=$js->semantic()->modal("#".$this->identifier, $this->_params, $this->_paramParts);
171 171
 		$this->addEventsOnRun($js);
172 172
 		return $this->_bsComponent;
173 173
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlAccordion.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -6,31 +6,31 @@  discard block
 block discarded – undo
6 6
 use Ajax\semantic\html\content\HtmlAccordionItem;
7 7
 use Ajax\JsUtils;
8 8
 
9
-class HtmlAccordion extends HtmlSemCollection{
9
+class HtmlAccordion extends HtmlSemCollection {
10 10
 
11 11
 	protected $params=array();
12 12
 
13
-	public function __construct( $identifier, $tagName="div", $baseClass="ui"){
14
-		parent::__construct( $identifier, "div", "ui accordion");
13
+	public function __construct($identifier, $tagName="div", $baseClass="ui") {
14
+		parent::__construct($identifier, "div", "ui accordion");
15 15
 	}
16 16
 
17 17
 
18
-	protected function createItem($value){
18
+	protected function createItem($value) {
19 19
 		$count=$this->count();
20 20
 		$title=$value;
21 21
 		$content=NULL;
22
-		if(\is_array($value)){
23
-			$title=@$value[0];$content=@$value[1];
22
+		if (\is_array($value)) {
23
+			$title=@$value[0]; $content=@$value[1];
24 24
 		}
25
-		return new HtmlAccordionItem("item-".$this->identifier."-".$count, $title,$content);
25
+		return new HtmlAccordionItem("item-".$this->identifier."-".$count, $title, $content);
26 26
 	}
27 27
 
28
-	protected function createCondition($value){
28
+	protected function createCondition($value) {
29 29
 		return ($value instanceof HtmlAccordionItem)===false;
30 30
 	}
31 31
 
32
-	public function addPanel($title,$content){
33
-		return $this->addItem([$title,$content]);
32
+	public function addPanel($title, $content) {
33
+		return $this->addItem([$title, $content]);
34 34
 	}
35 35
 
36 36
 	/**
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 	 * @param string $action a Phalcon action
43 43
 	 * @param array $params
44 44
 	 */
45
-	public function forwardPanel(JsUtils $js,$title,$initialController,$controller,$action,$params=array()){
46
-		return $this->addPanel($title, $js->forward($initialController, $controller, $action,$params));
45
+	public function forwardPanel(JsUtils $js, $title, $initialController, $controller, $action, $params=array()) {
46
+		return $this->addPanel($title, $js->forward($initialController, $controller, $action, $params));
47 47
 	}
48 48
 
49 49
 	/**
@@ -54,30 +54,30 @@  discard block
 block discarded – undo
54 54
 	 * @param string $viewName
55 55
 	 * @param $params The parameters to pass to the view
56 56
 	 */
57
-	public function renderViewPanel(JsUtils $js,$title,$initialController, $viewName, $params=array()) {
58
-		return $this->addPanel($title, $js->renderContent($initialController, $viewName,$params));
57
+	public function renderViewPanel(JsUtils $js, $title, $initialController, $viewName, $params=array()) {
58
+		return $this->addPanel($title, $js->renderContent($initialController, $viewName, $params));
59 59
 	}
60 60
 	/*
61 61
 	 * (non-PHPdoc)
62 62
 	 * @see BaseHtml::run()
63 63
 	 */
64 64
 	public function run(JsUtils $js) {
65
-		if(isset($this->_bsComponent)===false)
66
-			$this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params);
65
+		if (isset($this->_bsComponent)===false)
66
+			$this->_bsComponent=$js->semantic()->accordion("#".$this->identifier, $this->params);
67 67
 			$this->addEventsOnRun($js);
68 68
 			return $this->_bsComponent;
69 69
 	}
70 70
 
71
-	public function setStyled(){
71
+	public function setStyled() {
72 72
 		return $this->addToProperty("class", "styled");
73 73
 	}
74 74
 
75
-	public function activate($index){
75
+	public function activate($index) {
76 76
 		$this->getItem($index)->setActive(true);
77 77
 		return $this;
78 78
 	}
79 79
 
80
-	public function setExclusive($value){
80
+	public function setExclusive($value) {
81 81
 		$this->params["exclusive"]=$value;
82 82
 	}
83 83
 }
84 84
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/menus/HtmlMenu.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
 	 * @return \Ajax\semantic\html\collections\HtmlMenu
39 39
 	 */
40 40
 	public function setType($type="") {
41
-		return $this->addToPropertyCtrl("class", $type, array ("","item","text" ));
41
+		return $this->addToPropertyCtrl("class", $type, array("", "item", "text"));
42 42
 	}
43 43
 
44 44
 	public function setActiveItem($index) {
45 45
 		$item=$this->getItem($index);
46
-		if ($item !== null) {
46
+		if ($item!==null) {
47 47
 			$item->addToProperty("class", "active");
48 48
 		}
49 49
 		return $this;
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
 	private function getItemToInsert($item) {
53 53
 		if ($item instanceof HtmlInput || $item instanceof HtmlImg || $item instanceof HtmlIcon || $item instanceof HtmlButton || ($item instanceof HtmlDropdown && $this->propertyContains("class", "vertical")===false)) {
54
-			$itemO=new HtmlSemDoubleElement("item-" . $this->identifier, "div", "");
54
+			$itemO=new HtmlSemDoubleElement("item-".$this->identifier, "div", "");
55 55
 			$itemO->setContent($item);
56 56
 			$item=$itemO;
57 57
 		}
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
 	private function afterInsert($item) {
62 62
 		if (!$item instanceof HtmlMenu)
63
-			$item->addToPropertyCtrl("class", "item", array ("item" ));
63
+			$item->addToPropertyCtrl("class", "item", array("item"));
64 64
 		else {
65 65
 			$this->setSecondary();
66 66
 		}
@@ -91,9 +91,9 @@  discard block
 block discarded – undo
91 91
 
92 92
 	public function generateMenuAsItem($menu, $header=null) {
93 93
 		$count=$this->count();
94
-		$item=new HtmlSemDoubleElement("item-" . $this->identifier . "-" . $count, "div");
94
+		$item=new HtmlSemDoubleElement("item-".$this->identifier."-".$count, "div");
95 95
 		if (isset($header)) {
96
-			$headerItem=new HtmlSemDoubleElement("item-header-" . $this->identifier . "-" . $count, "div", "header");
96
+			$headerItem=new HtmlSemDoubleElement("item-header-".$this->identifier."-".$count, "div", "header");
97 97
 			$headerItem->setContent($header);
98 98
 			$item->addContent($headerItem);
99 99
 			$this->_itemHeader=$headerItem;
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 		$value=new HtmlSemDoubleElement($identifier, "a", "browse item", $value);
112 112
 		$value->addContent(new HtmlIcon("", "dropdown"));
113 113
 		$value=$this->addItem($value);
114
-		$popup=new HtmlPopup($value, "popup-" . $this->identifier . "-" . $this->count(), $content);
114
+		$popup=new HtmlPopup($value, "popup-".$this->identifier."-".$this->count(), $content);
115 115
 		$popup->setFlowing()->setPosition("bottom left")->setOn("click");
116 116
 		$this->wrap("", $popup);
117 117
 		return $popup;
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	public function addDropdownAsItem($value, $items=NULL) {
121 121
 		$dd=$value;
122 122
 		if (\is_string($value)) {
123
-			$dd=new HtmlDropdown("dropdown-" . $this->identifier . "-" . $this->count(), $value, $items);
123
+			$dd=new HtmlDropdown("dropdown-".$this->identifier."-".$this->count(), $value, $items);
124 124
 		}
125 125
 		return $this->addItem($dd);
126 126
 	}
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 	 * @see \Ajax\common\html\html5\HtmlCollection::createItem()
133 133
 	 */
134 134
 	protected function createItem($value) {
135
-		$itemO=new HtmlLink($this->identifier."item" . \sizeof($this->content), "", $value);
135
+		$itemO=new HtmlLink($this->identifier."item".\sizeof($this->content), "", $value);
136 136
 		return $itemO->setClass("item");
137 137
 	}
138 138
 
@@ -145,28 +145,28 @@  discard block
 block discarded – undo
145 145
 	}
146 146
 
147 147
 	public function setVertical() {
148
-		return $this->addToPropertyCtrl("class", "vertical", array ("vertical" ));
148
+		return $this->addToPropertyCtrl("class", "vertical", array("vertical"));
149 149
 	}
150 150
 
151 151
 	public function setPosition($value="right") {
152
-		return $this->addToPropertyCtrl("class", $value, array ("right","left" ));
152
+		return $this->addToPropertyCtrl("class", $value, array("right", "left"));
153 153
 	}
154 154
 
155 155
 	public function setPointing($value=Direction::NONE) {
156
-		return $this->addToPropertyCtrl("class", $value . " pointing", Direction::getConstantValues("pointing"));
156
+		return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
157 157
 	}
158 158
 
159 159
 	public function asTab($vertical=false) {
160
-		$this->apply(function (HtmlDoubleElement &$item) {
160
+		$this->apply(function(HtmlDoubleElement&$item) {
161 161
 			$item->setTagName("a");
162 162
 		});
163
-		if ($vertical === true)
163
+		if ($vertical===true)
164 164
 			$this->setVertical();
165 165
 		return $this->addToProperty("class", "tabular");
166 166
 	}
167 167
 
168 168
 	public function asPagination() {
169
-		$this->apply(function (HtmlDoubleElement &$item) {
169
+		$this->apply(function(HtmlDoubleElement&$item) {
170 170
 			$item->setTagName("a");
171 171
 		});
172 172
 		return $this->addToProperty("class", "pagination");
@@ -203,10 +203,10 @@  discard block
 block discarded – undo
203 203
 	 */
204 204
 	public function setWidth($width) {
205 205
 		if (\is_int($width)) {
206
-			$width=Wide::getConstants()["W" . $width];
206
+			$width=Wide::getConstants()["W".$width];
207 207
 		}
208 208
 		$this->addToPropertyCtrl("class", $width, Wide::getConstants());
209
-		return $this->addToPropertyCtrl("class", "item", array ("item" ));
209
+		return $this->addToPropertyCtrl("class", "item", array("item"));
210 210
 	}
211 211
 
212 212
 	public function addImage($identifier, $src="", $alt="") {
Please login to merge, or discard this patch.