directive_snippets_edit.htm 4.09 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>
10 11
                <tmpl_if name='is_master'><div class="col-sm-9 col-text">{tmpl_var name='name'}</div></tmpl_else><div class="col-sm-9"><input type="text" name="name" id="name" value="{tmpl_var name='name'}" class="form-control" /></div></tmpl_if>
            </div>
12 13
			<div class="form-group">
                <label for="type" class="col-sm-3 control-label">{tmpl_var name='type_txt'}</label>
14
                <tmpl_if name='is_master'><div class="col-sm-9 col-text">{tmpl_var name='type'}</div></tmpl_else><div class="col-sm-9"><select name="type" id="type" class="form-control">
15
                    {tmpl_var name='type'}
16
                </select></div></tmpl_if>
17
            </div>
18 19
			<div class="form-group">
                <label for="snippet" class="col-sm-3 control-label">{tmpl_var name='snippet_txt'}</label>
Till Brehm's avatar
Till Brehm committed
20 21
                <tmpl_if name='is_master'><div class="col-sm-9 col-text"><pre>{tmpl_var name='snippet'}</pre></div></tmpl_else><div class="col-sm-9"><textarea class="form-control" name="snippet" id="snippet" rows='10' cols='50'>{tmpl_var name='snippet'}</textarea>
                &nbsp; Nginx {tmpl_var name='variables_txt'}: <a href="javascript:void(0);" class="addPlaceholder">{DOCROOT}</a>, <a href="javascript:void(0);" class="addPlaceholder">{FASTCGIPASS}</a>, <a href="javascript:void(0);" class="addPlaceholder">{PHPFALLBACKFASTCGIPASS}</a></div></tmpl_if>
Marius Cramer's avatar
Marius Cramer committed
22
            </div>
23
            <tmpl_if name='is_master'></tmpl_else>
Marius Cramer's avatar
Marius Cramer committed
24 25 26 27 28
			<div class="form-group php">
                <label class="col-sm-3 control-label">{tmpl_var name='required_php_snippets_txt'}</label>
                <div class="col-sm-9">
                    {tmpl_var name='required_php_snippets'}
                </div>
29
            </div>
30
            </tmpl_if>
31 32 33
			<div class="form-group">
                <label class="col-sm-3 control-label">{tmpl_var name='customer_viewable_txt'}</label>
                <div class="col-sm-9">
34 35
                    {tmpl_var name='customer_viewable'}
                </div>
36
            </div>
37 38 39
            <div class="form-group">
                <label class="col-sm-3 control-label">{tmpl_var name='active_txt'}</label>
                <div class="col-sm-9">
40 41 42
                    {tmpl_var name='active'}
                </div>
            </div>
43
        
44 45 46
            
        <input type="hidden" name="id" value="{tmpl_var name='id'}">
            
47
        <div class="clear"><div class="right">
Marius Cramer's avatar
Marius Cramer committed
48
            <button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="admin/directive_snippets_edit.php">{tmpl_var name='btn_save_txt'}</button>
Marius Cramer's avatar
Marius Cramer committed
49
            <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>
50
        </div></div>
51 52 53 54 55 56 57
<script language="JavaScript" type="text/javascript">
		
    if(jQuery('#type').val() == 'nginx'){
        jQuery('.nginx:hidden').show();
    } else {
        jQuery('.nginx:visible').hide();
    }
58 59 60
	
	if (jQuery('#type').val() != 'nginx' && jQuery('#type').val() != 'apache') {
		jQuery('#customer_viewable').closest('div.ctrlHolder:visible').hide();
Marius Cramer's avatar
Marius Cramer committed
61 62
		jQuery('.php:visible').hide();
	} else {
63
		jQuery('#customer_viewable').closest('div.ctrlHolder:hidden').show();
Marius Cramer's avatar
Marius Cramer committed
64
		jQuery('.php:hidden').show();
65
	}
66 67
    
    jQuery('#type').change(function(){
68 69
		if (jQuery(this).val() != 'nginx' && jQuery(this).val() != 'apache') {
			jQuery('#customer_viewable').closest('div.ctrlHolder:visible').hide();
Marius Cramer's avatar
Marius Cramer committed
70
			jQuery('.php:visible').hide();
71 72
		} else {
			jQuery('#customer_viewable').closest('div.ctrlHolder:hidden').show();
Marius Cramer's avatar
Marius Cramer committed
73
			jQuery('.php:hidden').show();
74
		}
75 76 77 78 79 80 81 82
        if(jQuery(this).val() == 'nginx'){
            jQuery('.nginx:hidden').show();
        } else {
            jQuery('.nginx:visible').hide();
        }
    });
			
</script>