1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace hipanel\modules\hosting\menus; |
4
|
|
|
|
5
|
|
|
use hipanel\widgets\ModalButton; |
6
|
|
|
use hiqdev\menumanager\Menu; |
7
|
|
|
use Yii; |
8
|
|
|
use yii\helpers\Html; |
9
|
|
|
|
10
|
|
|
class MailDetailMenu extends Menu |
11
|
|
|
{ |
12
|
|
|
public $model; |
13
|
|
|
|
14
|
|
|
public function items() |
15
|
|
|
{ |
16
|
|
|
return [ |
17
|
|
|
[ |
18
|
|
|
'label' => Yii::t('hipanel', 'Update'), |
19
|
|
|
'icon' => 'fa-pencil', |
20
|
|
|
'url' => ['update', 'id' => $this->model->id], |
21
|
|
|
], |
22
|
|
|
[ |
23
|
|
|
'label' => $this->renderView('_change-password', ['model' => $this->model]), |
24
|
|
|
'encode' => false, |
25
|
|
|
'visible' => $this->model->canChangePassword(), |
26
|
|
|
], |
27
|
|
|
[ |
28
|
|
|
'label' => ModalButton::widget([ |
29
|
|
|
'model' => $this->model, |
30
|
|
|
'scenario' => 'delete', |
31
|
|
|
'button' => [ |
32
|
|
|
'label' => '<i class="fa fa-fw fa-trash-o"></i> ' . Yii::t('hipanel', 'Delete'), |
33
|
|
|
], |
34
|
|
|
'modal' => [ |
35
|
|
|
'header' => Html::tag('h4', Yii::t('hipanel:hosting', 'Confirm mailbox deleting')), |
36
|
|
|
'headerOptions' => ['class' => 'label-danger'], |
37
|
|
|
'footer' => [ |
38
|
|
|
'label' => Yii::t('hipanel:hosting', 'Delete mailbox'), |
39
|
|
|
'data-loading-text' => Yii::t('hipanel', 'Deleting...'), |
40
|
|
|
'class' => 'btn btn-danger', |
41
|
|
|
] |
42
|
|
|
], |
43
|
|
|
'body' => Yii::t('hipanel:hosting', |
44
|
|
|
'Are you sure to delete mail {name}?', |
45
|
|
|
['name' => Html::tag('b', $this->model->mail)] |
46
|
|
|
) |
47
|
|
|
]), |
48
|
|
|
'encode' => false, |
49
|
|
|
], |
50
|
|
|
]; |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
public function getViewPath() |
54
|
|
|
{ |
55
|
|
|
return '@vendor/hiqdev/hipanel-module-hosting/src/views/mail'; |
56
|
|
|
} |
57
|
|
|
} |
58
|
|
|
|