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

WindowFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
B createContent() 0 25 1
A ok() 0 6 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