Completed
Push — master ( c1a616...8e32f8 )
by Jean-Christophe
03:16
created
Ajax/semantic/html/elements/HtmlButton.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 	 * @param string $onClick JS Code for click event
23 23
 	 */
24 24
 	public function __construct($identifier, $value="", $cssStyle=null, $onClick=null) {
25
-		parent::__construct($identifier, "button","ui button");
25
+		parent::__construct($identifier, "button", "ui button");
26 26
 		$this->content=$value;
27 27
 		if (isset($cssStyle)) {
28 28
 			$this->setStyle($cssStyle);
@@ -48,28 +48,28 @@  discard block
 block discarded – undo
48 48
 	 * @return \Ajax\semantic\html\HtmlButton default : ""
49 49
 	 */
50 50
 	public function setStyle($cssStyle) {
51
-		return $this->addToProperty("class",$cssStyle);
51
+		return $this->addToProperty("class", $cssStyle);
52 52
 	}
53 53
 
54
-	public function setFocusable($value=true){
55
-		if($value===true)
54
+	public function setFocusable($value=true) {
55
+		if ($value===true)
56 56
 			$this->setProperty("tabindex", "0");
57
-		else{
57
+		else {
58 58
 			$this->removeProperty("tabindex");
59 59
 		}
60 60
 		return $this;
61 61
 	}
62 62
 
63
-	public function setAnimated($content,$animation=""){
63
+	public function setAnimated($content, $animation="") {
64 64
 		$this->setTagName("div");
65 65
 		$this->addToProperty("class", "animated ".$animation);
66
-		$visible=new HtmlSemDoubleElement("visible-".$this->identifier,"div");
66
+		$visible=new HtmlSemDoubleElement("visible-".$this->identifier, "div");
67 67
 		$visible->setClass("visible content");
68 68
 		$visible->setContent($this->content);
69
-		$hidden=new HtmlSemDoubleElement("hidden-".$this->identifier,"div");
69
+		$hidden=new HtmlSemDoubleElement("hidden-".$this->identifier, "div");
70 70
 		$hidden->setClass("hidden content");
71 71
 		$hidden->setContent($content);
72
-		$this->content=array($visible,$hidden);
72
+		$this->content=array($visible, $hidden);
73 73
 		return $hidden;
74 74
 	}
75 75
 
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
 	 * @param string|HtmlIcon $icon
78 78
 	 * @return \Ajax\semantic\html\elements\HtmlButton
79 79
 	 */
80
-	public function asIcon($icon){
80
+	public function asIcon($icon) {
81 81
 		$iconO=$icon;
82
-		if(\is_string($icon)){
82
+		if (\is_string($icon)) {
83 83
 			$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
84 84
 		}
85 85
 		$this->addToProperty("class", "icon");
@@ -93,14 +93,14 @@  discard block
 block discarded – undo
93 93
 	 * @param string $before
94 94
 	 * @return \Ajax\semantic\html\elements\HtmlLabel
95 95
 	 */
96
-	public function addLabel($caption,$before=false){
96
+	public function addLabel($caption, $before=false) {
97 97
 		$this->tagName="div";
98 98
 		$this->addToProperty("class", "labeled");
99
-		$this->content=new HtmlButton("button-".$this->identifier,$this->content);
99
+		$this->content=new HtmlButton("button-".$this->identifier, $this->content);
100 100
 		$this->content->setTagName("div");
101
-		$label=new HtmlLabel("label-".$this->identifier,$caption,"a");
101
+		$label=new HtmlLabel("label-".$this->identifier, $caption, "a");
102 102
 		$label->setBasic();
103
-		$this->addContent($label,$before);
103
+		$this->addContent($label, $before);
104 104
 		return $label;
105 105
 	}
106 106
 	/*
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	 */
110 110
 	public function fromArray($array) {
111 111
 		$array=parent::fromArray($array);
112
-		foreach ( $array as $key => $value ) {
112
+		foreach ($array as $key => $value) {
113 113
 			$this->setProperty($key, $value);
114 114
 		}
115 115
 		return $array;
@@ -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\elements\HtmlButton
121 121
 	 */
122
-	public function setActive(){
122
+	public function setActive() {
123 123
 		return $this->addToProperty("class", "active");
124 124
 	}
125 125
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	 * hint towards a positive consequence
128 128
 	 * @return \Ajax\semantic\html\elements\HtmlButton
129 129
 	 */
130
-	public function setPositive(){
130
+	public function setPositive() {
131 131
 		return $this->addToProperty("class", "positive");
132 132
 	}
133 133
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 	 * hint towards a negative consequence
136 136
 	 * @return \Ajax\semantic\html\elements\HtmlButton
137 137
 	 */
138
-	public function setNegative(){
138
+	public function setNegative() {
139 139
 		return $this->addToProperty("class", "negative");
140 140
 	}
141 141
 
@@ -143,14 +143,14 @@  discard block
 block discarded – undo
143 143
 	 * formatted to toggle on/off
144 144
 	 * @return \Ajax\semantic\html\elements\HtmlButton
145 145
 	 */
146
-	public function setToggle(){
146
+	public function setToggle() {
147 147
 		return $this->addToProperty("class", "toggle");
148 148
 	}
149 149
 
150 150
 	/**
151 151
 	 * @return \Ajax\semantic\html\elements\HtmlButton
152 152
 	 */
153
-	public function setCircular(){
153
+	public function setCircular() {
154 154
 		return $this->addToProperty("class", "circular");
155 155
 	}
156 156
 
@@ -158,11 +158,11 @@  discard block
 block discarded – undo
158 158
 	 *  button is less pronounced
159 159
 	 * @return \Ajax\semantic\html\elements\HtmlButton
160 160
 	 */
161
-	public function setBasic(){
161
+	public function setBasic() {
162 162
 		return $this->addToProperty("class", "basic");
163 163
 	}
164 164
 
165
-	public function setEmphasis($value){
165
+	public function setEmphasis($value) {
166 166
 		return $this->addToPropertyCtrl("class", $value, Emphasis::getConstants());
167 167
 	}
168 168
 }
169 169
\ No newline at end of file
Please login to merge, or discard this patch.