Completed
Push — master ( 541276...03d1b2 )
by Jean-Christophe
03:16
created

Popup   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 5
c 2
b 0
f 0
lcom 1
cbo 1
dl 0
loc 39
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setOn() 0 3 1
A setOnShow() 0 3 1
A setExclusive() 0 3 1
A setPopup() 0 3 1
1
<?php
2
3
namespace Ajax\semantic\components;
4
5
use Ajax\common\components\SimpleExtComponent;
6
use Ajax\JsUtils;
7
8
class Popup extends SimpleExtComponent {
9
10
	public function __construct(JsUtils $js) {
11
		parent::__construct($js);
12
		$this->uiName="popup";
13
	}
14
15
	/**
16
	 *
17
	 * @param string $value default : click
18
	 * @return $this
19
	 */
20
	public function setOn($value="click") {
21
		return $this->setParam("on", $value);
22
	}
23
24
	/**
25
	 * This event fires immediately when the show instance method is called.
26
	 * @param string $jsCode
27
	 * @return $this
28
	 */
29
	public function setOnShow($jsCode) {
30
		return $this->setParam("onShow", "%function(){".$jsCode."}%");
31
	}
32
33
	public function setExclusive($value){
34
		return $this->setParam("exclusive", $value);
35
	}
36
37
	/**
38
	 * Defines the css selector of the displayed popup
39
	 * @param string $popup the css selector of the popup
40
	 * @return \Ajax\semantic\components\Popup
41
	 */
42
	public function setPopup($popup){
43
		return $this->setParam("popup", $popup);
44
	}
45
	//TODO other events implementation
46
}