Skip to content

Commit 4c56d2c

Browse files
authored
Simplify suspend/unsuspend dialog translations (hestiacp#3565)
1 parent 2972eff commit 4c56d2c

File tree

8 files changed

+24
-8
lines changed

8 files changed

+24
-8
lines changed

web/templates/pages/list_cron.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,13 @@
8484
if ($data[$key]['SUSPENDED'] == 'yes') {
8585
$status = 'suspended';
8686
$spnd_action = 'unsuspend';
87+
$spnd_action_title = _('Unsuspend');
8788
$spnd_icon = 'fa-play';
8889
$spnd_confirmation = _('Are you sure you want to unsuspend the cron job?') ;
8990
} else {
9091
$status = 'active';
9192
$spnd_action = 'suspend';
93+
$spnd_action_title = _('Suspend');
9294
$spnd_icon = 'fa-pause';
9395
$spnd_confirmation = _('Are you sure you want to suspend the cron job?') ;
9496
}
@@ -121,7 +123,7 @@
121123
<a
122124
class="data-controls js-confirm-action"
123125
href="/<?= $spnd_action ?>/cron/?job=<?= $data[$key]["JOB"] ?>&token=<?= $_SESSION["token"] ?>"
124-
data-confirm-title="<?= _($spnd_action) ?>"
126+
data-confirm-title="<?= $spnd_action_title ?>"
125127
data-confirm-message="<?= sprintf($spnd_confirmation, $key) ?>"
126128
>
127129
<i class="fas <?= $spnd_icon ?> icon-highlight icon-dim"></i>

web/templates/pages/list_db.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,13 @@
109109
if ($data[$key]['SUSPENDED'] == 'yes') {
110110
$status = 'suspended';
111111
$spnd_action = 'unsuspend';
112+
$spnd_action_title = _('Unsuspend');
112113
$spnd_icon = 'fa-play';
113114
$spnd_confirmation = _('Are you sure you want to unsuspend database %s?') ;
114115
} else {
115116
$status = 'active';
116117
$spnd_action = 'suspend';
118+
$spnd_action_title = _('Suspend');
117119
$spnd_icon = 'fa-pause';
118120
$spnd_confirmation = _('Are you sure you want to suspend database %s?') ;
119121
}
@@ -158,7 +160,7 @@
158160
<a
159161
class="data-controls js-confirm-action"
160162
href="/<?=$spnd_action?>/db/?database=<?=$key?>&token=<?=$_SESSION['token']?>"
161-
data-confirm-title="<?= _($spnd_action) ?>"
163+
data-confirm-title="<?= $spnd_action_title ?>"
162164
data-confirm-message="<?= sprintf($spnd_confirmation, $key) ?>"
163165
>
164166
<i class="fas <?= $spnd_icon ?> icon-highlight icon-dim"></i>

web/templates/pages/list_dns.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,13 @@
8080
if ($data[$key]['SUSPENDED'] == 'yes') {
8181
$status = 'suspended';
8282
$spnd_action = 'unsuspend';
83+
$spnd_action_title = _('Unsuspend');
8384
$spnd_icon = 'fa-play';
8485
$spnd_confirmation = _('Are you sure you want to unsuspend domain %s?');
8586
} else {
8687
$status = 'active';
8788
$spnd_action = 'suspend';
89+
$spnd_action_title = _('Suspend');
8890
$spnd_icon = 'fa-pause';
8991
$spnd_confirmation = _('Are you sure you want to suspend domain %s?');
9092
if ($data[$key]['DNSSEC'] !== 'yes') {
@@ -124,7 +126,7 @@
124126
<a
125127
class="data-controls js-confirm-action"
126128
href="/<?=$spnd_action?>/dns/?domain=<?=htmlentities($key);?>&token=<?=$_SESSION['token']?>"
127-
data-confirm-title="<?= _($spnd_action) ?>"
129+
data-confirm-title="<?= $spnd_action_title ?>"
128130
data-confirm-message="<?= sprintf($spnd_confirmation, $key) ?>"
129131
>
130132
<i class="fas <?= $spnd_icon ?> icon-highlight icon-dim"></i>

web/templates/pages/list_firewall.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,13 @@
6767
if ($data[$key]['SUSPENDED'] == 'yes') {
6868
$status = 'suspended';
6969
$spnd_action = 'unsuspend';
70+
$spnd_action_title = _('Unsuspend');
7071
$spnd_icon = 'fa-play';
7172
$spnd_confirmation = _('Are you sure you want to unsuspend rule #%s?') ;
7273
} else {
7374
$status = 'active';
7475
$spnd_action = 'suspend';
76+
$spnd_action_title = _('Suspend');
7577
$spnd_icon = 'fa-pause';
7678
$spnd_confirmation = _('Are you sure you want to suspend rule #%s?') ;
7779
}
@@ -106,7 +108,7 @@
106108
<a
107109
class="data-controls js-confirm-action"
108110
href="/<?=$spnd_action?>/firewall/?rule=<?=$key?>&token=<?=$_SESSION['token']?>"
109-
data-confirm-title="<?= _($spnd_action) ?>"
111+
data-confirm-title="<?= $spnd_action_title ?>"
110112
data-confirm-message="<?= sprintf($spnd_confirmation, $key) ?>"
111113
>
112114
<i class="fas <?= $spnd_icon ?> icon-highlight icon-dim"></i>

web/templates/pages/list_mail.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
if ($data[$key]['SUSPENDED'] == 'yes') {
8383
$status = 'suspended';
8484
$spnd_action = 'unsuspend';
85+
$spnd_action_title = _('Unsuspend');
8586
$spnd_icon = 'fa-play';
8687
$spnd_confirmation = _('Are you sure you want to unsuspend domain %s?');
8788
if ($data[$key]['ANTIVIRUS'] == 'no') {
@@ -107,6 +108,7 @@
107108
} else {
108109
$status = 'active';
109110
$spnd_action = 'suspend';
111+
$spnd_action_title = _('Suspend');
110112
$spnd_icon = 'fa-pause';
111113
$spnd_confirmation = _('Are you sure you want to suspend domain %s?');
112114
if ($data[$key]['ANTIVIRUS'] == 'no') {
@@ -169,7 +171,7 @@
169171
<a
170172
class="data-controls js-confirm-action"
171173
href="/<?=$spnd_action?>/mail/?domain=<?=$key?>&token=<?=$_SESSION['token']?>"
172-
data-confirm-title="<?= _($spnd_action) ?>"
174+
data-confirm-title="<?= $spnd_action_title ?>"
173175
data-confirm-message="<?= sprintf($spnd_confirmation, $key) ?>"
174176
>
175177
<i class="fas <?= $spnd_icon ?> icon-highlight icon-dim"></i>

web/templates/pages/list_mail_acc.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
if ($data[$key]['SUSPENDED'] == 'yes') {
9191
$status = 'suspended';
9292
$spnd_action = 'unsuspend';
93+
$spnd_action_title = _('Unsuspend');
9394
$spnd_icon = 'fa-play';
9495
$spnd_confirmation = _('Are you sure you want to unsuspend %s?');
9596
if ($data[$key]['ALIAS'] == '') {
@@ -110,6 +111,7 @@
110111
} else {
111112
$status = 'active';
112113
$spnd_action = 'suspend';
114+
$spnd_action_title = _('Suspend');
113115
$spnd_icon = 'fa-pause';
114116
$spnd_confirmation = _('Are you sure you want to suspend %s?');
115117
if ($data[$key]['ALIAS'] == '') {
@@ -167,7 +169,7 @@
167169
<a
168170
class="data-controls js-confirm-action"
169171
href="/<?=$spnd_action?>/mail/?domain=<?=htmlspecialchars($_GET['domain'])?>&account=<?=$key?>&token=<?=$_SESSION['token']?>"
170-
data-confirm-title="<?= _($spnd_action) ?>"
172+
data-confirm-title="<?= $spnd_action_title ?>"
171173
data-confirm-message="<?= sprintf($spnd_confirmation, $key) ?>"
172174
>
173175
<i class="fas <?= $spnd_icon ?> icon-highlight icon-dim"></i>

web/templates/pages/list_user.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,13 @@
8888
if ($data[$key]['SUSPENDED'] == 'yes') {
8989
$status = 'suspended';
9090
$spnd_action = 'unsuspend';
91+
$spnd_action_title = _('Unsuspend');
9192
$spnd_icon = 'fa-play';
9293
$spnd_confirmation = _('Are you sure you want to unsuspend user %s?');
9394
} else {
9495
$status = 'active';
9596
$spnd_action = 'suspend';
97+
$spnd_action_title = _('Suspend');
9698
$spnd_icon = 'fa-pause';
9799
$spnd_confirmation = _('Are you sure you want to suspend user %s?');
98100
}
@@ -138,7 +140,7 @@
138140
<a
139141
class="data-controls js-confirm-action"
140142
href="/<?= $spnd_action ?>/user/?user=<?= $key ?>&token=<?= $_SESSION["token"] ?>"
141-
data-confirm-title="<?= _($spnd_action) ?>"
143+
data-confirm-title="<?= $spnd_action_title ?>"
142144
data-confirm-message="<?= sprintf($spnd_confirmation, $key) ?>"
143145
>
144146
<i class="fas <?= $spnd_icon ?> icon-highlight icon-dim"></i>

web/templates/pages/list_web.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,13 @@
8181
if ($data[$key]['SUSPENDED'] == 'yes') {
8282
$status = 'suspended';
8383
$spnd_action = 'unsuspend';
84+
$spnd_action_title = _('Unsuspend');
8485
$spnd_icon = 'fa-play';
8586
$spnd_confirmation = _('Are you sure you want to unsuspend domain %s?');
8687
} else {
8788
$status = 'active';
8889
$spnd_action = 'suspend';
90+
$spnd_action_title = _('Suspend');
8991
$spnd_icon = 'fa-pause';
9092
$spnd_confirmation = _('Are you sure you want to suspend domain %s?');
9193
}
@@ -207,7 +209,7 @@
207209
<a
208210
class="data-controls js-confirm-action"
209211
href="/<?=$spnd_action?>/web/?domain=<?=$key?>&token=<?=$_SESSION['token']?>"
210-
data-confirm-title="<?= _($spnd_action) ?>"
212+
data-confirm-title="<?= $spnd_action_title ?>"
211213
data-confirm-message="<?= sprintf($spnd_confirmation, $key) ?>"
212214
>
213215
<i class="fas <?= $spnd_icon ?> icon-highlight icon-dim"></i>

0 commit comments

Comments
 (0)