|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace eXpansion\Bundle\Acme\Plugins\Gui; |
|
4
|
|
|
|
|
5
|
|
|
use eXpansion\Framework\Core\Model\Gui\ManialinkInterface; |
|
6
|
|
|
use eXpansion\Framework\Core\Plugins\Gui\WindowFactory as BaseWindowFactory; |
|
7
|
|
|
use eXpansion\Framework\Gui\Components\uiButton; |
|
8
|
|
|
use eXpansion\Framework\Gui\Components\uiCheckbox; |
|
9
|
|
|
use eXpansion\Framework\Gui\Components\uiLabel; |
|
10
|
|
|
|
|
11
|
|
|
class WindowFactory extends BaseWindowFactory |
|
12
|
|
|
{ |
|
13
|
|
|
|
|
14
|
|
|
protected function createContent(ManialinkInterface $manialink) |
|
15
|
|
|
{ |
|
16
|
|
|
parent::createContent($manialink); |
|
17
|
|
|
$label = new uiLabel("Test", uiLabel::TYPE_NORMAL); |
|
18
|
|
|
$manialink->addChild($label); |
|
19
|
|
|
|
|
20
|
|
|
$checkbox = new uiCheckbox("test checkbox 1 ", "checkbox1"); |
|
21
|
|
|
$checkbox->setPosition(10, -5); |
|
22
|
|
|
$manialink->addChild($checkbox); |
|
23
|
|
|
|
|
24
|
|
|
$checkbox = new uiCheckbox("test checkbox 2", "checkbox2"); |
|
25
|
|
|
$checkbox->setPosition(10, -10); |
|
26
|
|
|
$manialink->addChild($checkbox); |
|
27
|
|
|
|
|
28
|
|
|
$ok = new uiButton("Apply", uiButton::TYPE_DECORATED); |
|
29
|
|
|
$ok->setPosition(10, -25) |
|
30
|
|
|
->setAction($this->actionFactory->createManialinkAction($manialink, [$this, 'ok'], ["ok" => "ok"])); |
|
31
|
|
|
$manialink->addChild($ok); |
|
32
|
|
|
|
|
33
|
|
|
$ok = new uiButton("Cancel"); |
|
34
|
|
|
$ok->setPosition(40, -25) |
|
35
|
|
|
->setAction($this->actionFactory->createManialinkAction($manialink, [$this, 'ok'], ["ok" => "cancel"])); |
|
36
|
|
|
$manialink->addChild($ok); |
|
37
|
|
|
|
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
|
|
41
|
|
|
public function ok($login, $params, $args) |
|
42
|
|
|
{ |
|
43
|
|
|
var_dump($login); |
|
|
|
|
|
|
44
|
|
|
print_r($params); |
|
45
|
|
|
print_r($args); |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
|
|
49
|
|
|
} |
|
50
|
|
|
|