Completed
Push — master ( 195df7...541276 )
by Jean-Christophe
03:05
created

HtmlSegment::setBasic()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
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
}