-
Notifications
You must be signed in to change notification settings - Fork 991
/
leftSideButtons.php
64 lines (60 loc) · 1.94 KB
/
leftSideButtons.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/** @var bool $hasUpdatePermission */
/** @var bool $hasDeletePermission*/
/** @var int $lid*/
//edit label set button
if ($hasUpdatePermission) {
$this->widget(
'ext.ButtonWidget.ButtonWidget',
[
'name' => 'create-import-button',
'id' => 'edit-button',
'text' => gT('Edit label set'),
'icon' => 'ri-pencil-fill',
'link' => $this->createUrl("admin/labels/sa/editlabelset/lid/" . $lid),
'htmlOptions' => [
'class' => 'btn btn-outline-secondary',
'role' => 'button'
],
]
);
}
//export this label set
$this->widget(
'ext.ButtonWidget.ButtonWidget',
[
'name' => 'export-button',
'id' => 'export-button',
'text' => gT('Export this label set'),
'icon' => 'ri-upload-2-fill',
'link' => $this->createUrl("admin/export/sa/dumplabel/lid/$lid"),
'htmlOptions' => [
'class' => 'btn btn-outline-secondary',
'role' => 'button'
],
]
);
if ($hasDeletePermission) {
//delete this label set
$dataPost = json_encode(['lid' => $lid]);
$this->widget(
'ext.ButtonWidget.ButtonWidget',
[
'name' => 'delete-button',
'id' => 'create-import-button',
'text' => gT('Delete'),
'icon' => 'ri-delete-bin-fill',
'htmlOptions' => [
'class' => 'btn btn-danger',
'data-bs-toggle' => 'modal',
'data-post-url' => $this->createUrl('admin/labels/sa/delete/'),
'data-post-datas' => $dataPost,
'data-btnclass' => 'btn-danger',
'data-btntext' => gt('Delete'),
'data-title' => gt('Delete label set'),
'data-bs-target' => '#confirmation-modal',
'data-message' => gT("Do you really want to delete this label set?", "js")
],
]
);
}