1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Hosting Plugin for HiPanel |
4
|
|
|
* |
5
|
|
|
* @link https://github.com/hiqdev/hipanel-module-hosting |
6
|
|
|
* @package hipanel-module-hosting |
7
|
|
|
* @license BSD-3-Clause |
8
|
|
|
* @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/) |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
namespace hipanel\modules\hosting\menus; |
12
|
|
|
|
13
|
|
|
use Yii; |
14
|
|
|
|
15
|
|
|
class BackupingDetailMenu extends \hipanel\menus\AbstractDetailMenu |
16
|
|
|
{ |
17
|
|
|
public $model; |
18
|
|
|
|
19
|
|
|
public function items() |
20
|
|
|
{ |
21
|
|
|
return [ |
22
|
|
|
[ |
23
|
|
|
'label' => Yii::t('hipanel:hosting', 'Update settings'), |
24
|
|
|
'icon' => 'fa-pencil', |
25
|
|
|
'url' => ['@backuping/update', 'id' => $this->model->id], |
26
|
|
|
'encode' => false, |
27
|
|
|
'visible' => Yii::$app->user->can('support') && !$this->model->isDeleted(), |
28
|
|
|
],[ |
29
|
|
|
'label' => Yii::t('hipanel', 'Enable'), |
30
|
|
|
'icon' => 'fa-activate', |
31
|
|
|
'url' => ['@backuping/enable', 'id' => $this->model->id], |
32
|
|
|
'encode' => false, |
33
|
|
|
'visible' => $this->model->canBeEnabled(), |
34
|
|
|
'linkOptions' => [ |
35
|
|
|
'data' => [ |
36
|
|
|
'method' => 'post', |
37
|
|
|
'pjax' => '0', |
38
|
|
|
'params' => [ |
39
|
|
|
'Backuping[id]' => $this->model->id, |
40
|
|
|
], |
41
|
|
|
], |
42
|
|
|
], |
43
|
|
|
], [ |
44
|
|
|
'label' => Yii::t('hipanel', 'Restore'), |
45
|
|
|
'icon' => 'fa-archive', |
46
|
|
|
'url' => ['@backuping/undelete', 'id' => $this->model->id], |
47
|
|
|
'encode' => false, |
48
|
|
|
'visible' => $this->model->canBeRestored(), |
49
|
|
|
'linkOptions' => [ |
50
|
|
|
'data' => [ |
51
|
|
|
'method' => 'post', |
52
|
|
|
'pjax' => '0', |
53
|
|
|
'params' => [ |
54
|
|
|
'Backuping[id]' => $this->model->id, |
55
|
|
|
], |
56
|
|
|
], |
57
|
|
|
], |
58
|
|
|
], [ |
59
|
|
|
'label' => Yii::t('hipanel', 'Disable'), |
60
|
|
|
'icon' => 'fa-ban', |
61
|
|
|
'url' => ['@backuping/disable', 'id' => $this->model->id], |
62
|
|
|
'encode' => false, |
63
|
|
|
'visible' => $this->model->canBeDisabled(), |
64
|
|
|
'linkOptions' => [ |
65
|
|
|
'data' => [ |
66
|
|
|
'method' => 'post', |
67
|
|
|
'pjax' => '0', |
68
|
|
|
'params' => [ |
69
|
|
|
'Backuping[id]' => $this->model->id, |
70
|
|
|
], |
71
|
|
|
], |
72
|
|
|
], |
73
|
|
|
], [ |
74
|
|
|
'label' => Yii::t('hipanel', 'Delete'), |
75
|
|
|
'icon' => 'fa-trash', |
76
|
|
|
'url' => ['@backuping/delete', 'id' => $this->model->id], |
77
|
|
|
'encode' => false, |
78
|
|
|
'visible' => $this->model->canBeDeleted(), |
79
|
|
|
'linkOptions' => [ |
80
|
|
|
'data' => [ |
81
|
|
|
'confirm' => Yii::t('hipanel:hosting', 'Are you sure you want to delete backuping?'), |
82
|
|
|
'method' => 'post', |
83
|
|
|
'pjax' => '0', |
84
|
|
|
'params' => [ |
85
|
|
|
'Backuping[id]' => $this->model->id, |
86
|
|
|
], |
87
|
|
|
], |
88
|
|
|
], |
89
|
|
|
|
90
|
|
|
], |
91
|
|
|
]; |
92
|
|
|
} |
93
|
|
|
} |
94
|
|
|
|