Skip to content

Commit 1678f93

Browse files
committed
Add global config option show_delete_on_forms
setting the show_delete_on_forms template var needs a better place ... somewhere in interface/web/admin/form/system_config.tform.php ? But that also messed up the system config -> misc form ... name clash
1 parent 1337ca1 commit 1678f93

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

interface/web/admin/form/system_config.tform.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,12 @@
637637
'default' => 'y',
638638
'value' => array(0 => 'n', 1 => 'y')
639639
),
640+
'show_delete_on_forms' => array (
641+
'datatype' => 'VARCHAR',
642+
'formtype' => 'CHECKBOX',
643+
'default' => 'y',
644+
'value' => array(0 => 'n', 1 => 'y')
645+
),
640646
'maintenance_mode' => array (
641647
'datatype' => 'VARCHAR',
642648
'formtype' => 'CHECKBOX',

interface/web/admin/templates/system_config_misc_edit.htm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@
9090
{tmpl_var name='show_support_messages'}
9191
</div>
9292
</div>
93+
<div class="form-group">
94+
<label class="col-sm-3 control-label">{tmpl_var name='show_delete_on_forms_txt'}</label>
95+
<div class="col-sm-9">
96+
{tmpl_var name='show_delete_on_forms'}
97+
</div>
98+
</div>
9399
<div class="form-group">
94100
<label for="customer_no_template" class="col-sm-3 control-label">{tmpl_var name='customer_no_template_txt'}</label>
95101
<div class="col-sm-9"><input type="text" name="customer_no_template" id="customer_no_template" value="{tmpl_var name='customer_no_template'}" class="form-control" /></div>

interface/web/mail/mail_domain_edit.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ function onShowEnd() {
234234
$app->tpl->setVar('dkim_public', $rec['dkim_public'], true);
235235
if (!empty($rec['dkim_public'])) $app->tpl->setVar('dns_record', $dns_record, true);
236236

237+
$global_config = $app->getconf->get_global_config();
238+
$app->tpl->setVar('show_delete_on_forms', $global_config['misc']['show_delete_on_forms']);
239+
237240
parent::onShowEnd();
238241
}
239242

interface/web/mail/templates/mail_domain_edit.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@
118118
<input type="hidden" name="id" value="{tmpl_var name='id'}">
119119
<input type="hidden" name="type" value="local">
120120
<div class="clear">
121-
<tmpl_if name='id'>
121+
<tmpl_if name='id'><tmpl_if name='show_delete_on_forms' op="==" value="y">
122122
<a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('mail/mail_domain_del.php?id={tmpl_var name='id'}&_csrf_id={tmpl_var name='_csrf_id'}&_csrf_key={tmpl_var name='_csrf_key'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a>
123-
</tmpl_if>
123+
</tmpl_if></tmpl_if>
124124
<div class="right">
125125
<button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="mail/mail_domain_edit.php">{tmpl_var name='btn_save_txt'}</button>
126126
<button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="mail/mail_domain_list.php">{tmpl_var name='btn_cancel_txt'}</button>

0 commit comments

Comments
 (0)