mcramer
2013-01-14 46eec24c42d8f5bb330e5c4218e628d43c1dbc72
Fixed:
- on new vhost subdomain the php modes were not correctly displayed (nginx)
- on vhost subdomains and domains the default php mode stated "fastcgi" even if it was not available

3 files modified
53 ■■■■ changed files
interface/web/sites/templates/web_domain_edit.htm 13 ●●●● patch | view | raw | blame | history
interface/web/sites/templates/web_vhost_subdomain_edit.htm 34 ●●●● patch | view | raw | blame | history
interface/web/themes/default/templates/main.tpl.htm 6 ●●●●● patch | view | raw | blame | history
interface/web/sites/templates/web_domain_edit.htm
@@ -195,11 +195,13 @@
            if(data.servertype == "nginx"){
                var selected = jQuery('#php').val();
                jQuery('.apache').hide();
                if(selected != "no" && selected != "php-fpm") {
                    jQuery('#php option[value="php-fpm"]').attr('selected', 'selected').val('php-fpm');
                }
                jQuery('#php option[value="fast-cgi"]').hide();
                jQuery('#php option[value="cgi"]').hide();
                jQuery('#php option[value="mod"]').hide();
                jQuery('#php option[value="suphp"]').hide();
                if(selected != "no" && selected != "php-fpm") jQuery('#php option[value="php-fpm"]').attr('selected', 'selected');
            } else {
                jQuery('.apache').show();
                jQuery('#php option[value="fast-cgi"]').show();
@@ -207,8 +209,13 @@
                jQuery('#php option[value="mod"]').show();
                jQuery('#php option[value="suphp"]').show();
            }
            if(noFormChange) resetFormChanged();
            else jQuery('#php').change();
            if(noFormChange) {
                resetFormChanged();
                jQuery('#php').addClass('no-page-form-change').change();
                jQuery('#php').removeClass('no-page-form-change');
            } else {
                jQuery('#php').change();
            }
        });
    }
        
interface/web/sites/templates/web_vhost_subdomain_edit.htm
@@ -140,8 +140,7 @@
            reloadFastcgiPHPVersions();
        });
    }
    adjustForm();
    reloadFastcgiPHPVersions();
    reloadServerId(true);
        
    jQuery('#client_group_id').change(function(){
        clientGroupId = $(this).val();
@@ -161,17 +160,31 @@
            jQuery('.fastcgi_php_version:visible').hide();
        }
    });
    function adjustForm(){
    jQuery('#parent_domain_id').change(function() {
        reloadServerId(false);
    });
    function reloadServerId(noFormChange) {
        var parentWebId = jQuery('#parent_domain_id').val();
        jQuery.getJSON('sites/ajax_get_json.php'+ '?' + Math.round(new Date().getTime()), {web_id : parentWebId, type : "getserverid"}, function(data) {
            if(data.serverid) serverId = data.serverid;
            adjustForm(noFormChange);
            if(noFormChange) reloadFastcgiPHPVersions(noFormChange);
        });
    }
    function adjustForm(noFormChange){
        jQuery.getJSON('sites/ajax_get_json.php'+ '?' + Math.round(new Date().getTime()), {server_id : serverId, type : "getservertype"}, function(data) {
            if(data.servertype == "nginx"){
                var selected = jQuery('#php').val();
                jQuery('.apache').hide();
                if(selected != "no" && selected != "php-fpm") {
                    jQuery('#php option[value="php-fpm"]').attr('selected', 'selected').val('php-fpm');
                }
                jQuery('#php option[value="fast-cgi"]').hide();
                jQuery('#php option[value="cgi"]').hide();
                jQuery('#php option[value="mod"]').hide();
                jQuery('#php option[value="suphp"]').hide();
                if(selected != "no" && selected != "php-fpm") jQuery('#php option[value="php-fpm"]').attr('selected', 'selected');
            } else {
                jQuery('.apache').show();
                jQuery('#php option[value="fast-cgi"]').show();
@@ -179,7 +192,13 @@
                jQuery('#php option[value="mod"]').show();
                jQuery('#php option[value="suphp"]').show();
            }
            jQuery('#php').change();
            if(noFormChange) {
                resetFormChanged();
                jQuery('#php').addClass('no-page-form-change').change();
                jQuery('#php').removeClass('no-page-form-change');
            } else {
                jQuery('#php').change();
            }
        });
    }
        
@@ -188,7 +207,7 @@
        loadOptionInto('ipv6_address','sites/ajax_get_ip.php?ip_type=IPv6&server_id='+serverId+'&client_group_id='+clientGroupId);
    }
        
    function reloadFastcgiPHPVersions() {
    function reloadFastcgiPHPVersions(noFormChange) {
        jQuery.getJSON('sites/ajax_get_json.php'+ '?' + Math.round(new Date().getTime()), {server_id : serverId, php_type : jQuery('#php').val(), type : "getphpfastcgi"}, function(data) {
            var options = '<option value="">Default</option>';
            var phpfastcgiselected = '';
@@ -201,6 +220,7 @@
                options += '<option value="'+key+'"'+phpfastcgiselected+'>'+val+'</option>';
            });
            $('#fastcgi_php_version').html(options).change();
            if(noFormChange) resetFormChanged();
        });
    }
    
interface/web/themes/default/templates/main.tpl.htm
@@ -57,8 +57,10 @@
                    jQuery(".panel #Filter").trigger('click');
                }
                if(elName == 'select' || elName == 'input' || elName == 'textarea') {
                    // set marker that something was changed
                    pageFormChanged = true;
                    if(jQuery(event.target).hasClass('no-page-form-change') == false) {
                        // set marker that something was changed
                        pageFormChanged = true;
                    }
                }
            });