Skip to content

Commit 3f1f82c

Browse files
committed
Load and display a hint for the user if no web_domain has been created or assigned by the user
1 parent 8d58b89 commit 3f1f82c

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

interface/web/sites/ajax_get_json.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@
260260
WHERE wd.domain_id = ?", $web_id);
261261

262262
$php_cli_binary = $web['php_cli_binary'];
263-
264263
$domain = $web['domain'];
265264

266265
$domain_owner = $app->db->queryOneRecord("SELECT limit_cron_type FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $web["sys_groupid"]);

interface/web/sites/templates/cron_edit.htm

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,24 +80,27 @@
8080
</div></div>
8181

8282
<script language="JavaScript" type="text/javascript">
83-
84-
// Select first domain onLoad
83+
// Select first existing domain "onLoad"
8584
jQuery(document).ready(function() {
8685
jQuery('#parent_domain_id').trigger('change');
8786
});
88-
87+
// Reload cron placeholders if a different domain was selected
8988
jQuery('#parent_domain_id').change(function(){
9089
reloadCronPlaceholders();
9190
});
9291

9392
function reloadCronPlaceholders() {
9493
var parentDomainId = jQuery('#parent_domain_id').val()
95-
9694
jQuery.getJSON('sites/ajax_get_json.php'+ '?' + Math.round(new Date().getTime()), {web_id: parentDomainId, 'type': 'getcronplaceholders'}, function(data) {
9795
//console.log(data);
9896
$("#php_cli_binary").attr('data-original-title', data.php_cli_binary);
9997
$('#docroot_client').attr('data-original-title', data.docroot_client);
100-
$('#domain').attr('data-original-title', data.domain);
98+
// Load and display a hint to the user that no domain was selected yet. Should only happen if no web_domain has been created or assigned by the user.
99+
if(data.domain == null || data.domain == '') {
100+
$('#domain').attr('data-original-title', "{tmpl_var name='domain_not_selected_placeholder_txt'}");
101+
} else {
102+
$('#domain').attr('data-original-title', data.domain);
103+
}
101104
});
102105
}
103106
</script>

0 commit comments

Comments
 (0)