Conditions | 1 |
Paths | 1 |
Total Lines | 37 |
Code Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Tests | 27 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
19 | 2 | public function __construct(DIInterface $di, $id) |
|
20 | { |
||
21 | 2 | parent::__construct($di); |
|
22 | 2 | $user = $di->get("userService")->getUserByField("id", $id); |
|
23 | 2 | $this->form->create( |
|
24 | [ |
||
25 | 2 | "id" => __CLASS__, |
|
26 | 2 | "legend" => "Radera användare.", |
|
27 | 2 | ], |
|
28 | [ |
||
29 | "id" => [ |
||
30 | 2 | "type" => "text", |
|
31 | 2 | "validation" => ["not_empty"], |
|
32 | 2 | "readonly" => true, |
|
33 | 2 | "value" => $user->id, |
|
34 | 2 | ], |
|
35 | |||
36 | "username" => [ |
||
37 | 2 | "label" => "Användarnamn", |
|
38 | 2 | "readonly" => true, |
|
39 | 2 | "type" => "text", |
|
40 | 2 | "value" => htmlentities($user->username), |
|
41 | 2 | ], |
|
42 | "confirm" => [ |
||
43 | 2 | "required" => true, |
|
44 | 2 | "label" => "Bekräfta", |
|
45 | 2 | "type" => "checkbox", |
|
46 | 2 | ], |
|
47 | |||
48 | "submit" => [ |
||
49 | 2 | "type" => "submit", |
|
50 | 2 | "value" => "Radera", |
|
51 | 2 | "callback" => [$this, "callbackSubmit"] |
|
52 | 2 | ], |
|
53 | ] |
||
54 | 2 | ); |
|
55 | 2 | } |
|
56 | |||
72 |