From 7d52e00a51450bc4a080d4e21b7dda02c0a65191 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Thu, 14 Nov 2013 05:42:06 -0500
Subject: [PATCH] Fixed list sorting
---
interface/web/sites/templates/web_domain_edit.htm | 379 +++++++++++++++++++++++++++++++++++++----------------
1 files changed, 265 insertions(+), 114 deletions(-)
diff --git a/interface/web/sites/templates/web_domain_edit.htm b/interface/web/sites/templates/web_domain_edit.htm
index 59d7256..d12c3a3 100644
--- a/interface/web/sites/templates/web_domain_edit.htm
+++ b/interface/web/sites/templates/web_domain_edit.htm
@@ -1,114 +1,265 @@
-<table width="500" border="0" cellspacing="0" cellpadding="2">
- <tmpl_if name="is_admin">
- <tr>
- <td class="frmText11">{tmpl_var name='server_id_txt'}:</td>
- <td class="frmText11">
- <select name="server_id" id="server_id" class="text" onChange="loadContentInto('ip_address','sites/ajax_get_ip.php?server_id='+document.getElementById('server_id').value)">
- {tmpl_var name='server_id'}
- </select>
- </td>
- </tr>
- <tr>
- <td class="frmText11">{tmpl_var name='client_txt'}:</td>
- <td class="frmText11">
- <select name="client_group_id" class="text">
- {tmpl_var name='client_group_id'}
- </select>
- </td>
- </tr>
- </tmpl_if>
- <tmpl_if name="is_reseller">
- <tr>
- <td class="frmText11">{tmpl_var name='client_txt'}:</td>
- <td class="frmText11">
- <select name="client_group_id" class="text">
- {tmpl_var name='client_group_id'}
- </select>
- </td>
- </tr>
- </tmpl_if>
- <tr>
- <td class="frmText11">{tmpl_var name='ip_address_txt'}:</td>
- <td class="frmText11">
- <select name="ip_address" id="ip_address" class="text">
- {tmpl_var name='ip_address'}
- </select>
- </td>
- </tr>
- <tr>
- <td class="frmText11">{tmpl_var name='domain_txt'}:</td>
- <td class="frmText11"><input name="domain" type="text" class="text" value="{tmpl_var name='domain'}" size="30" maxlength="255"></td>
- </tr>
- <!--
- <tr>
- <td class="frmText11">{tmpl_var name='type_txt'}:</td>
- <td class="frmText11">
- <select name="type" class="text">
- {tmpl_var name='type'}
- </select>
- </td>
- </tr>
- <tr>
- <td class="frmText11">{tmpl_var name='parent_domain_id_txt'}:</td>
- <td class="frmText11">
- <select name="parent_domain_id" class="text">
- {tmpl_var name='parent_domain_id'}
- </select>
- </td>
- </tr>
- <tr>
- <td class="frmText11">{tmpl_var name='vhost_type_txt'}:</td>
- <td class="frmText11">
- <select name="vhost_type" class="text">
- {tmpl_var name='vhost_type'}
- </select>
- </td>
- </tr>
- -->
- <tr>
- <td class="frmText11">{tmpl_var name='hd_quota_txt'}:</td>
- <td class="frmText11"><input name="hd_quota" type="text" class="text" value="{tmpl_var name='hd_quota'}" size="7" maxlength="7"> MB</td>
- </tr>
- <tr>
- <td class="frmText11">{tmpl_var name='traffic_quota_txt'}:</td>
- <td class="frmText11"><input name="traffic_quota" type="text" class="text" value="{tmpl_var name='traffic_quota'}" size="7" maxlength="7"> MB</td>
- </tr>
- <tr>
- <td class="frmText11">{tmpl_var name='cgi_txt'}:</td>
- <td class="frmText11">{tmpl_var name='cgi'}</td>
- </tr>
- <tr>
- <td class="frmText11">{tmpl_var name='ssi_txt'}:</td>
- <td class="frmText11">{tmpl_var name='ssi'}</td>
- </tr>
- <tr>
- <td class="frmText11">{tmpl_var name='suexec_txt'}:</td>
- <td class="frmText11">{tmpl_var name='suexec'}</td>
- </tr>
- <tr>
- <td class="frmText11">{tmpl_var name='ssl_txt'}:</td>
- <td class="frmText11">{tmpl_var name='ssl'}</td>
- </tr>
- <tr>
- <td class="frmText11">{tmpl_var name='php_txt'}:</td>
- <td class="frmText11">
- <select name="php" class="text">
- {tmpl_var name='php'}
- </select>
- </td>
- </tr>
- <tr>
- <td class="frmText11">{tmpl_var name='active_txt'}:</td>
- <td class="frmText11">{tmpl_var name='active'}</td>
- </tr> <tr>
- <td class="frmText11"> </td>
- <td class="frmText11"> </td>
- </tr>
- <tr>
- <td> </td>
- <td><input name="btn_save" type="button" class="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','sites/web_domain_edit.php');"><div class="buttonEnding"></div>
- <input name="btn_cancel" type="button" class="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('sites/web_domain_list.php');"><div class="buttonEnding"></div>
- </td>
- </tr>
-</table>
-<input type="hidden" name="id" value="{tmpl_var name='id'}">
\ No newline at end of file
+<h2><tmpl_var name="list_head_txt"></h2>
+<p><tmpl_var name="list_desc_txt"></p>
+
+<tmpl_if name="config_error_msg">
+<div style="background: #ffdfdf; border: 1px solid #df7d7d; border-width: 1px 0; margin: 1.5em 0 1.5em 0; padding: 7px;">
+ <p style="font-face:bold">{tmpl_var name='configuration_error_txt'}</p>
+ <div>
+ <div style="float:left;width:150px;">{tmpl_var name='config_error_tstamp'} : </div><div style="padding-left:150px;">{tmpl_var name='config_error_msg'}</div>
+ </div>
+</div>
+</tmpl_if>
+
+<div class="panel panel_web_domain">
+
+ <div class="pnl_formsarea">
+ <fieldset class="inlineLabels">
+ <tmpl_if name="is_admin">
+ <div class="ctrlHolder">
+ <tmpl_if name="edit_disabled">
+ <label for="server_id_disabled">{tmpl_var name='server_id_txt'}</label>
+ <select name="server_id_disabled" id="server_id_disabled" class="selectInput" disabled="disabled">
+ {tmpl_var name='server_id'}
+ </select>
+ <input type="hidden" name="server_id" value="{tmpl_var name='server_id_value'}" />
+ <tmpl_else>
+ <label for="server_id">{tmpl_var name='server_id_txt'}</label>
+ <select name="server_id" id="server_id" class="selectInput">
+ {tmpl_var name='server_id'}
+ </select>
+ </tmpl_if>
+ </div>
+ <div class="ctrlHolder">
+ <label for="client_group_id">{tmpl_var name='client_group_id_txt'}</label>
+ <select name="client_group_id" id="client_group_id" class="selectInput">
+ {tmpl_var name='client_group_id'}
+ </select>
+ </div>
+ <tmpl_else>
+ <input type="hidden" id="server_id" name="server_id" value="{tmpl_var name='server_id_value'}" />
+ </tmpl_if>
+ <tmpl_if name="is_reseller">
+ <div class="ctrlHolder">
+ <label for="client_group_id">{tmpl_var name='client_group_id_txt'}</label>
+ <select name="client_group_id" id="client_group_id" class="selectInput">
+ {tmpl_var name='client_group_id'}
+ </select>
+ </div>
+ </tmpl_if>
+ <div class="ctrlHolder">
+ <label for="ip_address">{tmpl_var name='ip_address_txt'}</label>
+ <select name="ip_address" id="ip_address" class="selectInput formLengthIPv4">
+ {tmpl_var name='ip_address'}
+ </select>
+ </div>
+ <div class="ctrlHolder">
+ <label for="ipv6_address">{tmpl_var name='ipv6_address_txt'}</label>
+ <select name="ipv6_address" id="ipv6_address" class="selectInput formLengthIPv6">
+ {tmpl_var name='ipv6_address'}
+ </select>
+ </div>
+ <div class="ctrlHolder">
+ <label for="domain">{tmpl_var name='domain_txt'}</label>
+ <tmpl_if name="domain_option">
+ <select name="domain" id="domain" class="selectInput">
+ {tmpl_var name='domain_option'}
+ </select>
+ <tmpl_else>
+ <input name="domain" id="domain" value="{tmpl_var name='domain'}" size="30" maxlength="255" type="text" class="textInput" />
+ </tmpl_if>
+ </div>
+ <div class="ctrlHolder">
+ <label for="hd_quota">{tmpl_var name='hd_quota_txt'}</label>
+ <input name="hd_quota" id="hd_quota" value="{tmpl_var name='hd_quota'}" size="7" maxlength="7" type="text" class="textInput formLengthLimit" /> MB
+ </div>
+ <div class="ctrlHolder">
+ <label for="traffic_quota">{tmpl_var name='traffic_quota_txt'}</label>
+ <input name="traffic_quota" id="traffic_quota" value="{tmpl_var name='traffic_quota'}" size="7" maxlength="7" type="text" class="textInput formLengthLimit" /> MB <tmpl_var name='traffic_quota_exceeded_txt'>
+ </div>
+ <tmpl_if name="limit_cgi" op="==" value="y"><div class="ctrlHolder">
+ <p class="label">{tmpl_var name='cgi_txt'}</p>
+ <div class="multiField">
+ {tmpl_var name='cgi'}
+ </div>
+ </div></tmpl_if>
+ <tmpl_if name="limit_ssi" op="==" value="y"><div class="ctrlHolder">
+ <p class="label">{tmpl_var name='ssi_txt'}</p>
+ <div class="multiField">
+ {tmpl_var name='ssi'}
+ </div>
+ </div></tmpl_if>
+ <tmpl_if name="limit_perl" op="==" value="y"><div class="ctrlHolder apache">
+ <p class="label">{tmpl_var name='perl_txt'}</p>
+ <div class="multiField">
+ {tmpl_var name='perl'}
+ </div>
+ </div></tmpl_if>
+ <tmpl_if name="limit_ruby" op="==" value="y"><div class="ctrlHolder apache">
+ <p class="label">{tmpl_var name='ruby_txt'}</p>
+ <div class="multiField">
+ {tmpl_var name='ruby'}
+ </div>
+ </div></tmpl_if>
+ <tmpl_if name="limit_python" op="==" value="y"><div class="ctrlHolder apache">
+ <p class="label">{tmpl_var name='python_txt'}</p>
+ <div class="multiField">
+ {tmpl_var name='python'}
+ </div>
+ </div></tmpl_if>
+ <tmpl_if name="force_suexec" op="==" value="n"><div class="ctrlHolder apache">
+ <p class="label">{tmpl_var name='suexec_txt'}</p>
+ <div class="multiField">
+ {tmpl_var name='suexec'}
+ </div>
+ </div></tmpl_if>
+ <tmpl_if name="limit_hterror" op="==" value="y"><div class="ctrlHolder">
+ <p class="label">{tmpl_var name='errordocs_txt'}</p>
+ <div class="multiField">
+ {tmpl_var name='errordocs'}
+ </div>
+ </div></tmpl_if>
+
+ <div class="ctrlHolder">
+ <label for="subdomain">{tmpl_var name='subdomain_txt'}</label>
+ <select name="subdomain" id="subdomain" class="selectInput formLengthHalf">
+ {tmpl_var name='subdomain'}
+ </select>
+ </div>
+ <tmpl_if name="limit_ssl" op="==" value="y"><div class="ctrlHolder">
+ <p class="label">{tmpl_var name='ssl_txt'}</p>
+ <div class="multiField">
+ {tmpl_var name='ssl'}
+ </div>
+ </div></tmpl_if>
+ <div class="ctrlHolder">
+ <label for="php">{tmpl_var name='php_txt'}</label>
+ <select name="php" id="php" class="selectInput formLengthHalf">
+ {tmpl_var name='php'}
+ </select>
+ </div>
+ <div class="ctrlHolder fastcgi_php_version">
+ <label for="fastcgi_php_version">{tmpl_var name='fastcgi_php_version_txt'}</label>
+ <select name="fastcgi_php_version" id="fastcgi_php_version" class="selectInput formLengthHalf">
+ {tmpl_var name='fastcgi_php_version'}
+ </select>
+ </div>
+ <div class="ctrlHolder">
+ <p class="label">{tmpl_var name='active_txt'}</p>
+ <div class="multiField">
+ {tmpl_var name='active'}
+ </div>
+ </div>
+ </fieldset>
+
+ <input type="hidden" name="id" value="{tmpl_var name='id'}">
+
+ <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>
+ </div>
+ </div>
+
+</div>
+<script language="JavaScript" type="text/javascript">
+ var serverId;
+ var clientGroupId = jQuery('#client_group_id').val();
+ var serverIdDisabled = jQuery('#server_id_disabled').val();
+ if(serverIdDisabled > 0){
+ serverId = serverIdDisabled;
+ } else {
+ serverId = jQuery('#server_id').val();
+ jQuery('#server_id').change(function(){
+ serverId = $(this).val();
+ adjustForm();
+ reloadWebIP();
+ reloadFastcgiPHPVersions();
+ });
+ }
+ adjustForm(true);
+ reloadFastcgiPHPVersions(true);
+
+ jQuery('#client_group_id').change(function(){
+ clientGroupId = $(this).val();
+ reloadWebIP();
+ reloadFastcgiPHPVersions();
+ });
+
+ if(jQuery('#php').val() == 'fast-cgi' || jQuery('#php').val() == 'php-fpm'){
+ jQuery('.fastcgi_php_version:hidden').show();
+ } else {
+ jQuery('.fastcgi_php_version:visible').hide();
+ }
+ //resetFormChanged();
+
+ jQuery('#php').change(function(){
+ reloadFastcgiPHPVersions();
+ if(jQuery(this).val() == 'fast-cgi' || jQuery(this).val() == 'php-fpm'){
+ jQuery('.fastcgi_php_version:hidden').show();
+ } else {
+ jQuery('.fastcgi_php_version:visible').hide();
+ }
+ });
+
+ 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();
+ } else {
+ 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();
+ }
+ });
+ }
+
+ function reloadWebIP() {
+ loadOptionInto('ip_address','sites/ajax_get_ip.php?ip_type=IPv4&server_id='+serverId+'&client_group_id='+clientGroupId);
+ loadOptionInto('ipv6_address','sites/ajax_get_ip.php?ip_type=IPv6&server_id='+serverId+'&client_group_id='+clientGroupId);
+ }
+
+ 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", client_group_id : clientGroupId}, function(data) {
+ var options = '<option value="">Default</option>';
+ var phpfastcgiselected = '';
+ $.each(data, function(key, val) {
+ if($('#fastcgi_php_version').val() == key){
+ phpfastcgiselected = ' selected="selected"';
+ } else {
+ phpfastcgiselected = '';
+ }
+ options += '<option value="'+key+'"'+phpfastcgiselected+'>'+val+'</option>';
+ });
+ $('#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').bind('click mousedown', function(e) { e.preventDefault(); }).focus(function() { $(this).blur(); });
+ jQuery('#dom-edit-submit').click(function() {
+ submitForm('pageForm','sites/web_domain_edit.php');
+ });
+ <tmpl_else>
+ jQuery('#dom-edit-submit').click(function() {
+ submitForm('pageForm','sites/web_domain_edit.php');
+ });
+ </tmpl_if>
+
+</script>
\ No newline at end of file
--
Gitblit v1.9.1