|
1
|
|
|
<?php |
|
2
|
|
|
namespace Ajax\semantic\components; |
|
3
|
|
|
|
|
4
|
|
|
use Ajax\JsUtils; |
|
5
|
|
|
|
|
6
|
|
|
/** |
|
7
|
|
|
* Ajax\semantic\components$Sidebar |
|
8
|
|
|
* This class is part of phpMv-ui |
|
9
|
|
|
* |
|
10
|
|
|
* @author jcheron <[email protected]> |
|
11
|
|
|
* @version 1.0.0 |
|
12
|
|
|
* @since 2.3.6 |
|
13
|
|
|
* @see https://fomantic-ui.com/modules/sidebar.html |
|
14
|
|
|
*/ |
|
15
|
|
|
class Sidebar extends SimpleSemExtComponent { |
|
16
|
|
|
|
|
17
|
|
|
public function __construct(JsUtils $js = NULL) { |
|
18
|
|
|
parent::__construct($js); |
|
19
|
|
|
$this->uiName = 'sidebar'; |
|
20
|
|
|
} |
|
21
|
|
|
|
|
22
|
|
|
public function show() { |
|
23
|
|
|
return $this->addBehavior('show'); |
|
24
|
|
|
} |
|
25
|
|
|
|
|
26
|
|
|
public function hide() { |
|
27
|
|
|
return $this->addBehavior('hide'); |
|
28
|
|
|
} |
|
29
|
|
|
|
|
30
|
|
|
public function toogle() { |
|
31
|
|
|
return $this->addBehavior('toggle'); |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
/** |
|
35
|
|
|
* Pushes page content to be visible alongside sidebar. |
|
36
|
|
|
*/ |
|
37
|
|
|
public function pushPage() { |
|
38
|
|
|
return $this->addBehavior('push page'); |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* Returns page content to original position. |
|
43
|
|
|
*/ |
|
44
|
|
|
public function pullPage() { |
|
45
|
|
|
return $this->addBehavior('pull page'); |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
public function setContext($value) { |
|
49
|
|
|
$this->params['context'] = $value; |
|
50
|
|
|
return $this; |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
public function setExclusive($value = true) { |
|
|
|
|
|
|
54
|
|
|
$this->params['exclusive'] = true; |
|
55
|
|
|
return $this; |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
public function setClosable($value = true) { |
|
59
|
|
|
$this->params['closable'] = $value; |
|
60
|
|
|
return $this; |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
public function setDimPage($value = true) { |
|
64
|
|
|
$this->params['dimPage'] = $value; |
|
65
|
|
|
return $this; |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
public function setScrollLock($value = false) { |
|
69
|
|
|
$this->params['scrollLock'] = $value; |
|
70
|
|
|
return $this; |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
public function setReturnScroll($value = false) { |
|
74
|
|
|
$this->params['returnScroll'] = $value; |
|
75
|
|
|
return $this; |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
public function setOnVisible($jsCode) { |
|
79
|
|
|
$this->addComponentEvent('onVisible', $jsCode); |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
public function setOnShow($jsCode) { |
|
83
|
|
|
$this->addComponentEvent('onShow', $jsCode); |
|
84
|
|
|
return $this; |
|
85
|
|
|
} |
|
86
|
|
|
|
|
87
|
|
|
public function setOnChange($jsCode) { |
|
88
|
|
|
$this->addComponentEvent('onChange', $jsCode); |
|
89
|
|
|
return $this; |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
public function setOnHide($jsCode) { |
|
93
|
|
|
$this->addComponentEvent('onHide', $jsCode); |
|
94
|
|
|
return $this; |
|
95
|
|
|
} |
|
96
|
|
|
|
|
97
|
|
|
public function setOnHidden($jsCode) { |
|
98
|
|
|
$this->addComponentEvent('onHidden', $jsCode); |
|
99
|
|
|
return $this; |
|
100
|
|
|
} |
|
101
|
|
|
} |
|
102
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.