Passed
Push — master ( 1d8d13...de8c14 )
by Jean-Christophe
04:21
created

Toast   A

Complexity

Total Complexity 13

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 15
c 1
b 0
f 1
dl 0
loc 52
rs 10
wmc 13

13 Methods

Rating   Name   Duplication   Size   Complexity  
A setOnHide() 0 2 1
A setCloseOnClick() 0 2 1
A setTitle() 0 2 1
A setDisplayTime() 0 2 1
A setMessage() 0 2 1
A close() 0 2 1
A showProgress() 0 2 1
A setCloseIcon() 0 2 1
A setOnApprove() 0 2 1
A setShowIcon() 0 2 1
A __construct() 0 3 1
A setOnDeny() 0 2 1
A setClass() 0 2 1
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 Ubiquity
10
 * @author jcheron <[email protected]>
11
 * @version 1.0.0
12
 * @since 2.3.0
13
 */
14
class Toast extends SimpleSemExtComponent {
15
16
	public function __construct(JsUtils $js) {
17
		parent::__construct($js);
18
		$this->uiName='toast';
19
	}
20
21
	public function close(){
22
		return $this->addBehavior('close');
23
	}
24
25
	public function setClass($value){
26
		$this->params['class']=$value;
27
	}
28
	
29
	public function setCloseIcon(){
30
		$this->params['closeIcon']=true;
31
	}
32
	
33
	public function setShowIcon($value=false){
34
		$this->params['showIcon']=$value;
35
	}
36
	
37
	public function setCloseOnClick($value){
38
		$this->params['closeOnClick']=$value;
39
	}
40
	public function setTitle($title){
41
		$this->params['title']=$title;
42
	}
43
	
44
	public function setMessage($message){
45
		$this->params['message']=$message;
46
	}
47
	
48
	public function setDisplayTime($time){
49
		$this->params['displayTime']=$time;
50
	}
51
	
52
	public function showProgress($value='top'){
53
		$this->params['showProgress']=$value;
54
	}
55
56
	public function setOnHide($jsCode) {
57
		$this->addComponentEvent('onHide', $jsCode);
58
	}
59
	
60
	public function setOnApprove($jsCode) {
61
		$this->addComponentEvent('onApprove', $jsCode);
62
	}
63
	
64
	public function setOnDeny($jsCode) {
65
		$this->addComponentEvent('onDeny', $jsCode);
66
	}
67
}
68