Marius Burkard
2016-04-20 4569cae57f127afd093794310ccd290d2d9fdf36
interface/web/sites/templates/database_edit.htm
@@ -1,102 +1,146 @@
<h2><tmpl_var name="list_head_txt"></h2>
<div class='page-header'>
   <h1><tmpl_var name="list_head_txt"></h1>
</div>
<p><tmpl_var name="list_desc_txt"></p>
<div class="panel panel_database">
    <div class="pnl_formsarea">
        <fieldset class="inlineLabels">
            <tmpl_if name="is_admin">
                <div class="ctrlHolder">
                <div class="form-group">
                    <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">
                        <label for="server_id_disabled" class="col-sm-3 control-label">{tmpl_var name='server_id_txt'}</label>
                        <div class="col-sm-9"><select name="server_id_disabled" id="server_id_disabled" class="form-control" disabled="disabled">
                            {tmpl_var name='server_id'}
                        </select>
                        </select></div>
                        <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">
                            <label for="server_id" class="col-sm-3 control-label">{tmpl_var name='server_id_txt'}</label>
                            <div class="col-sm-9"><select name="server_id" id="server_id" class="form-control">
                                {tmpl_var name='server_id'}
                            </select>
                            </select></div>
                    </tmpl_if>
                </div>
            </tmpl_if>
            <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="type">{tmpl_var name='type_txt'}</label>
                <select name="type" id="type" class="selectInput formLengthHalf">
                    {tmpl_var name='type'}
                </select>
            </div>
            <div class="ctrlHolder">
                <label for="database_name">{tmpl_var name='database_name_txt'}</label>
                <p class="prefix">{tmpl_var name='database_name_prefix'}</p>
                <tmpl_if name="edit_disabled">
                    <input name="database_name" id="database_name" value="{tmpl_var name='database_name'}" size="30" maxlength="255" type="text" class="textInput formLengthHalf" disabled="disabled" />
                    <input name="database_name" type="hidden" value="{tmpl_var name='database_name'}" />
                    <tmpl_else>
                        <input name="database_name" id="database_name" value="{tmpl_var name='database_name'}" size="30" maxlength="255" type="text" class="textInput formLengthHalf" />
            <tmpl_else>
                <tmpl_if name="only_one_server">
                    <input type="hidden" id="server_id" name="server_id" value="{tmpl_var name='server_id_value'}" />
                <tmpl_else>
                    <div class="form-group">
                        <tmpl_if name="edit_disabled">
                            <label for="server_id_disabled" class="col-sm-3 control-label">{tmpl_var name='server_id_txt'}</label>
                            <div class="col-sm-9"><select name="server_id_disabled" id="server_id_disabled" class="form-control" disabled="disabled">
                                {tmpl_var name='server_id'}
                            </select></div>
                            <input type="hidden" name="server_id" value="{tmpl_var name='server_id_value'}" />
                            <tmpl_else>
                                <label for="server_id" class="col-sm-3 control-label">{tmpl_var name='server_id_txt'}</label>
                                <div class="col-sm-9"><select name="server_id" id="server_id" class="form-control">
                                    {tmpl_var name='server_id'}
                                </select></div>
                        </tmpl_if>
                    </div>
                </tmpl_if>
            </tmpl_if>
            <div class="form-group">
                <label for="parent_domain_id" class="col-sm-3 control-label">{tmpl_var name='parent_domain_id_txt'}</label>
                <div class="col-sm-9"><select name="parent_domain_id" id="parent_domain_id" class="form-control">
                    {tmpl_var name='parent_domain_id'}
                </select></div>
            </div>
            <div class="ctrlHolder">
                <label for="database_user_id">{tmpl_var name='database_user_txt'}</label>
                <select name="database_user_id" id="database_user_id" class="selectInput">
            <div class="form-group">
                <label for="type" class="col-sm-3 control-label">{tmpl_var name='type_txt'}</label>
                <div class="col-sm-9"><select name="type" id="type" class="form-control">
                    {tmpl_var name='type'}
                </select></div>
            </div>
         <div class="form-group">
                <label for="database_name" class="col-sm-3 control-label">{tmpl_var name='database_name_txt'}</label>
                <div class="col-sm-9">
               <div class="input-group">
                  <span class="input-group-addon" id="database_name-desc">{tmpl_var name='database_name_prefix'}</span>
                  <tmpl_if name="edit_disabled">
                  <input type="text" name="database_name" id="database_name" value="{tmpl_var name='database_name'}" class="form-control" disabled="disabled" /><input name="database_name" type="hidden" value="{tmpl_var name='database_name'}" />
                  <tmpl_else>
                  <input type="text" name="database_name" id="database_name" value="{tmpl_var name='database_name'}" class="form-control" aria-describedby="database_name-desc" />
                  </tmpl_if>
               </div>
            </div>
            </div>
         <div class="form-group">
                <label for="database_quota" class="col-sm-3 control-label">{tmpl_var name='limit_database_quota_txt'}</label>
                <div class="col-sm-9"><div class="input-group"><input type="text" name="database_quota" id="quota" value="{tmpl_var name='database_quota'}" class="form-control" aria-describedby="database_quota-desc" /><span class="input-group-addon" id="database_quota-desc">MB</span></div></div>
            </div>
            <div class="form-group">
                <label for="database_user_id" class="col-sm-3 control-label">{tmpl_var name='database_user_txt'}</label>
                <div class="col-sm-9"><select name="database_user_id" id="database_user_id" class="form-control">
                    {tmpl_var name='database_user_id'}
                </select>
                </select></div>
            </div>
            <div class="ctrlHolder">
                <label for="database_ro_user_id">{tmpl_var name='database_ro_user_txt'}</label>
                <select name="database_ro_user_id" id="database_ro_user_id" class="selectInput">
            <div class="form-group">
                <label for="database_ro_user_id" class="col-sm-3 control-label">{tmpl_var name='database_ro_user_txt'}</label>
                <div class="col-sm-9"><select name="database_ro_user_id" id="database_ro_user_id" class="form-control" aria-describedby="database_ro_user_id-help">
                    {tmpl_var name='database_ro_user_id'}
                </select>&nbsp;{tmpl_var name='optional_txt'}
                </select>
            <span id="database_ro_user_id-help" class="help-block">{tmpl_var name='optional_txt'}</span>
            </div>
            </div>
            <div class="ctrlHolder">
            <div class="form-group">
                <tmpl_if name="edit_disabled">
                    <label for="database_charset_disabled">{tmpl_var name='database_charset_txt'}</label>
                    <select name="database_charset_disabled" id="database_charset_disabled" class="selectInput formLengthHalf" disabled="disabled">
                    <label for="database_charset_disabled" class="col-sm-3 control-label">{tmpl_var name='database_charset_txt'}</label>
                    <div class="col-sm-9"><select name="database_charset_disabled" id="database_charset_disabled" class="form-control" disabled="disabled">
                        {tmpl_var name='database_charset'}
                    </select>
                    </select></div>
                    <input type="hidden" name="database_charset" value="{tmpl_var name='database_charset_value'}" />
                    <tmpl_else>
                        <label for="database_charset">{tmpl_var name='database_charset_txt'}</label>
                        <select name="database_charset" id="database_charset" class="selectInput formLengthHalf">
                        <label for="database_charset" class="col-sm-3 control-label">{tmpl_var name='database_charset_txt'}</label>
                        <div class="col-sm-9"><select name="database_charset" id="database_charset" class="form-control">
                            {tmpl_var name='database_charset'}
                        </select>
                        </select></div>
                </tmpl_if>
            </div>
            <div class="ctrlHolder">
                <p class="label">{tmpl_var name='remote_access_txt'}</p>
                <div class="multiField">
            <div class="form-group">
                <label class="col-sm-3 control-label">{tmpl_var name='remote_access_txt'}</label>
                <div class="col-sm-9">
                    {tmpl_var name='remote_access'}
                </div>
            </div>
            <div class="ctrlHolder">
                <label for="remote_ips">{tmpl_var name='remote_ips_txt'}</label>
                <input name="remote_ips" id="remote_ips" value="{tmpl_var name='remote_ips'}" size="60" type="text" class="textInput formLengthHalf" />
            </div>
            <div class="ctrlHolder">
                <p class="label">{tmpl_var name='active_txt'}</p>
                <div class="multiField">
            <div class="form-group">
                <label for="remote_ips" class="col-sm-3 control-label">{tmpl_var name='remote_ips_txt'}</label>
                <div class="col-sm-9"><input type="text" name="remote_ips" id="remote_ips" value="{tmpl_var name='remote_ips'}" class="form-control" /></div></div>
            <div class="form-group">
                <label class="col-sm-3 control-label">{tmpl_var name='active_txt'}</label>
                <div class="col-sm-9">
                    {tmpl_var name='active'}
                </div>
            </div>
        </fieldset>
        <input type="hidden" name="id" value="{tmpl_var name='id'}">
        <div class="buttonHolder buttons">
            <button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','sites/database_edit.php');"><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/database_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
        </div>
    </div>
