Passed
Push — master ( 170c0d...3d1821 )
by Jean-Christophe
02:05
created

Toast::setPosition()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Ajax\semantic\components;
4
5
use Ajax\JsUtils;
6
7
/**
8
 * Ajax\semantic\components$Toast
9
 * This class is part of phpMv-ui
10
 * @author jcheron <[email protected]>
11
 * @version 1.0.0
12
 * @since 2.3.0
13
 * @see https://fomantic-ui.com/modules/toast.html
14
 */
15
class Toast extends SimpleSemExtComponent {
16
17
	public function __construct(JsUtils $js=NULL) {
18
		parent::__construct($js);
19
		$this->uiName='toast';
20
	}
21
22
	public function close(){
23
		return $this->addBehavior('close');
24
	}
25
26
	public function setClass($value){
27
		$this->params['class']=$value;
28
		return $this;
29
	}
30
	
31
	public function setCloseIcon(){
32
		$this->params['closeIcon']=true;
33
		return $this;
34
	}
35
	
36
	public function setShowIcon($value=false){
37
		$this->params['showIcon']=$value;
38
		return $this;
39
	}
40
	
41
	public function setCloseOnClick($value){
42
		$this->params['closeOnClick']=$value;
43
		return $this;
44
	}
45
	
46
	public function setTitle($title){
47
		$this->params['title']=$title;
48
		return $this;
49
	}
50
	
51
	public function setMessage($message){
52
		$this->params['message']=$message;
53
		return $this;
54
	}
55
	
56
	public function setPosition($position){
57
		$this->params['position']=$position;
58
		return $this;
59
	}
60
	
61
	public function setDisplayTime($time){
62
		$this->params['displayTime']=$time;
63
		return $this;
64
	}
65
	
66
	public function setShowProgress($value='top'){
67
		$this->params['showProgress']=$value;
68
		return $this;
69
	}
70
	
71
	public function setClassProgress($value){
72
		$this->params['classProgress']=$value;
73
		return $this;
74
	}
75
76
	public function setOnShow($jsCode) {
77
		$this->addComponentEvent('onShow', $jsCode);
78
	}
79
	
80
	public function setOnHide($jsCode) {
81
		$this->addComponentEvent('onHide', $jsCode);
82
		return $this;
83
	}
84
	
85
	public function setOnApprove($jsCode) {
86
		$this->addComponentEvent('onApprove', $jsCode);
87
		return $this;
88
	}
89
	
90
	public function setOnDeny($jsCode) {
91
		$this->addComponentEvent('onDeny', $jsCode);
92
		return $this;
93
	}
94
}
95