Completed
Push — master ( 9de830...b49918 )
by Jean-Christophe
03:44
created
Ajax/semantic/html/base/constants/Social.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,5 +2,5 @@
 block discarded – undo
2 2
 namespace Ajax\semantic\html\base\constants;
3 3
 	use Ajax\common\BaseEnum;
4 4
 abstract class Social extends BaseEnum {
5
-	const FACEBOOK="facebook", TWITTER="twitter",GOOGLEPLUS="google plus",VK="vk",LINKEDIN="linkedin",INSTAGRAM="instagram",YOUTUBE="youtube";
5
+	const FACEBOOK="facebook", TWITTER="twitter", GOOGLEPLUS="google plus", VK="vk", LINKEDIN="linkedin", INSTAGRAM="instagram", YOUTUBE="youtube";
6 6
 }
7 7
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlAccordionMenuItem.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,11 +4,11 @@
 block discarded – undo
4 4
 
5 5
 
6 6
 class HtmlAccordionMenuItem extends HtmlMenuItem {
7
-	public function __construct($identifier,$title,$content) {
8
-		parent::__construct($identifier, new HtmlAccordionItem("accordion-".$identifier, $title,$content));
7
+	public function __construct($identifier, $title, $content) {
8
+		parent::__construct($identifier, new HtmlAccordionItem("accordion-".$identifier, $title, $content));
9 9
 	}
10 10
 
11
-	public function setActive($value=true){
11
+	public function setActive($value=true) {
12 12
 		$this->content->setActive($value);
13 13
 		return $this;
14 14
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlAccordionItem.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -20,30 +20,30 @@
 block discarded – undo
20 20
 		$this->_title=$title;
21 21
 	}
22 22
 
23
-	public function setTitle($title){
23
+	public function setTitle($title) {
24 24
 		$this->_title=$title;
25 25
 	}
26 26
 
27
-	public function setIcon($icon){
27
+	public function setIcon($icon) {
28 28
 		$this->_icon=$icon;
29 29
 	}
30 30
 
31
-	protected function createTitleElement(){
32
-		$element=new HtmlSemDoubleElement("title-".$this->identifier,"div","title");
33
-		$element->setContent(array(new HtmlIcon("", $this->_icon),$this->_title));
34
-		if($this->_active===true)
31
+	protected function createTitleElement() {
32
+		$element=new HtmlSemDoubleElement("title-".$this->identifier, "div", "title");
33
+		$element->setContent(array(new HtmlIcon("", $this->_icon), $this->_title));
34
+		if ($this->_active===true)
35 35
 			$element->addToProperty("class", "active");
36 36
 		return $element;
37 37
 	}
38 38
 
39
-	public function compile(JsUtils $js=NULL, View $view=NULL){
39
+	public function compile(JsUtils $js=NULL, View $view=NULL) {
40 40
 		$this->titleElement=$this->createTitleElement();
41
-		return parent::compile($js,$view);
41
+		return parent::compile($js, $view);
42 42
 	}
43 43
 
44
-	public function setActive($value=true){
44
+	public function setActive($value=true) {
45 45
 		$this->_active=$value;
46
-		if($value===true)
46
+		if ($value===true)
47 47
 			$this->addToPropertyCtrl("class", "active", array("active"));
48 48
 		else
49 49
 			$this->removePropertyValue("class", "active");
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlAccordion.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -6,26 +6,26 @@  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
 
@@ -34,22 +34,22 @@  discard block
 block discarded – undo
34 34
 	 * @see BaseHtml::run()
35 35
 	 */
36 36
 	public function run(JsUtils $js) {
37
-		if(isset($this->_bsComponent)===false)
38
-			$this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params);
37
+		if (isset($this->_bsComponent)===false)
38
+			$this->_bsComponent=$js->semantic()->accordion("#".$this->identifier, $this->params);
39 39
 			$this->addEventsOnRun($js);
40 40
 			return $this->_bsComponent;
41 41
 	}
42 42
 
43
-	public function setStyled(){
43
+	public function setStyled() {
44 44
 		return $this->addToProperty("class", "styled");
45 45
 	}
46 46
 
47
-	public function setActive($index){
47
+	public function setActive($index) {
48 48
 		$this->getItem($index)->setActive(true);
49 49
 		return $this;
50 50
 	}
51 51
 
52
-	public function setExclusive($value){
52
+	public function setExclusive($value) {
53 53
 		$this->params["exclusive"]=$value;
54 54
 	}
55 55
 }
56 56
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/HtmlButton.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	 * @param string $onClick JS Code for click event
24 24
 	 */
25 25
 	public function __construct($identifier, $value="", $cssStyle=null, $onClick=null) {
26
-		parent::__construct($identifier, "button","ui button");
26
+		parent::__construct($identifier, "button", "ui button");
27 27
 		$this->content=$value;
28 28
 		if (isset($cssStyle)) {
29 29
 			$this->setStyle($cssStyle);
@@ -49,28 +49,28 @@  discard block
 block discarded – undo
49 49
 	 * @return \Ajax\semantic\html\HtmlButton default : ""
50 50
 	 */
51 51
 	public function setStyle($cssStyle) {
52
-		return $this->addToProperty("class",$cssStyle);
52
+		return $this->addToProperty("class", $cssStyle);
53 53
 	}
54 54
 
55
-	public function setFocusable($value=true){
56
-		if($value===true)
55
+	public function setFocusable($value=true) {
56
+		if ($value===true)
57 57
 			$this->setProperty("tabindex", "0");
58
-		else{
58
+		else {
59 59
 			$this->removeProperty("tabindex");
60 60
 		}
61 61
 		return $this;
62 62
 	}
63 63
 
64
-	public function setAnimated($content,$animation=""){
64
+	public function setAnimated($content, $animation="") {
65 65
 		$this->setTagName("div");
66 66
 		$this->addToProperty("class", "animated ".$animation);
67
-		$visible=new HtmlSemDoubleElement("visible-".$this->identifier,"div");
67
+		$visible=new HtmlSemDoubleElement("visible-".$this->identifier, "div");
68 68
 		$visible->setClass("visible content");
69 69
 		$visible->setContent($this->content);
70
-		$hidden=new HtmlSemDoubleElement("hidden-".$this->identifier,"div");
70
+		$hidden=new HtmlSemDoubleElement("hidden-".$this->identifier, "div");
71 71
 		$hidden->setClass("hidden content");
72 72
 		$hidden->setContent($content);
73
-		$this->content=array($visible,$hidden);
73
+		$this->content=array($visible, $hidden);
74 74
 		return $hidden;
75 75
 	}
76 76
 
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
 	 * @param string|HtmlIcon $icon
79 79
 	 * @return \Ajax\semantic\html\elements\HtmlButton
80 80
 	 */
81
-	public function asIcon($icon){
81
+	public function asIcon($icon) {
82 82
 		$iconO=$icon;
83
-		if(\is_string($icon)){
83
+		if (\is_string($icon)) {
84 84
 			$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
85 85
 		}
86 86
 		$this->addToProperty("class", "icon");
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
 		return $this;
89 89
 	}
90 90
 
91
-	public function asSubmit(){
92
-		$this->setProperty("type","submit");
91
+	public function asSubmit() {
92
+		$this->setProperty("type", "submit");
93 93
 		return $this->setTagName("button");
94 94
 	}
95 95
 
@@ -99,14 +99,14 @@  discard block
 block discarded – undo
99 99
 	 * @param string $before
100 100
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
101 101
 	 */
102
-	public function addLabel($caption,$before=false){
102
+	public function addLabel($caption, $before=false) {
103 103
 		$this->tagName="div";
104 104
 		$this->addToProperty("class", "labeled");
105
-		$this->content=new HtmlButton("button-".$this->identifier,$this->content);
105
+		$this->content=new HtmlButton("button-".$this->identifier, $this->content);
106 106
 		$this->content->setTagName("div");
107
-		$label=new HtmlLabel("label-".$this->identifier,$caption,"a");
107
+		$label=new HtmlLabel("label-".$this->identifier, $caption, "a");
108 108
 		$label->setBasic();
109
-		$this->addContent($label,$before);
109
+		$this->addContent($label, $before);
110 110
 		return $label;
111 111
 	}
112 112
 	/*
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 	 */
116 116
 	public function fromArray($array) {
117 117
 		$array=parent::fromArray($array);
118
-		foreach ( $array as $key => $value ) {
118
+		foreach ($array as $key => $value) {
119 119
 			$this->setProperty($key, $value);
120 120
 		}
121 121
 		return $array;
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 	 *  show it is currently the active user selection
126 126
 	 * @return \Ajax\semantic\html\elements\HtmlButton
127 127
 	 */
128
-	public function setActive(){
128
+	public function setActive() {
129 129
 		return $this->addToProperty("class", "active");
130 130
 	}
131 131
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 	 * hint towards a positive consequence
134 134
 	 * @return \Ajax\semantic\html\elements\HtmlButton
135 135
 	 */
136
-	public function setPositive(){
136
+	public function setPositive() {
137 137
 		return $this->addToProperty("class", "positive");
138 138
 	}
139 139
 
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	 * hint towards a negative consequence
142 142
 	 * @return \Ajax\semantic\html\elements\HtmlButton
143 143
 	 */
144
-	public function setNegative(){
144
+	public function setNegative() {
145 145
 		return $this->addToProperty("class", "negative");
146 146
 	}
147 147
 
@@ -149,14 +149,14 @@  discard block
 block discarded – undo
149 149
 	 * formatted to toggle on/off
150 150
 	 * @return \Ajax\semantic\html\elements\HtmlButton
151 151
 	 */
152
-	public function setToggle(){
152
+	public function setToggle() {
153 153
 		return $this->addToProperty("class", "toggle");
154 154
 	}
155 155
 
156 156
 	/**
157 157
 	 * @return \Ajax\semantic\html\elements\HtmlButton
158 158
 	 */
159
-	public function setCircular(){
159
+	public function setCircular() {
160 160
 		return $this->addToProperty("class", "circular");
161 161
 	}
162 162
 
@@ -164,22 +164,22 @@  discard block
 block discarded – undo
164 164
 	 *  button is less pronounced
165 165
 	 * @return \Ajax\semantic\html\elements\HtmlButton
166 166
 	 */
167
-	public function setBasic(){
167
+	public function setBasic() {
168 168
 		return $this->addToProperty("class", "basic");
169 169
 	}
170 170
 
171
-	public function setEmphasis($value){
171
+	public function setEmphasis($value) {
172 172
 		return $this->addToPropertyCtrl("class", $value, Emphasis::getConstants());
173 173
 	}
174 174
 
175
-	public function setLoading(){
175
+	public function setLoading() {
176 176
 		return $this->addToProperty("class", "loading");
177 177
 	}
178 178
 
179
-	public static function getSocial($identifier,$social,$value=NULL){
180
-		if($value===NULL)
179
+	public static function getSocial($identifier, $social, $value=NULL) {
180
+		if ($value===NULL)
181 181
 			$value=\ucfirst($social);
182
-		$return=new HtmlButton($identifier,$value);
182
+		$return=new HtmlButton($identifier, $value);
183 183
 		$return->addIcon($social);
184 184
 		return $return->addToPropertyCtrl("class", $social, Social::getConstants());
185 185
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormField.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -5,38 +5,38 @@
 block discarded – undo
5 5
 use Ajax\semantic\html\base\HtmlSemDoubleElement;
6 6
 
7 7
 class HtmlFormField extends HtmlSemDoubleElement {
8
-	public function __construct($identifier, $field,$label=NULL) {
9
-		parent::__construct($identifier, "div","ui field");
8
+	public function __construct($identifier, $field, $label=NULL) {
9
+		parent::__construct($identifier, "div", "ui field");
10 10
 		$this->content=array();
11
-		if(isset($label))
11
+		if (isset($label))
12 12
 			$this->setLabel($label);
13 13
 		$this->setField($field);
14 14
 	}
15 15
 
16
-	public function setLabel($label){
16
+	public function setLabel($label) {
17 17
 		$labelO=$label;
18
-		if(\is_string($label)){
19
-			$labelO=new HtmlSemDoubleElement("","label");
18
+		if (\is_string($label)) {
19
+			$labelO=new HtmlSemDoubleElement("", "label");
20 20
 			$labelO->setContent($label);
21
-			$labelO->setProperty("for", \str_replace("field-", "",$this->identifier));
21
+			$labelO->setProperty("for", \str_replace("field-", "", $this->identifier));
22 22
 		}
23 23
 		$this->content["label"]=$labelO;
24 24
 	}
25 25
 
26
-	public function setField($field){
26
+	public function setField($field) {
27 27
 		$this->content["field"]=$field;
28 28
 	}
29 29
 
30
-	public function getLabel(){
31
-		if(\array_key_exists("label", $this->content))
30
+	public function getLabel() {
31
+		if (\array_key_exists("label", $this->content))
32 32
 			return $this->content["label"];
33 33
 	}
34 34
 
35
-	public function getField(){
35
+	public function getField() {
36 36
 		return $this->content["field"];
37 37
 	}
38 38
 
39
-	public function swapLabel(){
39
+	public function swapLabel() {
40 40
 		$label=$this->getLabel();
41 41
 		unset($this->content["label"]);
42 42
 		$this->content["label"]=$label;
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormInput.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,9 +7,9 @@
 block discarded – undo
7 7
 
8 8
 class HtmlFormInput extends HtmlFormField {
9 9
 
10
-	public function __construct($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL) {
11
-		if(!isset($placeholder))
10
+	public function __construct($identifier, $label=NULL, $type="text", $value=NULL, $placeholder=NULL) {
11
+		if (!isset($placeholder))
12 12
 			$placeholder=$label;
13
-		parent::__construct("field-".$identifier, new HtmlInput($identifier,$type,$value,$placeholder), $label);
13
+		parent::__construct("field-".$identifier, new HtmlInput($identifier, $type, $value, $placeholder), $label);
14 14
 	}
15 15
 }
16 16
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlFormCheckbox.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,15 +6,15 @@
 block discarded – undo
6 6
 
7 7
 class HtmlFormCheckbox extends HtmlFormInput {
8 8
 
9
-	public function __construct($identifier, $label=NULL,$value=NULL) {
9
+	public function __construct($identifier, $label=NULL, $value=NULL) {
10 10
 		parent::__construct($identifier, $label, "checkbox", $value=NULL);
11
-		if(isset($label)){
11
+		if (isset($label)) {
12 12
 			$this->swapLabel();
13 13
 			$label=$this->getLabel();
14 14
 			$label->setClass="hidden";
15
-			$label->setProperty("tabindex",0);
15
+			$label->setProperty("tabindex", 0);
16 16
 		}
17 17
 		$this->setClass("ui checkbox");
18
-		$this->wrap("<div class='field'>","</div>");
18
+		$this->wrap("<div class='field'>", "</div>");
19 19
 	}
20 20
 }
21 21
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/HtmlForm.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -5,19 +5,19 @@
 block discarded – undo
5 5
 use Ajax\semantic\html\base\HtmlSemCollection;
6 6
 use Ajax\service\JArray;
7 7
 
8
-class HtmlForm extends HtmlSemCollection{
8
+class HtmlForm extends HtmlSemCollection {
9 9
 
10 10
 
11
-	public function __construct( $identifier, $elements=array()){
12
-		parent::__construct( $identifier, "form", "ui form");
11
+	public function __construct($identifier, $elements=array()) {
12
+		parent::__construct($identifier, "form", "ui form");
13 13
 		$this->setProperty("name", $this->identifier);
14 14
 		$this->addItems($elements);
15 15
 	}
16 16
 
17 17
 
18
-	protected function createItem($value){
19
-		if(\is_array($value)){
20
-			$itemO=new HtmlFormInput(JArray::getDefaultValue($value, "id",""),JArray::getDefaultValue($value, "label",null),JArray::getDefaultValue($value, "type", "text"),JArray::getDefaultValue($value, "value",""),JArray::getDefaultValue($value, "placeholder",JArray::getDefaultValue($value, "label",null)));
18
+	protected function createItem($value) {
19
+		if (\is_array($value)) {
20
+			$itemO=new HtmlFormInput(JArray::getDefaultValue($value, "id", ""), JArray::getDefaultValue($value, "label", null), JArray::getDefaultValue($value, "type", "text"), JArray::getDefaultValue($value, "value", ""), JArray::getDefaultValue($value, "placeholder", JArray::getDefaultValue($value, "label", null)));
21 21
 			return $itemO;
22 22
 		}else
23 23
 		return new HtmlFormInput($value);
Please login to merge, or discard this patch.