Completed
Push — master ( 038688...337a7a )
by Klochok
08:41
created

AccountDetailMenu   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 39
ccs 0
cts 31
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
B items() 0 27 2
A getViewPath() 0 4 1
1
<?php
2
3
namespace hipanel\modules\hosting\menus;
4
5
use hiqdev\menumanager\Menu;
6
use Yii;
7
8
class AccountDetailMenu extends Menu
9
{
10
    public $model;
11
12
    public $blockReasons = [];
13
14
    public function items()
15
    {
16
        return [
17
            [
18
                'label' => $this->renderView('_change-password', ['model' => $this->model]),
19
                'encode' => false,
20
            ],
21
            [
22
                'label' => $this->renderView('_manage-ip-restrictions', ['model' => $this->model]),
23
                'encode' => false,
24
            ],
25
            [
26
                'label' => $this->renderView('_mail-settings', ['model' => $this->model]),
27
                'encode' => false,
28
                'visible' => $this->model->canSetMailSettings(),
29
            ],
30
            [
31
                'label' => $this->renderView('_block', ['model' => $this->model, 'blockReasons' => $this->blockReasons]),
32
                'encode' => false,
33
                'visible' => Yii::$app->user->can('support') && Yii::$app->user->id !== $this->model->client_id,
34
            ],
35
            [
36
                'label' => $this->renderView('_delete', ['model' => $this->model]),
37
                'encode' => false,
38
            ],
39
        ];
40
    }
41
42
    public function getViewPath()
43
    {
44
        return '@vendor/hiqdev/hipanel-module-hosting/src/views/account';
45
    }
46
}
47