1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Ajax\semantic\html\elements; |
4
|
|
|
|
5
|
|
|
use Ajax\semantic\html\base\HtmlSemDoubleElement; |
6
|
|
|
use Ajax\semantic\html\base\SegmentType; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Semantic Segment element |
10
|
|
|
* @see http://semantic-ui.com/elements/segment.html |
11
|
|
|
* @author jc |
12
|
|
|
* @version 1.001 |
13
|
|
|
*/ |
14
|
|
|
class HtmlSegment extends HtmlSemDoubleElement { |
15
|
|
|
|
16
|
|
|
public function __construct($identifier, $content="") { |
17
|
|
|
parent::__construct($identifier, "div"); |
18
|
|
|
$this->content=$content; |
19
|
|
|
$this->setClass("ui segment"); |
20
|
|
|
} |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Defines the segment type |
24
|
|
|
* @param string $type one of "raised","stacked","piled" default : "" |
25
|
|
|
* @return \Ajax\semantic\html\elements\HtmlSegment |
26
|
|
|
*/ |
27
|
|
|
public function setType($type){ |
28
|
|
|
return $this->addToPropertyCtrl("class", $type, SegmentType::getConstants()); |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
public function setSens($sens="vertical"){ |
32
|
|
|
return $this->addToPropertyCtrl("class", $sens, array("vertical","horizontal")); |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
public function setInverted(){ |
36
|
|
|
return $this->addToProperty("class", "inverted"); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
public function setAttached(){ |
40
|
|
|
return $this->addToProperty("class", "attached"); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
public function setEmphasis($value="secondary"){ |
44
|
|
|
return $this->addToPropertyCtrl("class", $value, array("secondary","tertiary","")); |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
public function setCircular(){ |
48
|
|
|
return $this->addToProperty("class", "circular"); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
public function clear(){ |
52
|
|
|
return $this->addToProperty("class", "clearing"); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function setFloating($value="left"){ |
56
|
|
|
return $this->addToPropertyCtrl("class", "floated ".$value,array("floated right","floated left")); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public function setTextAlignment($value="left"){ |
60
|
|
|
return $this->addToPropertyCtrl("class", "aligned ".$value,array("aligned right","aligned left","aligned center")); |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
public function setCompact(){ |
64
|
|
|
return $this->addToProperty("class", "compact"); |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
public function setBasic(){ |
68
|
|
|
return $this->setProperty("class", "ui basic segment"); |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
} |