Commit c02d3f04 authored by Falko Timme's avatar Falko Timme
Browse files

- nginx: added {DOCROOT} and {FASTCGIPASS} placeholders to directive snippets...

- nginx: added {DOCROOT} and {FASTCGIPASS} placeholders to directive snippets and nginx Directives fields.
parent 5308a8f9
......@@ -6,4 +6,5 @@ $wb['snippet_txt'] = 'Schnipsel';
$wb['active_txt'] = 'Aktiv';
$wb['directive_snippets_name_empty'] = 'Bitte geben Sie einen Namen für den Schnipsel an.';
$wb['directive_snippets_name_error_unique'] = 'Es existiert schon ein Direktiven-Schnipsel mit diesem Namen.';
$wb['variables_txt'] = 'Variablen';
?>
\ No newline at end of file
......@@ -6,4 +6,5 @@ $wb["snippet_txt"] = 'Snippet';
$wb["active_txt"] = 'Active';
$wb["directive_snippets_name_empty"] = 'Please specify a name for the snippet.';
$wb["directive_snippets_name_error_unique"] = 'There is already a directive snippet with this name.';
$wb['variables_txt'] = 'Variables';
?>
\ No newline at end of file
......@@ -17,7 +17,7 @@
</div>
<div class="ctrlHolder">
<label for="snippet">{tmpl_var name='snippet_txt'}</label>
<textarea name="snippet" id="snippet" rows='10' cols='50' style="width:400px;">{tmpl_var name='snippet'}</textarea>
<textarea name="snippet" id="snippet" rows='10' cols='50' style="width:400px;">{tmpl_var name='snippet'}</textarea><div class="nginx"> &nbsp; {tmpl_var name='variables_txt'}: <a href="javascript:void(0);" class="addPlaceholder">{DOCROOT}</a>, <a href="javascript:void(0);" class="addPlaceholder">{FASTCGIPASS}</a></div>
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='active_txt'}</p>
......@@ -35,4 +35,21 @@
</div>
</div>
</div>
\ No newline at end of file
</div>
<script language="JavaScript" type="text/javascript">
if(jQuery('#type').val() == 'nginx'){
jQuery('.nginx:hidden').show();
} else {
jQuery('.nginx:visible').hide();
}
jQuery('#type').change(function(){
if(jQuery(this).val() == 'nginx'){
jQuery('.nginx:hidden').show();
} else {
jQuery('.nginx:visible').hide();
}
});
</script>
\ No newline at end of file
......@@ -120,4 +120,5 @@ $wb['rewrite_rules_txt'] = 'Rewrite Rules';
$wb['invalid_rewrite_rules_txt'] = 'Unzulässige Rewrite Rules';
$wb['allowed_rewrite_rule_directives_txt'] = 'Erlaubte Direktiven:';
$wb['configuration_error_txt'] = 'KONFIGURATIONSFEHLER';
$wb['variables_txt'] = 'Variablen';
?>
\ No newline at end of file
......@@ -120,4 +120,5 @@ $wb['rewrite_rules_txt'] = 'Rewrite Rules';
$wb['invalid_rewrite_rules_txt'] = 'Invalid Rewrite Rules';
$wb['allowed_rewrite_rule_directives_txt'] = 'Allowed Directives:';
$wb['configuration_error_txt'] = "CONFIGURATION ERROR";
$wb['variables_txt'] = 'Variables';
?>
\ No newline at end of file
......@@ -84,7 +84,7 @@
</div>
<div class="ctrlHolder nginx">
<label for="nginx_directives">{tmpl_var name='nginx_directives_txt'}</label>
<textarea name="nginx_directives" id="nginx_directives" rows='10' cols='50' style="width:400px;">{tmpl_var name='nginx_directives'}</textarea>&nbsp;<b>{tmpl_var name="available_nginx_directive_snippets_txt"}</b><br><br>&nbsp;{tmpl_var name="nginx_directive_snippets_txt"}
<textarea name="nginx_directives" id="nginx_directives" rows='10' cols='50' style="width:400px;">{tmpl_var name='nginx_directives'}</textarea>&nbsp;<b>{tmpl_var name="available_nginx_directive_snippets_txt"}</b><br><br>&nbsp;{tmpl_var name="nginx_directive_snippets_txt"}<br>----<br><b>&nbsp;{tmpl_var name='variables_txt'}:</b> <a href="javascript:void(0);" class="addPlaceholder">{DOCROOT}</a>, <a href="javascript:void(0);" class="addPlaceholder">{FASTCGIPASS}</a>
</div>
<div class="ctrlHolder proxy">
<label for="proxy_directives">{tmpl_var name='proxy_directives_txt'}</label>
......
......@@ -1041,8 +1041,9 @@ class nginx_plugin {
$nginx_directives = str_replace("\r", "\n", $nginx_directives);
$nginx_directive_lines = explode("\n", $nginx_directives);
if(is_array($nginx_directive_lines) && !empty($nginx_directive_lines)){
$trans = array('{DOCROOT}' => $vhost_data['web_document_root_www'], '{FASTCGIPASS}' => 'fastcgi_pass '.($data['new']['php_fpm_use_socket'] == 'y'? 'unix:'.$fpm_socket : '127.0.0.1:'.$vhost_data['fpm_port']).';');
foreach($nginx_directive_lines as $nginx_directive_line){
$final_nginx_directives[] = array('nginx_directive' => $nginx_directive_line);
$final_nginx_directives[] = array('nginx_directive' => strtr($nginx_directive_line, $trans));
}
}
$tpl->setLoop('nginx_directives', $final_nginx_directives);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment