3 # Display a menu of icons for a per-directory options file
5 require './apache-lib.pl';
7 $access{'global'} || &error($text{'htaccess_ecannot'});
8 &allowed_auth_file($in{'file'}) ||
9 &error($text{'htindex_ecannot'});
10 $conf = &get_htaccess_config($in{'file'});
11 $desc = &html_escape($in{'file'});
12 &ui_print_header($desc, $text{'htindex_title'}, "",
13 undef, undef, undef, undef, "<a href=\"delete_htaccess.cgi?file=".
14 &urlize($in{'file'})."\">$text{'htindex_delete'}</a>");
16 $sw_icon = { "icon" => "images/show.gif",
17 "name" => $text{'htindex_show'},
18 "link" => "show.cgi?file=".&urlize($in{'file'}) };
19 if ($access{'types'} eq '*') {
20 $ed_icon = { "icon" => "images/edit.gif",
21 "name" => $text{'htindex_edit'},
22 "link" => "manual_form.cgi?file=".&urlize($in{'file'}) };
24 &config_icons("htaccess", "edit_htaccess.cgi?file=".&urlize($in{'file'})."&",
25 $sw_icon, $ed_icon ? ( $ed_icon ) : ( ));
27 @file = ( &find_directive_struct("Files", $conf),
28 &find_directive_struct("FilesMatch", $conf) );
29 if (@file && $httpd_modules{'core'} >= 1.2) {
30 # Files sub-directives
32 print &ui_subheading($text{'htindex_file'});
34 $what = &dir_name($f);
35 substr($what, 0, 1) = uc(substr($what, 0, 1));
36 push(@links, "files_index.cgi?idx=".&indexof($f, @$conf).
37 "&file=".&urlize($in{'file'}));
39 push(@icons, "images/dir.gif");
40 push(@types, $f->{'name'});
42 if ($config{'show_list'}) {
44 print &ui_columns_start([ $text{'virt_path'},
45 $text{'virt_type'} ]);
46 for($i=0; $i<@links; $i++) {
47 print &ui_columns_row([
48 "<a href='$links[$i]'>$titles[$i]</a>",
49 $text{'virt_'.$types[$i]} ]);
51 print &ui_columns_end();
54 &icons_table(\@links, \@titles, \@icons, 3);
59 if ($httpd_modules{'core'} >= 1.2) {
60 print &ui_form_start("create_files.cgi");
61 print &ui_hidden("file", $in{'file'});
62 print &ui_table_start($text{'htindex_create'}, undef, 2);
64 print &ui_table_row($text{'htindex_regexp'},
65 &ui_radio("regexp", 0,
66 [ [ 0, $text{'htindex_exact'} ],
67 [ 1, $text{'htindex_re'} ] ]));
69 print &ui_table_row($text{'htindex_path'},
70 &ui_textbox("path", undef, 50));
72 print &ui_table_end();
73 print &ui_form_end([ [ undef, $text{'create'} ] ]);
76 &ui_print_footer("htaccess.cgi", $text{'htaccess_return'});