Nicer descriptions for proxy

This commit is contained in:
Jamie Cameron
2008-08-23 07:21:27 +00:00
parent b5da9ee4d6
commit 94fd37925b
6 changed files with 15 additions and 9 deletions

View File

@@ -1005,18 +1005,27 @@ else { return $_[1] ? "*" : $text{'default_serv'}; }
}
# dir_name(struct)
# Given a <directory> or similar structure, return a human-readable description
sub dir_name
{
local($dfm, $mat);
$_[0]->{'name'} =~ /^(Directory|Files|Location)(Match)?$/;
$dfm = $1; $mat = $2;
if ($mat) {
$_[0]->{'name'} =~ /^(Directory|Files|Location|Proxy)(Match)?$/;
my ($dfm, $mat) = ($1, $2);
if ($dfm eq "Proxy" && !$mat && $_[0]->{'words'}->[0] eq "*") {
# Proxy for all
return $text{'dir_proxyall'};
}
elsif ($mat) {
# Match-type directive
return "$dfm regexp <tt>".&html_escape($_[0]->{'words'}->[0])."</tt>";
}
elsif ($_[0]->{'words'}->[0] eq "~") {
# Regular expression
return "$dfm regexp <tt>".&html_escape($_[0]->{'words'}->[1])."</tt>";
}
else { return "$dfm <tt>".&html_escape($_[0]->{'words'}->[0])."</tt>"; }
else {
# Exact match
return "$dfm <tt>".&html_escape($_[0]->{'words'}->[0])."</tt>";
}
}
# list_user_file(file, &user, &pass)

View File

@@ -11,7 +11,6 @@ $desc = &text('dir_header', &dir_name($d), &virtual_name($v));
&ui_print_header($desc, $text{'dir_title'}, "",
undef, undef, undef, undef, &restart_button());
print &ui_subheading($text{'dir_title'});
$sw_icon = { "icon" => "images/show.gif",
"name" => $text{'dir_show'},
"link" => "show.cgi?virt=$in{'virt'}&idx=$in{'idx'}" };

View File

@@ -12,7 +12,6 @@ $d = $conf->[$in{'idx'}];
$desc = &text('htfile_header', &dir_name($d), "<tt>$in{'file'}</tt>");
&ui_print_header($desc, $text{'htfile_title'}, "");
print "<h3>$text{'htfile_title'}</h3>\n";
$sw_icon = { "icon" => "images/show.gif",
"name" => $text{'htfile_show'},
"link" => "show.cgi?file=".&urlize($in{'file'})."&idx=$in{'idx'}" };

View File

@@ -13,7 +13,6 @@ $desc = &html_escape($in{'file'});
undef, undef, undef, undef, "<a href=\"delete_htaccess.cgi?file=".
&urlize($in{'file'})."\">$text{'htindex_delete'}</a>");
print &ui_subheading($text{'htindex_opts'});
$sw_icon = { "icon" => "images/show.gif",
"name" => $text{'htindex_show'},
"link" => "show.cgi?file=".&urlize($in{'file'}) };

View File

@@ -158,6 +158,7 @@ manual_editfile=Edit config file:
manual_switch=Edit
dir_title=Per-Directory Options
dir_proxyall=All proxy requests
dir_header=For $1 on $2
dir_show=Show Directives
dir_edit=Edit Directives

View File

@@ -10,7 +10,6 @@ $desc = &text('virt_header', &virtual_name($v));
&ui_print_header($desc, $text{'virt_title'}, "", undef, undef, undef, undef, &restart_button());
# Display header and icons
print &ui_subheading($text{'virt_opts2'});
$sw_icon = { "icon" => "images/show.gif",
"name" => $text{'virt_show'},
"link" => "show.cgi?virt=$in{'virt'}" };