1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Ajax\semantic\html\elements; |
4
|
|
|
|
5
|
|
|
use Ajax\semantic\html\base\HtmlSemDoubleElement; |
6
|
|
|
use Ajax\semantic\html\base\constants\SegmentType; |
7
|
|
|
use Ajax\semantic\html\base\traits\AttachedTrait; |
8
|
|
|
use Ajax\semantic\html\base\constants\State; |
9
|
|
|
use Ajax\semantic\html\base\constants\Variation; |
10
|
|
|
use Ajax\semantic\html\base\constants\Emphasis; |
11
|
|
|
use Ajax\semantic\html\base\traits\TextAlignmentTrait; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* Semantic Segment element |
15
|
|
|
* @see http://semantic-ui.com/elements/segment.html |
16
|
|
|
* @author jc |
17
|
|
|
* @version 1.001 |
18
|
|
|
*/ |
19
|
|
|
class HtmlSegment extends HtmlSemDoubleElement { |
20
|
|
|
use AttachedTrait,TextAlignmentTrait; |
21
|
|
|
|
22
|
|
|
public function __construct($identifier, $content="") { |
23
|
|
|
parent::__construct($identifier, "div", "ui segment"); |
24
|
|
|
$this->_variations=\array_merge($this->_variations, [ Variation::PADDED,Variation::COMPACT ]); |
25
|
|
|
$this->_states=\array_merge($this->_states, [ State::LOADING ]); |
26
|
|
|
$this->content=$content; |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* Defines the segment type |
31
|
|
|
* @param string $type one of "raised","stacked","piled" default : "" |
32
|
|
|
* @return \Ajax\semantic\html\elements\HtmlSegment |
33
|
|
|
*/ |
34
|
|
|
public function setType($type) { |
35
|
|
|
return $this->addToPropertyCtrl("class", $type, SegmentType::getConstants()); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
public function setSens($sens="vertical") { |
39
|
|
|
return $this->addToPropertyCtrl("class", $sens, array ("vertical","horizontal" )); |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
public function setEmphasis($value=Emphasis::SECONDARY) { |
43
|
|
|
return $this->addToPropertyCtrl("class", $value, Emphasis::getConstants()); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
public function setCircular() { |
47
|
|
|
return $this->addToProperty("class", "circular"); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
public function clear() { |
51
|
|
|
return $this->addToProperty("class", "clearing"); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public function setCompact() { |
55
|
|
|
return $this->addToProperty("class", "compact"); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
public function setBasic() { |
59
|
|
|
return $this->setProperty("class", "ui basic segment"); |
60
|
|
|
} |
61
|
|
|
} |