directive_snippets_edit.htm 3.16 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
<h2><tmpl_var name="list_head_txt"></h2>
<p><tmpl_var name="list_desc_txt"></p>

<div class="panel panel_directive_snippets">
  
    <div class="pnl_formsarea">
        <fieldset class="inlineLabels">
            <div class="ctrlHolder">
                <label for="name">{tmpl_var name='name_txt'}</label>
                <input name="name" id="name" value="{tmpl_var name='name'}" size="30" maxlength="255" type="text" class="textInput" />
            </div>
			<div class="ctrlHolder">
                <label for="type">{tmpl_var name='type_txt'}</label>
                <select name="type" id="type" class="selectInput">
                    {tmpl_var name='type'}
                </select>
            </div>
			<div class="ctrlHolder">
                <label for="snippet">{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 22 23 24 25 26
            </div>
			<div class="ctrlHolder">
                <p class="label">{tmpl_var name='customer_viewable_txt'}</p>
                <div class="multiField">
                    {tmpl_var name='customer_viewable'}
                </div>
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
            </div>
            <div class="ctrlHolder">
                <p class="label">{tmpl_var name='active_txt'}</p>
                <div class="multiField">
                    {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','admin/directive_snippets_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('admin/directive_snippets_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button>
        </div>
    </div>
  
44 45 46 47 48 49 50 51
</div>
<script language="JavaScript" type="text/javascript">
		
    if(jQuery('#type').val() == 'nginx'){
        jQuery('.nginx:hidden').show();
    } else {
        jQuery('.nginx:visible').hide();
    }
52 53 54 55 56 57
	
	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();
	}
58 59
    
    jQuery('#type').change(function(){
60 61 62 63 64
		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();
		}
65 66 67 68 69 70 71 72
        if(jQuery(this).val() == 'nginx'){
            jQuery('.nginx:hidden').show();
        } else {
            jQuery('.nginx:visible').hide();
        }
    });
			
</script>