Skip to content

Commit 75b4eab

Browse files
committed
Update HtmlRail
1 parent d4bd11b commit 75b4eab

File tree

2 files changed

+82
-24
lines changed

2 files changed

+82
-24
lines changed

Ajax/semantic/html/elements/HtmlRail.php

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
32
namespace Ajax\semantic\html\elements;
43

54
use Ajax\semantic\html\base\HtmlSemDoubleElement;
@@ -11,7 +10,32 @@
1110
*/
1211
class HtmlRail extends HtmlSemDoubleElement {
1312

14-
public function __construct($identifier, $content=NULL) {
15-
parent::__construct($identifier, "div", "ui rail", $content);
13+
public function __construct($identifier, $content = NULL) {
14+
parent::__construct($identifier, 'div', 'ui rail', $content);
15+
}
16+
17+
private function updateType(string $type) {
18+
$this->addToProperty('class', $type);
19+
return $this;
20+
}
21+
22+
public function setLeft() {
23+
return $this->updateType('left');
24+
}
25+
26+
public function setRight() {
27+
return $this->updateType('right');
28+
}
29+
30+
public function setInternal() {
31+
return $this->updateType('internal');
32+
}
33+
34+
public function setDividing() {
35+
return $this->updateType('dividing');
36+
}
37+
38+
public function setClose() {
39+
return $this->updateType('close');
1640
}
1741
}

Ajax/semantic/traits/SemanticHtmlElementsTrait.php

Lines changed: 55 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
32
namespace Ajax\semantic\traits;
43

54
use Ajax\semantic\html\elements\HtmlButtonGroups;
@@ -25,6 +24,7 @@
2524
use Ajax\common\html\BaseHtml;
2625
use Ajax\semantic\html\base\HtmlSemDoubleElement;
2726
use Ajax\semantic\html\elements\HtmlEmoji;
27+
use Ajax\semantic\html\elements\HtmlRail;
2828

2929
trait SemanticHtmlElementsTrait {
3030

@@ -36,6 +36,7 @@ public function addState($state, $elements) {
3636

3737
/**
3838
* Return a new Semantic Html Button
39+
*
3940
* @see http://phpmv-ui.kobject.net/index/direct/main/31
4041
* @see http://semantic-ui.com/elements/button.html
4142
* @param string $identifier
@@ -44,49 +45,53 @@ public function addState($state, $elements) {
4445
* @param string $onClick
4546
* @return HtmlButton
4647
*/
47-
public function htmlButton($identifier, $value=null, $cssStyle=null, $onClick=null) {
48+
public function htmlButton($identifier, $value = null, $cssStyle = null, $onClick = null) {
4849
return $this->addHtmlComponent(new HtmlButton($identifier, $value, $cssStyle, $onClick));
4950
}
5051

5152
/**
5253
* Returns a group of Semantic buttons
54+
*
5355
* @see http://phpmv-ui.kobject.net/index/direct/main/50
5456
* @see http://semantic-ui.com/elements/button.html#buttons
5557
* @param string $identifier
5658
* @param array $elements
5759
* @param boolean $asIcons
5860
* @return HtmlButtonGroups
5961
*/
60-
public function htmlButtonGroups($identifier, $elements=array(), $asIcons=false) {
62+
public function htmlButtonGroups($identifier, $elements = array(), $asIcons = false) {
6163
return $this->addHtmlComponent(new HtmlButtonGroups($identifier, $elements, $asIcons));
6264
}
6365

6466
/**
6567
* Returns a new Semantic container
68+
*
6669
* @see http://phpmv-ui.kobject.net/index/direct/main/34
6770
* @see http://semantic-ui.com/elements/container.html
6871
* @param string $identifier
6972
* @param string $content
7073
* @return HtmlContainer
7174
*/
72-
public function htmlContainer($identifier, $content="") {
75+
public function htmlContainer($identifier, $content = "") {
7376
return $this->addHtmlComponent(new HtmlContainer($identifier, $content));
7477
}
7578

7679
/**
7780
* Returns a new Semantic divider
81+
*
7882
* @see http://phpmv-ui.kobject.net/index/direct/main/42
7983
* @see http://semantic-ui.com/elements/divider.html
8084
* @param string $identifier
8185
* @param string $content
8286
* @return HtmlDivider
8387
*/
84-
public function htmlDivider($identifier, $content="", $tagName="div") {
88+
public function htmlDivider($identifier, $content = "", $tagName = "div") {
8589
return $this->addHtmlComponent(new HtmlDivider($identifier, $content, $tagName));
8690
}
8791

8892
/**
8993
* Returns a new Semantic header
94+
*
9095
* @see http://phpmv-ui.kobject.net/index/direct/main/43
9196
* @see http://semantic-ui.com/elements/header.html
9297
* @param string $identifier
@@ -95,12 +100,13 @@ public function htmlDivider($identifier, $content="", $tagName="div") {
95100
* @param string $type
96101
* @return HtmlHeader
97102
*/
98-
public function htmlHeader($identifier, $niveau=1, $content=NULL, $type="page") {
103+
public function htmlHeader($identifier, $niveau = 1, $content = NULL, $type = "page") {
99104
return $this->addHtmlComponent(new HtmlHeader($identifier, $niveau, $content, $type));
100105
}
101106

102107
/**
103108
* Returns a new Semantic icon
109+
*
104110
* @see http://phpmv-ui.kobject.net/index/direct/main/44
105111
* @see http://semantic-ui.com/elements/icon.html
106112
* @param string $identifier
@@ -113,6 +119,7 @@ public function htmlIcon($identifier, $icon) {
113119

114120
/**
115121
* Returns a new Semantic image
122+
*
116123
* @see http://phpmv-ui.kobject.net/index/direct/main/55
117124
* @see http://semantic-ui.com/elements/image.html
118125
* @param string $identifier
@@ -121,25 +128,27 @@ public function htmlIcon($identifier, $icon) {
121128
* @param string $size
122129
* @return HtmlImage
123130
*/
124-
public function htmlImage($identifier, $src="", $alt="", $size=NULL) {
131+
public function htmlImage($identifier, $src = "", $alt = "", $size = NULL) {
125132
return $this->addHtmlComponent(new HtmlImage($identifier, $src, $alt, $size));
126133
}
127134

128135
/**
129136
* Returns a new Semantic group of images
137+
*
130138
* @see http://phpmv-ui.kobject.net/index/direct/main/0
131139
* @see http://semantic-ui.com/elements/image.html#size
132140
* @param string $identifier
133141
* @param array $icons
134142
* @param string $size
135143
* @return HtmlIconGroups
136144
*/
137-
public function htmlIconGroups($identifier, $icons=array(), $size="") {
145+
public function htmlIconGroups($identifier, $icons = array(), $size = "") {
138146
return $this->addHtmlComponent(new HtmlIconGroups($identifier, $icons, $size));
139147
}
140148

141149
/**
142150
* Returns a new Semantic html input
151+
*
143152
* @see http://phpmv-ui.kobject.net/index/direct/main/45
144153
* @see http://semantic-ui.com/elements/input.html
145154
* @param string $identifier
@@ -148,64 +157,71 @@ public function htmlIconGroups($identifier, $icons=array(), $size="") {
148157
* @param string $placeholder
149158
* @return HtmlInput
150159
*/
151-
public function htmlInput($identifier, $type="text", $value="", $placeholder="") {
160+
public function htmlInput($identifier, $type = "text", $value = "", $placeholder = "") {
152161
return $this->addHtmlComponent(new HtmlInput($identifier, $type, $value, $placeholder));
153162
}
154163

155164
/**
156165
* Returns a new Semantic label
166+
*
157167
* @see http://phpmv-ui.kobject.net/index/direct/main/46
158168
* @see http://semantic-ui.com/elements/label.html
159169
* @param string $identifier
160170
* @param string $content
161171
* @param string $tagName
162172
* @return HtmlLabel
163173
*/
164-
public function htmlLabel($identifier, $content="", $icon=NULL,$tagName="div") {
165-
return $this->addHtmlComponent(new HtmlLabel($identifier, $content,$icon, $tagName));
174+
public function htmlLabel($identifier, $content = "", $icon = NULL, $tagName = "div") {
175+
return $this->addHtmlComponent(new HtmlLabel($identifier, $content, $icon, $tagName));
166176
}
167177

168178
/**
179+
*
169180
* @param string $identifier
170181
* @param array $labels
171182
* @param array $attributes
172183
* @return HtmlLabelGroups
173184
*/
174-
public function htmlLabelGroups($identifier,$labels=array(),$attributes=array()){
175-
return $this->addHtmlComponent(new HtmlLabelGroups($identifier,$labels,$attributes));
185+
public function htmlLabelGroups($identifier, $labels = array(), $attributes = array()) {
186+
return $this->addHtmlComponent(new HtmlLabelGroups($identifier, $labels, $attributes));
176187
}
177188

178189
/**
190+
* Returns a new Semantic list.
179191
*
180192
* @param string $identifier
181193
* @param array $items
182194
* @return HtmlList
183195
*/
184-
public function htmlList($identifier, $items=array()) {
196+
public function htmlList($identifier, $items = array()) {
185197
return $this->addHtmlComponent(new HtmlList($identifier, $items));
186198
}
187199

188200
/**
189-
* Adds a new segment, used to create a grouping of related content
201+
* Adds a new segment, used to create a grouping of related content.
202+
*
190203
* @param string $identifier
191204
* @param string $content
192205
* @return HtmlSegment
193206
*/
194-
public function htmlSegment($identifier, $content="") {
207+
public function htmlSegment($identifier, $content = "") {
195208
return $this->addHtmlComponent(new HtmlSegment($identifier, $content));
196209
}
197210

198211
/**
199212
* Adds a group of segments
213+
*
200214
* @param string $identifier
201-
* @param array $items the segments
215+
* @param array $items
216+
* the segments
202217
* @return HtmlSegmentGroups
203218
*/
204-
public function htmlSegmentGroups($identifier, $items=array()) {
219+
public function htmlSegmentGroups($identifier, $items = array()) {
205220
return $this->addHtmlComponent(new HtmlSegmentGroups($identifier, $items));
206221
}
207222

208223
/**
224+
* Returns a new Semantic Reveal.
209225
*
210226
* @param string $identifier
211227
* @param string|HtmlSemDoubleElement $visibleContent
@@ -214,34 +230,52 @@ public function htmlSegmentGroups($identifier, $items=array()) {
214230
* @param Direction|string $attributeType
215231
* @return HtmlReveal
216232
*/
217-
public function htmlReveal($identifier, $visibleContent, $hiddenContent, $type=RevealType::FADE, $attributeType=NULL) {
233+
public function htmlReveal($identifier, $visibleContent, $hiddenContent, $type = RevealType::FADE, $attributeType = NULL) {
218234
return $this->addHtmlComponent(new HtmlReveal($identifier, $visibleContent, $hiddenContent, $type, $attributeType));
219235
}
220236

221237
/**
238+
* Returns a new Semantic Step.
239+
*
222240
* @param string $identifier
223241
* @param array $steps
224242
* @return HtmlStep
225243
*/
226-
public function htmlStep($identifier, $steps=array()) {
244+
public function htmlStep($identifier, $steps = array()) {
227245
return $this->addHtmlComponent(new HtmlStep($identifier, $steps));
228246
}
229247

230248
/**
249+
*
250+
* Returns a new Semantic Flag.
251+
*
231252
* @param string $identifier
232253
* @param string $flag
233254
* @return HtmlFlag
234255
*/
235256
public function htmlFlag($identifier, $flag) {
236257
return $this->addHtmlComponent(new HtmlFlag($identifier, $flag));
237258
}
238-
259+
239260
/**
261+
* Returns a new Semantic Emoji.
262+
*
240263
* @param string $identifier
241264
* @param string $emoji
242265
* @return HtmlEmoji
243266
*/
244267
public function htmlEmoji($identifier, $emoji) {
245268
return $this->addHtmlComponent(new HtmlEmoji($identifier, $emoji));
246269
}
270+
271+
/**
272+
* Returns a new Semantic Rail.
273+
*
274+
* @param string $identifier
275+
* @param mixed $content
276+
* @return HtmlRail
277+
*/
278+
public function htmlRail($identifier, $content = null) {
279+
return $this->addHtmlComponent(new HtmlRail($identifier, $content));
280+
}
247281
}

0 commit comments

Comments
 (0)