Passed
Push — master ( d083b3...c1260e )
by Jean-Christophe
01:42
created

Toast::setClassProgress()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 2
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
	}
29
	
30
	public function setCloseIcon(){
31
		$this->params['closeIcon']=true;
32
	}
33
	
34
	public function setShowIcon($value=false){
35
		$this->params['showIcon']=$value;
36
	}
37
	
38
	public function setCloseOnClick($value){
39
		$this->params['closeOnClick']=$value;
40
	}
41
	public function setTitle($title){
42
		$this->params['title']=$title;
43
	}
44
	
45
	public function setMessage($message){
46
		$this->params['message']=$message;
47
	}
48
	
49
	public function setDisplayTime($time){
50
		$this->params['displayTime']=$time;
51
	}
52
	
53
	public function setShowProgress($value='top'){
54
		$this->params['showProgress']=$value;
55
	}
56
	
57
	public function setClassProgress($value){
58
		$this->params['classProgress']=$value;
59
	}
60
61
	public function setOnShow($jsCode) {
62
		$this->addComponentEvent('onShow', $jsCode);
63
	}
64
	
65
	public function setOnHide($jsCode) {
66
		$this->addComponentEvent('onHide', $jsCode);
67
	}
68
	
69
	public function setOnApprove($jsCode) {
70
		$this->addComponentEvent('onApprove', $jsCode);
71
	}
72
	
73
	public function setOnDeny($jsCode) {
74
		$this->addComponentEvent('onDeny', $jsCode);
75
	}
76
}
77