directive_snippets_edit.htm 3.25 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

        
            <div class="form-group">
                <label for="name" class="col-sm-3 control-label">{tmpl_var name='name_txt'}</label>
Marius Cramer's avatar
Marius Cramer committed
10
                <div class="col-sm-9"><input type="text" name="name" id="name" value="{tmpl_var name='name'}" class="form-control" /></div></div>
11 12 13
			<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">
14 15
                    {tmpl_var name='type'}
                </select>
16 17 18
            </div></div>
			<div class="form-group">
                <label for="snippet" class="col-sm-3 control-label">{tmpl_var name='snippet_txt'}</label>
Marius Cramer's avatar
Marius Cramer committed
19
                <div class="col-sm-9"><textarea class="form-control" name="snippet" id="snippet" rows='10' cols='50' style="width:400px;">{tmpl_var name='snippet'}</textarea></div><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>
20
            </div>
21 22 23
			<div class="form-group">
                <label class="col-sm-3 control-label">{tmpl_var name='customer_viewable_txt'}</label>
                <div class="col-sm-9">
24 25
                    {tmpl_var name='customer_viewable'}
                </div>
26
            </div>
27 28 29
            <div class="form-group">
                <label class="col-sm-3 control-label">{tmpl_var name='active_txt'}</label>
                <div class="col-sm-9">
30 31 32
                    {tmpl_var name='active'}
                </div>
            </div>
33
        
34 35 36
            
        <input type="hidden" name="id" value="{tmpl_var name='id'}">
            
37
        <div class="clear"><div class="right">
Marius Cramer's avatar
Marius Cramer committed
38 39
            <button class="btn btn-default formbutton-success" 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="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="admin/directive_snippets_list.php">{tmpl_var name='btn_cancel_txt'}</button>
40
        </div></div>
41 42 43 44 45 46 47
<script language="JavaScript" type="text/javascript">
		
    if(jQuery('#type').val() == 'nginx'){
        jQuery('.nginx:hidden').show();
    } else {
        jQuery('.nginx:visible').hide();
    }
48 49 50 51 52 53
	
	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();
	}
54 55
    
    jQuery('#type').change(function(){
56 57 58 59 60
		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();
		}
61 62 63 64 65 66 67 68
        if(jQuery(this).val() == 'nginx'){
            jQuery('.nginx:hidden').show();
        } else {
            jQuery('.nginx:visible').hide();
        }
    });
			
</script>