tbrehm
2013-01-17 43b345cabb3e8743a91c39e8d6367c1aa594ebd2
interface/web/sites/templates/web_domain_edit.htm
@@ -146,7 +146,7 @@
        <div class="buttonHolder buttons">
            <button id="dom-edit-submit" class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}"><span>{tmpl_var name='btn_save_txt'}</span></button>
            <button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('sites/web_domain_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
            <button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onclick="loadContent('sites/web_domain_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
        </div>
    </div>
@@ -166,8 +166,8 @@
            reloadFastcgiPHPVersions();
        });
    }
    adjustForm();
    reloadFastcgiPHPVersions();
    adjustForm(true);
    reloadFastcgiPHPVersions(true);
      
    jQuery('#client_group_id').change(function(){
        clientGroupId = $(this).val();
@@ -179,6 +179,8 @@
    } else {
        jQuery('.fastcgi_php_version:visible').hide();
    }
    //resetFormChanged();
    jQuery('#php').change(function(){
        reloadFastcgiPHPVersions();
        if(jQuery(this).val() == 'fast-cgi' || jQuery(this).val() == 'php-fpm'){
@@ -188,24 +190,31 @@
        }
    });
      
    function adjustForm(){
    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();
                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('.apache').show();
                jQuery('#php option[value="fast-cgi"]').show();
                jQuery('#php option[value="cgi"]').show();
                jQuery('#php option[value="mod"]').show();
                jQuery('#php option[value="suphp"]').show();
            }
            if(noFormChange) {
                resetFormChanged();
                jQuery('#php').addClass('no-page-form-change').change();
                jQuery('#php').removeClass('no-page-form-change');
            } else {
                jQuery('#php').change();
            }
        });
    }
@@ -215,7 +224,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 = '';
@@ -227,17 +236,14 @@
                }
                options += '<option value="'+key+'"'+phpfastcgiselected+'>'+val+'</option>';
            });
            $('#fastcgi_php_version').html(options);
            $('#fastcgi_php_version').html(options).change();
            if(noFormChange) resetFormChanged();
        });
    }
    
    <tmpl_if name="readonly_tab">
        jQuery('div.panel_web_domain').find('fieldset').find('input,select,button').attr('disabled', 'disabled');
        jQuery('div.tabbox_tabs').find('a').click(function() {
               jQuery('div.panel_web_domain').find('fieldset').find('input,select,button').removeAttr('disabled');
        });
        jQuery('div.panel_web_domain').find('fieldset').find('input,select,button').click(function(e) { e.preventDefault(); }).focus(function() { $(this).blur(); });
        jQuery('#dom-edit-submit').click(function() {
               jQuery('div.panel_web_domain').find('fieldset').find('input,select,button').removeAttr('disabled');
               submitForm('pageForm','sites/web_domain_edit.php');
        });
    <tmpl_else>