Completed
Push — master ( aa1d0c...064b6c )
by Jean-Christophe
04:19
created
Ajax/semantic/html/modules/HtmlSticky.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,13 +8,13 @@  discard block
 block discarded – undo
8 8
 class HtmlSticky extends HtmlSemDoubleElement {
9 9
 	private $_params=array();
10 10
 
11
-	public function __construct($identifier,$context=NULL,$content=NULL) {
11
+	public function __construct($identifier, $context=NULL, $content=NULL) {
12 12
 		parent::__construct($identifier, "div", "ui sticky", $content);
13
-		if(isset($content))
13
+		if (isset($content))
14 14
 			$this->setContext($context);
15 15
 	}
16 16
 
17
-	public function setContext($context){
17
+	public function setContext($context) {
18 18
 		$this->_params["context"]=$context;
19 19
 		return $this;
20 20
 	}
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
 	 * {@inheritDoc}
24 24
 	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run()
25 25
 	 */
26
-	public function run(JsUtils $js){
26
+	public function run(JsUtils $js) {
27 27
 		parent::run($js);
28
-		return $js->semantic()->sticky("#".$this->identifier,$this->_params);
28
+		return $js->semantic()->sticky("#".$this->identifier, $this->_params);
29 29
 	}
30 30
 }
31 31
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,9 @@
 block discarded – undo
10 10
 
11 11
 	public function __construct($identifier,$context=NULL,$content=NULL) {
12 12
 		parent::__construct($identifier, "div", "ui sticky", $content);
13
-		if(isset($content))
14
-			$this->setContext($context);
13
+		if(isset($content)) {
14
+					$this->setContext($context);
15
+		}
15 16
 	}
16 17
 
17 18
 	public function setContext($context){
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlSearch.php 2 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,10 +22,12 @@
 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)
26
-			$field->setPlaceholder($placeholder);
27
-		if (isset($icon) === true)
28
-			$field->addIcon($icon, Direction::RIGHT);
25
+		if (isset($placeholder) === true) {
26
+					$field->setPlaceholder($placeholder);
27
+		}
28
+		if (isset($icon) === true) {
29
+					$field->addIcon($icon, Direction::RIGHT);
30
+		}
29 31
 		$field->getField()->setClass("prompt");
30 32
 		$this->content["field"]=$field;
31 33
 		return $field;
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -8,12 +8,12 @@  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 $_searchFields=array ("title" );
11
+	private $_elements=array();
12
+	private $_searchFields=array("title");
13 13
 	private $_local=false;
14 14
 
15 15
 	public function __construct($identifier, $placeholder=NULL, $icon=NULL) {
16
-		parent::__construct("search-" . $identifier, "div", "ui search", array ());
16
+		parent::__construct("search-".$identifier, "div", "ui search", array());
17 17
 		$this->createField($placeholder, $icon);
18 18
 		$this->createResult();
19 19
 		$this->_params["type"]="standard";
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
 
22 22
 	private function createField($placeholder=NULL, $icon=NULL) {
23 23
 		$field=new HtmlInput($this->identifier);
24
-		if (isset($placeholder) === true)
24
+		if (isset($placeholder)===true)
25 25
 			$field->setPlaceholder($placeholder);
26
-		if (isset($icon) === true)
26
+		if (isset($icon)===true)
27 27
 			$field->addIcon($icon, Direction::RIGHT);
28 28
 		$field->getField()->setClass("prompt");
29 29
 		$this->content["field"]=$field;
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	}
32 32
 
33 33
 	private function createResult() {
34
-		$this->content["result"]=new HtmlSemDoubleElement("results-" . $this->identifier, "div", "results");
34
+		$this->content["result"]=new HtmlSemDoubleElement("results-".$this->identifier, "div", "results");
35 35
 		return $this->content["result"];
36 36
 	}
37 37
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	}
49 49
 
50 50
 	public function setUrl($url) {
51
-		$this->_params["apiSettings"]="%{url: %quote%" . $url . "%quote%}%";
51
+		$this->_params["apiSettings"]="%{url: %quote%".$url."%quote%}%";
52 52
 		return $this;
53 53
 	}
54 54
 
@@ -71,16 +71,16 @@  discard block
 block discarded – undo
71 71
 	}
72 72
 
73 73
 	public function run(JsUtils $js) {
74
-		$this->_params["onSelect"]='%function(result,response){$(%quote%#' . $this->identifier . '%quote%).trigger(%quote%onSelect%quote%, {%quote%result%quote%: result, %quote%response%quote%:response} );}%';
74
+		$this->_params["onSelect"]='%function(result,response){$(%quote%#'.$this->identifier.'%quote%).trigger(%quote%onSelect%quote%, {%quote%result%quote%: result, %quote%response%quote%:response} );}%';
75 75
 		$searchFields=\json_encode($this->_searchFields);
76 76
 		$searchFields=str_ireplace("\"", "%quote%", $searchFields);
77
-		$this->_params["searchFields"]="%" . $searchFields . "%";
78
-		if ($this->_local === true) {
77
+		$this->_params["searchFields"]="%".$searchFields."%";
78
+		if ($this->_local===true) {
79 79
 			$this->_params["source"]="%content%";
80
-			$this->addEvent("beforeExecute", "var content=" . $this->resultsToJson() . ";");
80
+			$this->addEvent("beforeExecute", "var content=".$this->resultsToJson().";");
81 81
 		}
82
-		if (isset($this->_bsComponent) === false) {
83
-			$this->_bsComponent=$js->semantic()->search("#" . $this->identifier, $this->_params);
82
+		if (isset($this->_bsComponent)===false) {
83
+			$this->_bsComponent=$js->semantic()->search("#".$this->identifier, $this->_params);
84 84
 		}
85 85
 		$this->addEventsOnRun($js);
86 86
 		return $this->_bsComponent;
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlSegmentGroups.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -6,20 +6,20 @@  discard block
 block discarded – undo
6 6
 use Ajax\semantic\html\base\HtmlSemCollection;
7 7
 use Ajax\semantic\html\base\constants\Sens;
8 8
 
9
-class HtmlSegmentGroups extends HtmlSemCollection{
9
+class HtmlSegmentGroups extends HtmlSemCollection {
10 10
 
11 11
 
12
-	public function __construct( $identifier, $items=array()){
13
-		parent::__construct( $identifier, "div","ui segments");
12
+	public function __construct($identifier, $items=array()) {
13
+		parent::__construct($identifier, "div", "ui segments");
14 14
 		$this->addItems($items);
15 15
 	}
16 16
 
17 17
 
18
-	protected function createItem($value){
19
-		return new HtmlSegment("segment-".$this->count(),$value);
18
+	protected function createItem($value) {
19
+		return new HtmlSegment("segment-".$this->count(), $value);
20 20
 	}
21 21
 
22
-	protected function createCondition($value){
22
+	protected function createCondition($value) {
23 23
 		return !($value instanceof HtmlSegment);
24 24
 	}
25 25
 
@@ -28,16 +28,16 @@  discard block
 block discarded – undo
28 28
 	 * @param string $type one of "raised","stacked","piled" default : ""
29 29
 	 * @return \Ajax\semantic\html\elements\HtmlSegmentGroups
30 30
 	 */
31
-	public function setType($type){
31
+	public function setType($type) {
32 32
 		return $this->addToPropertyCtrl("class", $type, SegmentType::getConstants());
33 33
 	}
34 34
 
35
-	public function setSens($sens=Sens::VERTICAL){
35
+	public function setSens($sens=Sens::VERTICAL) {
36 36
 		return $this->addToPropertyCtrl("class", $sens, Sens::getConstants());
37 37
 	}
38 38
 
39
-	public static function group($identifier,$items=array(),$type="",$sens=Sens::VERTICAL){
40
-		$group=new HtmlSegmentGroups($identifier,$items);
39
+	public static function group($identifier, $items=array(), $type="", $sens=Sens::VERTICAL) {
40
+		$group=new HtmlSegmentGroups($identifier, $items);
41 41
 		$group->setSens($sens);
42 42
 		return $group->setType($type);
43 43
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlSegment.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
  * @version 1.001
19 19
  */
20 20
 class HtmlSegment extends HtmlSemDoubleElement {
21
-	use AttachedTrait,TextAlignmentTrait;
21
+	use AttachedTrait, TextAlignmentTrait;
22 22
 
23 23
 	public function __construct($identifier, $content="") {
24 24
 		parent::__construct($identifier, "div", "ui segment");
25
-		$this->_variations=\array_merge($this->_variations, [ Variation::PADDED,Variation::COMPACT ]);
26
-		$this->_states=\array_merge($this->_states, [ State::LOADING ]);
25
+		$this->_variations=\array_merge($this->_variations, [Variation::PADDED, Variation::COMPACT]);
26
+		$this->_states=\array_merge($this->_states, [State::LOADING]);
27 27
 		$this->content=$content;
28 28
 	}
29 29
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	}
38 38
 
39 39
 	public function setSens($sens="vertical") {
40
-		return $this->addToPropertyCtrl("class", $sens, array ("vertical","horizontal" ));
40
+		return $this->addToPropertyCtrl("class", $sens, array("vertical", "horizontal"));
41 41
 	}
42 42
 
43 43
 	public function setEmphasis($value=Emphasis::SECONDARY) {
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
 	}
62 62
 
63 63
 	public function asContainer() {
64
-		return $this->addToPropertyCtrl("class", "container", array ("container" ));
64
+		return $this->addToPropertyCtrl("class", "container", array("container"));
65 65
 	}
66 66
 
67
-	public function addGrid($numRows=1, $numCols=NULL){
68
-		$grid=new HtmlGrid("Grid-".$this->identifier,$numRows,$numCols);
67
+	public function addGrid($numRows=1, $numCols=NULL) {
68
+		$grid=new HtmlGrid("Grid-".$this->identifier, $numRows, $numCols);
69 69
 		$this->content=$grid;
70 70
 		return $grid;
71 71
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlImage.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,8 +12,9 @@  discard block
 block discarded – undo
12 12
 		$image=new HtmlImg("img-", $src, $alt);
13 13
 		$image->setClass("");
14 14
 		parent::__construct($identifier, "div", "ui image", $image);
15
-		if (isset($size))
16
-			$this->setSize($size);
15
+		if (isset($size)) {
16
+					$this->setSize($size);
17
+		}
17 18
 	}
18 19
 
19 20
 	public function setCircular() {
@@ -21,8 +22,9 @@  discard block
 block discarded – undo
21 22
 	}
22 23
 
23 24
 	public function asAvatar($caption=NULL) {
24
-		if (isset($caption))
25
-			$this->wrap("", $caption);
25
+		if (isset($caption)) {
26
+					$this->wrap("", $caption);
27
+		}
26 28
 		return $this->addToProperty("class", "avatar");
27 29
 	}
28 30
 
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlLabelGroups.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
  */
16 16
 class HtmlLabelGroups extends HtmlSemCollection {
17 17
 
18
-	public function __construct($identifier,$labels=array(), $attributes=array()) {
18
+	public function __construct($identifier, $labels=array(), $attributes=array()) {
19 19
 		parent::__construct($identifier, "div", "ui labels");
20
-		$this->_states=\array_merge(Size::getConstants(),Color::getConstants(),["tag","circular"]);
20
+		$this->_states=\array_merge(Size::getConstants(), Color::getConstants(), ["tag", "circular"]);
21 21
 		$this->addItems($labels);
22 22
 		$this->setStates($attributes);
23 23
 	}
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 			$icon=JArray::getValue($value, "icon", 1);
32 32
 			$tagName=JArray::getValue($value, "tagName", 2);
33 33
 		}
34
-		$labelO=new HtmlLabel("label-" . $this->identifier, $caption,$icon,$tagName);
34
+		$labelO=new HtmlLabel("label-".$this->identifier, $caption, $icon, $tagName);
35 35
 		return $labelO;
36 36
 	}
37 37
 
38 38
 	protected function createCondition($value) {
39
-		return ($value instanceof HtmlLabel) === false;
39
+		return ($value instanceof HtmlLabel)===false;
40 40
 	}
41 41
 
42 42
 }
43 43
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/html5/HtmlImg.php 1 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 asAvatar($caption=NULL) {
17
-		if (isset($caption))
18
-			$this->wrap("", $caption);
17
+		if (isset($caption)) {
18
+					$this->wrap("", $caption);
19
+		}
19 20
 			return $this->addToProperty("class", "avatar");
20 21
 	}
21 22
 }
22 23
\ No newline at end of file
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/elements/HtmlIcon.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 	 * @return \Ajax\semantic\html\HtmlIcon
69 69
 	 */
70 70
 	public function setFlipped($sens="horizontally") {
71
-		return $this->addToProperty("class", "flipped " . $sens);
71
+		return $this->addToProperty("class", "flipped ".$sens);
72 72
 	}
73 73
 
74 74
 	/**
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	 * @return \Ajax\semantic\html\HtmlIcon
78 78
 	 */
79 79
 	public function setRotated($sens="clockwise") {
80
-		return $this->addToProperty("class", "rotated " . $sens);
80
+		return $this->addToProperty("class", "rotated ".$sens);
81 81
 	}
82 82
 
83 83
 	/**
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 */
87 87
 	public function asLink($href=NULL) {
88 88
 		if (isset($href)) {
89
-			$this->wrap("<a href='" . $href . "'>", "</a>");
89
+			$this->wrap("<a href='".$href."'>", "</a>");
90 90
 		}
91 91
 		return $this->addToProperty("class", "link");
92 92
 	}
@@ -102,9 +102,9 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	public function setBordered($inverted=false) {
104 104
 		$invertedStr="";
105
-		if ($inverted !== false)
105
+		if ($inverted!==false)
106 106
 			$invertedStr=" inverted";
107
-		return $this->addToProperty("class", "bordered" . $invertedStr);
107
+		return $this->addToProperty("class", "bordered".$invertedStr);
108 108
 	}
109 109
 
110 110
 	/**
@@ -116,11 +116,11 @@  discard block
 block discarded – undo
116 116
 	}
117 117
 
118 118
 	public function addLabel($label, $before=false, $icon=NULL) {
119
-		if($before)
119
+		if ($before)
120 120
 			$this->wrap($label);
121 121
 		else
122 122
 			$this->wrap("", $label);
123
-		if(isset($icon))
123
+		if (isset($icon))
124 124
 			$this->addToIcon($icon);
125 125
 		return $this;
126 126
 	}
Please login to merge, or discard this patch.
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -102,8 +102,9 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	public function setBordered($inverted=false) {
104 104
 		$invertedStr="";
105
-		if ($inverted !== false)
106
-			$invertedStr=" inverted";
105
+		if ($inverted !== false) {
106
+					$invertedStr=" inverted";
107
+		}
107 108
 		return $this->addToProperty("class", "bordered" . $invertedStr);
108 109
 	}
109 110
 
@@ -116,12 +117,14 @@  discard block
 block discarded – undo
116 117
 	}
117 118
 
118 119
 	public function addLabel($label, $before=false, $icon=NULL) {
119
-		if($before)
120
-			$this->wrap($label);
121
-		else
122
-			$this->wrap("", $label);
123
-		if(isset($icon))
124
-			$this->addToIcon($icon);
120
+		if($before) {
121
+					$this->wrap($label);
122
+		} else {
123
+					$this->wrap("", $label);
124
+		}
125
+		if(isset($icon)) {
126
+					$this->addToIcon($icon);
127
+		}
125 128
 		return $this;
126 129
 	}
127 130
 
Please login to merge, or discard this patch.