</div>
        <div class="clear"><div class="right">
            <button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="sites/database_edit.php">{tmpl_var name='btn_save_txt'}</button>
            <button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="sites/database_list.php">{tmpl_var name='btn_cancel_txt'}</button>
        </div></div>
<script language="JavaScript" type="text/javascript">
    <tmpl_if name="is_admin">
    function reloadDatabaseUsers() {
        var parentDomainId = jQuery('#parent_domain_id').val()
        jQuery.getJSON('sites/ajax_get_json.php'+ '?' + Math.round(new Date().getTime()), {web_id : parentDomainId, 'type': 'getdatabaseusers'}, function(data) {
            var options = '<option value=""></option>';
            $.each(data, function(key, val) {
                options += '<option value="'+key+'"'+ ($('#database_user_id').val() == key ? ' selected="selected"' : '') +'>'+val+'</option>';
            });
            $('#database_user_id').html(options).change();
            options = '<option value=""></option>';
            $.each(data, function(key, val) {
                options += '<option value="'+key+'"'+ ($('#database_ro_user_id').val() == key ? ' selected="selected"' : '') +'>'+val+'</option>';
            });
            $('#database_ro_user_id').html(options).change();
        });
    }
    jQuery('#parent_domain_id').change(function() { reloadDatabaseUsers(); });
    reloadDatabaseUsers();
    </tmpl_if>
    jQuery('#remote_ips').ispconfigSearch({
        dataSrc: '/sites/ajax_get_json.php?type=get_ipv4',
        resultsLimit: '$ <tmpl_var name="globalsearch_resultslimit_of_txt"> % <tmpl_var name="globalsearch_resultslimit_results_txt">',
@@ -108,6 +152,6 @@
        fillSearchField: true,
        fillSearchFieldWith: 'fill_text',
        searchFieldWatermark: '',
        resultBoxPosition: 'e'
        resultBoxPosition: ''
    });
</script>
</script>