From 73813a4bd2c3d3fcefecbd73416e8bb27273225f Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Fri, 24 Jan 2014 11:36:39 -0500
Subject: [PATCH] Merged domains, vhost subdomains and vhost aliasdomains into vhost domains

---
 interface/web/sites/templates/web_vhost_domain_edit.htm |   75 +++++++++++++++++++++++++++++++++++--
 1 files changed, 71 insertions(+), 4 deletions(-)

diff --git a/interface/web/sites/templates/web_domain_edit.htm b/interface/web/sites/templates/web_vhost_domain_edit.htm
similarity index 76%
rename from interface/web/sites/templates/web_domain_edit.htm
rename to interface/web/sites/templates/web_vhost_domain_edit.htm
index 2f97383..9f22ebd 100644
--- a/interface/web/sites/templates/web_domain_edit.htm
+++ b/interface/web/sites/templates/web_vhost_domain_edit.htm
@@ -14,6 +14,7 @@
 
     <div class="pnl_formsarea">
         <fieldset class="inlineLabels">
+		<tmpl_if name="vhostdomain_type" value="domain">
             <tmpl_if name="is_admin">
                 <div class="ctrlHolder">
                     <tmpl_if name="edit_disabled">
@@ -89,6 +90,60 @@
                 <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" />&nbsp;MB
             </div>
+		</tmpl_if>
+		<tmpl_if name="vhostdomain_type" value="subdomain">
+            <input type="hidden" name="server_id" id="server_id" value="{tmpl_var name='server_id_value'}" />
+            <tmpl_if name="domain_option">
+            <div class="ctrlHolder">
+                <label for="parent_domain_id">{tmpl_var name='parent_domain_id_txt'}</label>
+                <select id="parent_domain_id" name="parent_domain_id" class="selectInput formLengthHalf">{tmpl_var name='parent_domain_id'}</select>
+            </div>
+            </tmpl_if>
+            <div class="ctrlHolder">
+                <label for="domain">{tmpl_var name='host_txt'}</label>
+                <input name="domain" id="domain" value="{tmpl_var name='domain'}" size="30" maxlength="255" type="text" class="textInput formLengthHalf" />
+            </div>
+            <tmpl_if name="domain_option">
+            <div class="ctrlHolder">
+                <label for="sel_domain">{tmpl_var name='domain_txt'}</label>
+                    <select name="sel_domain" id="sel_domain" class="selectInput">
+                        {tmpl_var name='domain_option'}
+                    </select>
+            </div>
+            <tmpl_else>
+            <div class="ctrlHolder">
+                <label for="parent_domain_id">{tmpl_var name='domain_txt'}</label>
+                <select id="parent_domain_id" name="parent_domain_id" class="selectInput formLengthHalf">{tmpl_var name='parent_domain_id'}</select>
+            </div>
+            </tmpl_if>
+            <div class="ctrlHolder">
+                <label for="web_folder">{tmpl_var name='web_folder_txt'}</label>
+                <input name="web_folder" id="web_folder" value="{tmpl_var name='web_folder'}" size="30" maxlength="100" type="text" class="textInput formLengthHalf"<tmpl_if name='fixed_folder' op='==' value='y'> readonly="readonly"</tmpl_if> />
+            </div>
+		</tmpl_if>
+		<tmpl_if name="vhostdomain_type" value="aliasdomain">
+            <input type="hidden" name="server_id" id="server_id" value="{tmpl_var name='server_id_value'}" />
+            <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="parent_domain_id">{tmpl_var name='parent_domain_id_txt'}</label>
+                <select name="parent_domain_id" id="parent_domain_id" class="selectInput">
+                    {tmpl_var name='parent_domain_id'}
+                </select>
+            </div>
+            <div class="ctrlHolder">
+                <label for="web_folder">{tmpl_var name='web_folder_txt'}</label>
+                <input name="web_folder" id="web_folder" value="{tmpl_var name='web_folder'}" size="30" maxlength="100" type="text" class="textInput formLengthHalf"<tmpl_if name='fixed_folder' op='==' value='y'> readonly="readonly"</tmpl_if> />
+            </div>
+		</tmpl_if>
             <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" />&nbsp;MB <tmpl_var name='traffic_quota_exceeded_txt'>
@@ -172,7 +227,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_vhost_domain_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
         </div>
     </div>
 
@@ -216,7 +271,19 @@
             jQuery('.fastcgi_php_version:visible').hide();
         }
     });
-		
+    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"){
@@ -271,11 +338,11 @@
     <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');
+               submitForm('pageForm','sites/web_vhost_domain_edit.php');
         });
     <tmpl_else>
         jQuery('#dom-edit-submit').click(function() {
-            submitForm('pageForm','sites/web_domain_edit.php');
+            submitForm('pageForm','sites/web_vhost_domain_edit.php');
         });
     </tmpl_if>
 			

--
Gitblit v1.9.1