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
|
|
|
$jsCode=str_ireplace("\"","%quote%", $jsCode); |
31
|
|
|
return $this->setParam("onShow", "%function(){".$jsCode."}%"); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
public function setExclusive($value){ |
35
|
|
|
return $this->setParam("exclusive", $value); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* Defines the css selector of the displayed popup |
40
|
|
|
* @param string $popup the css selector of the popup |
41
|
|
|
* @return \Ajax\semantic\components\Popup |
42
|
|
|
*/ |
43
|
|
|
public function setPopup($popup){ |
44
|
|
|
return $this->setParam("popup", $popup); |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
public function setInline($value){ |
48
|
|
|
return $this->setParam("inline", $value); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
public function setPosition($value){ |
52
|
|
|
return $this->setParam("position", $value); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function setSetFluidWidth($value){ |
56
|
|
|
return $this->setParam("setFluidWidth", $value); |
57
|
|
|
} |
58
|
|
|
} |
59
|
|
|
|