Completed
Pull Request — master (#95)
by
unknown
02:28
created

WindowFactory::createContent()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 25
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 18
nc 1
nop 1
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);
0 ignored issues
show
Security Debugging Code introduced by
var_dump($login); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
44
        print_r($params);
45
        print_r($args);
46
    }
47
48
49
}
50