directive_snippets_edit.htm 3.22 KB
Newer Older
1 2 3
<div class='page-header'>
	<h1><tmpl_var name="list_head_txt"></h1>
</div>
4 5
<p><tmpl_var name="list_desc_txt"></p>

6 7 8 9 10 11 12 13 14

        
            <div class="form-group">
                <label for="name" class="col-sm-3 control-label">{tmpl_var name='name_txt'}</label>
                <div class="col-sm-9"><input type="text" name="name" id="name" value="{tmpl_var name='name'}" class="form-control" />
            </div></div>
			<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">
15 16
                    {tmpl_var name='type'}
                </select>
17 18 19
            </div></div>
			<div class="form-group">
                <label for="snippet" class="col-sm-3 control-label">{tmpl_var name='snippet_txt'}</label>
20
                <textarea name="snippet" id="snippet" rows='10' cols='50' style="width:400px;">{tmpl_var name='snippet'}</textarea><span class="nginx"> &nbsp; {tmpl_var name='variables_txt'}: </span><a href="javascript:void(0);" class="addPlaceholder nginx">{DOCROOT}</a><span class="nginx">, </span><a href="javascript:void(0);" class="addPlaceholder nginx">{FASTCGIPASS}</a>
21
            </div>
22 23 24
			<div class="form-group">
                <label class="col-sm-3 control-label">{tmpl_var name='customer_viewable_txt'}</label>
                <div class="col-sm-9">
25 26
                    {tmpl_var name='customer_viewable'}
                </div>
27
            </div>
28 29 30
            <div class="form-group">
                <label class="col-sm-3 control-label">{tmpl_var name='active_txt'}</label>
                <div class="col-sm-9">
31 32 33
                    {tmpl_var name='active'}
                </div>
            </div>
34
        
35 36 37
            
        <input type="hidden" name="id" value="{tmpl_var name='id'}">
            
38 39 40 41
        <div class="clear"><div class="right">
            <button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_save_txt'}" onclick="submitForm('pageForm','admin/directive_snippets_edit.php');">{tmpl_var name='btn_save_txt'}</button>
            <button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="admin/directive_snippets_list.php"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
        </div></div>
42 43 44 45 46 47 48
<script language="JavaScript" type="text/javascript">
		
    if(jQuery('#type').val() == 'nginx'){
        jQuery('.nginx:hidden').show();
    } else {
        jQuery('.nginx:visible').hide();
    }
49 50 51 52 53 54
	
	if (jQuery('#type').val() != 'nginx' && jQuery('#type').val() != 'apache') {
		jQuery('#customer_viewable').closest('div.ctrlHolder:visible').hide();
	}else {
		jQuery('#customer_viewable').closest('div.ctrlHolder:hidden').show();
	}
55 56
    
    jQuery('#type').change(function(){
57 58 59 60 61
		if (jQuery(this).val() != 'nginx' && jQuery(this).val() != 'apache') {
			jQuery('#customer_viewable').closest('div.ctrlHolder:visible').hide();
		} else {
			jQuery('#customer_viewable').closest('div.ctrlHolder:hidden').show();
		}
62 63 64 65 66 67 68 69
        if(jQuery(this).val() == 'nginx'){
            jQuery('.nginx:hidden').show();
        } else {
            jQuery('.nginx:visible').hide();
        }
    });
			
</script>