Completed
Push — master ( 5b3666...b3a3fe )
by Jean-Christophe
04:35
created
Ajax/semantic/html/modules/HtmlDimmer.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 class HtmlDimmer extends HtmlSemDoubleElement {
11 11
 	private $_container;
12
-	private $_params=array ();
12
+	private $_params=array();
13 13
 	private $_inverted;
14 14
 
15 15
 	public function __construct($identifier, $content=NULL) {
@@ -19,14 +19,14 @@  discard block
 block discarded – undo
19 19
 	}
20 20
 
21 21
 	public function setContent($content) {
22
-		$this->content=new HtmlSemDoubleElement("content-" . $this->identifier, "div", "content", new HtmlSemDoubleElement("", "div", "center", $content));
22
+		$this->content=new HtmlSemDoubleElement("content-".$this->identifier, "div", "content", new HtmlSemDoubleElement("", "div", "center", $content));
23 23
 		return $this;
24 24
 	}
25 25
 
26 26
 	public function asIcon($icon, $title, $subHeader=NULL) {
27
-		$header=new HtmlHeader("header-" . $this->identifier);
27
+		$header=new HtmlHeader("header-".$this->identifier);
28 28
 		$header->asIcon($icon, $title, $subHeader);
29
-		if ($this->_inverted === false)
29
+		if ($this->_inverted===false)
30 30
 			$header->setInverted();
31 31
 		return $this->setContent($header);
32 32
 	}
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
 
44 44
 	public function run(JsUtils $js) {
45 45
 		if ($this->_container instanceof HtmlSingleElement)
46
-			$this->_bsComponent=$js->semantic()->dimmer("#" . $this->_container->getIdentifier(), $this->_params);
46
+			$this->_bsComponent=$js->semantic()->dimmer("#".$this->_container->getIdentifier(), $this->_params);
47 47
 		return parent::run($js);
48 48
 	}
49 49
 
50 50
 	public function jsShow() {
51
-		if (isset($this->_container) === true)
52
-			return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");';
51
+		if (isset($this->_container)===true)
52
+			return '$("#.'.$this->_container->getIdentifier().').dimmer("show");';
53 53
 	}
54 54
 
55 55
 	public function setBlurring() {
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlSearch.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -8,13 +8,13 @@  discard block
 block discarded – undo
8 8
 use Ajax\semantic\html\base\constants\Direction;
9 9
 
10 10
 class HtmlSearch extends HtmlSemDoubleElement {
11
-	private $_elements=array ();
12
-	private $_params=array ();
13
-	private $_searchFields=array ("title" );
11
+	private $_elements=array();
12
+	private $_params=array();
13
+	private $_searchFields=array("title");
14 14
 	private $_local=false;
15 15
 
16 16
 	public function __construct($identifier, $placeholder=NULL, $icon=NULL) {
17
-		parent::__construct("search-" . $identifier, "div", "ui search", array ());
17
+		parent::__construct("search-".$identifier, "div", "ui search", array());
18 18
 		$this->createField($placeholder, $icon);
19 19
 		$this->createResult();
20 20
 		$this->_params["type"]="standard";
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
 
23 23
 	private function createField($placeholder=NULL, $icon=NULL) {
24 24
 		$field=new HtmlInput($this->identifier);
25
-		if (isset($placeholder) === true)
25
+		if (isset($placeholder)===true)
26 26
 			$field->setPlaceholder($placeholder);
27
-		if (isset($icon) === true)
27
+		if (isset($icon)===true)
28 28
 			$field->addIcon($icon, Direction::RIGHT);
29 29
 		$field->getField()->setClass("prompt");
30 30
 		$this->content["field"]=$field;
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	}
33 33
 
34 34
 	private function createResult() {
35
-		$this->content["result"]=new HtmlSemDoubleElement("results-" . $this->identifier, "div", "results");
35
+		$this->content["result"]=new HtmlSemDoubleElement("results-".$this->identifier, "div", "results");
36 36
 		return $this->content["result"];
37 37
 	}
38 38
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	}
50 50
 
51 51
 	public function setUrl($url) {
52
-		$this->_params["apiSettings"]="%{url: %quote%" . $url . "%quote%}%";
52
+		$this->_params["apiSettings"]="%{url: %quote%".$url."%quote%}%";
53 53
 		return $this;
54 54
 	}
55 55
 
@@ -72,16 +72,16 @@  discard block
 block discarded – undo
72 72
 	}
73 73
 
74 74
 	public function run(JsUtils $js) {
75
-		$this->_params["onSelect"]='%function(result,response){$(%quote%#' . $this->identifier . '%quote%).trigger(%quote%onSelect%quote%, {%quote%result%quote%: result, %quote%response%quote%:response} );}%';
75
+		$this->_params["onSelect"]='%function(result,response){$(%quote%#'.$this->identifier.'%quote%).trigger(%quote%onSelect%quote%, {%quote%result%quote%: result, %quote%response%quote%:response} );}%';
76 76
 		$searchFields=\json_encode($this->_searchFields);
77 77
 		$searchFields=str_ireplace("\"", "%quote%", $searchFields);
78
-		$this->_params["searchFields"]="%" . $searchFields . "%";
79
-		if ($this->_local === true) {
78
+		$this->_params["searchFields"]="%".$searchFields."%";
79
+		if ($this->_local===true) {
80 80
 			$this->_params["source"]="%content%";
81
-			$this->addEvent("beforeExecute", "var content=" . $this->resultsToJson() . ";");
81
+			$this->addEvent("beforeExecute", "var content=".$this->resultsToJson().";");
82 82
 		}
83
-		if (isset($this->_bsComponent) === false) {
84
-			$this->_bsComponent=$js->semantic()->search("#" . $this->identifier, $this->_params);
83
+		if (isset($this->_bsComponent)===false) {
84
+			$this->_bsComponent=$js->semantic()->search("#".$this->identifier, $this->_params);
85 85
 		}
86 86
 		$this->addEventsOnRun($js);
87 87
 		return $this->_bsComponent;
Please login to merge, or discard this patch.
Ajax/semantic/html/base/traits/BaseTrait.php 1 patch
Spacing   +8 added lines, -8 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
 	/**
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	}
128 128
 
129 129
 	public function setFloated($direction="right") {
130
-		return $this->addToPropertyCtrl("class", $direction . " floated", Direction::getConstantValues("floated"));
130
+		return $this->addToPropertyCtrl("class", $direction." floated", Direction::getConstantValues("floated"));
131 131
 	}
132 132
 
133 133
 	public function floatRight() {
Please login to merge, or discard this patch.
Ajax/common/html/PropertyWrapper.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@  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
-				} else {
18
+				}else {
19 19
 					$output=self::wrapObjects($input, $js, $separator, $valueQuote);
20 20
 				}
21 21
 			}
@@ -24,31 +24,31 @@  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
-		} else {
39
+		}else {
40 40
 			$result=implode($separator, array_values($input));
41 41
 		}
42 42
 		return $result;
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)) {
50 50
 				return self::wrap($v, $js, $separator, $valueQuote);
51
-			} else
51
+			}else
52 52
 				return $v;
53 53
 		}, $input));
54 54
 	}
Please login to merge, or discard this patch.
Ajax/Semantic.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@
 block discarded – undo
24 24
 use Ajax\semantic\traits\SemanticHtmlViewsTrait;
25 25
 
26 26
 class Semantic extends BaseGui {
27
-	use SemanticComponentsTrait,SemanticHtmlElementsTrait,SemanticHtmlCollectionsTrait,
28
-	SemanticHtmlModulesTrait,SemanticHtmlViewsTrait;
27
+	use SemanticComponentsTrait, SemanticHtmlElementsTrait, SemanticHtmlCollectionsTrait,
28
+	SemanticHtmlModulesTrait, SemanticHtmlViewsTrait;
29 29
 
30 30
 	public function __construct($autoCompile=true) {
31 31
 		parent::__construct($autoCompile=true);
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/html5/HtmlLink.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,13 +21,13 @@
 block discarded – undo
21 21
 	 * @see \Ajax\bootstrap\html\base\HtmlSingleElement::run()
22 22
 	 */
23 23
 	public function run(JsUtils $js) {
24
-		$this->_bsComponent=$js->semantic()->generic("#" . $this->identifier);
24
+		$this->_bsComponent=$js->semantic()->generic("#".$this->identifier);
25 25
 		$this->addEventsOnRun($js);
26 26
 		return $this->_bsComponent;
27 27
 	}
28 28
 
29 29
 	public function addIcon($icon, $before=true) {
30
-		return $this->addContent(new HtmlIcon("icon-" . $this->identifier, $icon), $before);
30
+		return $this->addContent(new HtmlIcon("icon-".$this->identifier, $icon), $before);
31 31
 	}
32 32
 
33 33
 	public static function icon($identifier, $icon, $href="#", $label=NULL) {
Please login to merge, or discard this patch.
Ajax/semantic/html/content/card/HtmlCardHeaderContent.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 class HtmlCardHeaderContent extends HtmlCardContent {
11 11
 
12 12
 	public function __construct($identifier, $header=NULL, $metas=array(), $description=NULL) {
13
-		parent::__construct($identifier, array ());
13
+		parent::__construct($identifier, array());
14 14
 		if (isset($header)) {
15 15
 			$this->setHeader($header);
16 16
 		}
@@ -21,11 +21,11 @@  discard block
 block discarded – undo
21 21
 	}
22 22
 
23 23
 	public function setDescription($value) {
24
-		$this->content["description"]=new HtmlSemDoubleElement("description-" . $this->identifier, "div", "description", $value);
24
+		$this->content["description"]=new HtmlSemDoubleElement("description-".$this->identifier, "div", "description", $value);
25 25
 	}
26 26
 
27 27
 	public function setHeader($value) {
28
-		$this->content["header"]=new HtmlSemDoubleElement("header-" . $this->identifier, "a", "header", $value);
28
+		$this->content["header"]=new HtmlSemDoubleElement("header-".$this->identifier, "a", "header", $value);
29 29
 	}
30 30
 
31 31
 	/**
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile()
36 36
 	 */
37 37
 	public function compile(JsUtils $js=NULL, View $view=NULL) {
38
-		$this->content=JArray::sortAssociative($this->content, [ "image","header","meta","description" ]);
38
+		$this->content=JArray::sortAssociative($this->content, ["image", "header", "meta", "description"]);
39 39
 		return parent::compile($js, $view);
40 40
 	}
41 41
 }
42 42
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/content/card/HtmlCardContent.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -15,16 +15,16 @@  discard block
 block discarded – undo
15 15
 
16 16
 	private function addElement($content, $baseClass) {
17 17
 		$count=\sizeof($this->content);
18
-		$result=new HtmlSemDoubleElement("element-" . $count . "-" . $this->identifier, "div", $baseClass, $content);
18
+		$result=new HtmlSemDoubleElement("element-".$count."-".$this->identifier, "div", $baseClass, $content);
19 19
 		$this->addContent($result);
20 20
 		return $result;
21 21
 	}
22 22
 
23 23
 	public function addMeta($value, $direction=Direction::LEFT) {
24
-		if (\array_key_exists("meta", $this->content) === false) {
25
-			$this->content["meta"]=new HtmlSemDoubleElement("meta-" . $this->identifier, "div", "meta", array ());
24
+		if (\array_key_exists("meta", $this->content)===false) {
25
+			$this->content["meta"]=new HtmlSemDoubleElement("meta-".$this->identifier, "div", "meta", array());
26 26
 		}
27
-		if ($direction === Direction::RIGHT) {
27
+		if ($direction===Direction::RIGHT) {
28 28
 			$value=new HtmlSemDoubleElement("", "span", "", $value);
29 29
 			$value->setFloated($direction);
30 30
 		}
@@ -42,26 +42,26 @@  discard block
 block discarded – undo
42 42
 
43 43
 	public function addMetas($metas) {
44 44
 		if (\is_array($metas)) {
45
-			foreach ( $metas as $meta ) {
45
+			foreach ($metas as $meta) {
46 46
 				$this->addMeta($meta);
47 47
 			}
48
-		} else
48
+		}else
49 49
 			$this->addMeta($metas);
50 50
 		return $this;
51 51
 	}
52 52
 
53 53
 	public function addContentIcon($icon, $caption=NULL, $direction=Direction::LEFT) {
54
-		if ($direction === Direction::RIGHT) {
54
+		if ($direction===Direction::RIGHT) {
55 55
 			if (isset($caption)) {
56 56
 				$result=new HtmlSemDoubleElement("", "span", "", $caption);
57 57
 				$result->addIcon($icon);
58 58
 				$this->addContent($result);
59
-			} else {
59
+			}else {
60 60
 				$result=new HtmlIcon("", $icon);
61 61
 				$this->addContent($result);
62 62
 			}
63 63
 			$result->setFloated($direction);
64
-		} else {
64
+		}else {
65 65
 			$this->addIcon($icon);
66 66
 			$result=$this->addContent($caption);
67 67
 		}
@@ -69,17 +69,17 @@  discard block
 block discarded – undo
69 69
 	}
70 70
 
71 71
 	public function addContentText($caption, $direction=Direction::LEFT) {
72
-		if ($direction === Direction::RIGHT) {
72
+		if ($direction===Direction::RIGHT) {
73 73
 			$result=new HtmlSemDoubleElement("", "span", "", $caption);
74 74
 			$this->addContent($result);
75 75
 			$result->setFloated($direction);
76
-		} else
76
+		}else
77 77
 			$result=$this->addContent($caption);
78 78
 		return $result;
79 79
 	}
80 80
 
81 81
 	public function addContentIcons($icons, $direction=Direction::LEFT) {
82
-		foreach ( $icons as $icon ) {
82
+		foreach ($icons as $icon) {
83 83
 			$this->addContentIcon($icon, NULL, $direction);
84 84
 		}
85 85
 		return $this;
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlIconGroups.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 			$icon=JArray::getValue($value, "icon", 0);
26 26
 			$size=JArray::getValue($value, "size", 1);
27 27
 		}
28
-		$iconO=new HtmlIcon("icon-" . $this->identifier, $icon);
28
+		$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
29 29
 		if (isset($size)) {
30 30
 			$iconO->setSize($size);
31 31
 		}
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	}
34 34
 
35 35
 	protected function createCondition($value) {
36
-		return ($value instanceof HtmlIcon) === false;
36
+		return ($value instanceof HtmlIcon)===false;
37 37
 	}
38 38
 
39 39
 	public function getIcon($index) {
Please login to merge, or discard this patch.