Will things ever be the same again?
[freeside.git] / httemplate / config / config-view.cgi
1 <!-- mason kludge -->
2 <% include("/elements/header.html",'View Configuration', menubar( 'Main Menu' => $p,
3                                      'Edit Configuration' => 'config.cgi' ) ) %>
4 % my $conf = new FS::Conf; my @config_items = $conf->config_items; 
5 % foreach my $section ( qw(required billing username password UI session
6 %                            shell BIND
7 %                           ),
8 %                         '', 'deprecated') { 
9
10   <A NAME="<% $section || 'unclassified' %>"></A>
11   <FONT SIZE="-2">
12 % foreach my $nav_section ( qw(required billing username password UI session
13 %                                  shell BIND
14 %                                 ),
15 %                               '', 'deprecated') { 
16 % if ( $section eq $nav_section ) { 
17
18       [<A NAME="not<% $nav_section || 'unclassified' %>" style="background-color: #cccccc"><% ucfirst($nav_section || 'unclassified') %></A>]
19 % } else { 
20
21       [<A HREF="#<% $nav_section || 'unclassified' %>"><% ucfirst($nav_section || 'unclassified') %></A>]
22 % } 
23 % } 
24
25   </FONT><BR>
26   <% table("#cccccc", 2) %>
27   <tr>
28     <th colspan="2" bgcolor="#dcdcdc">
29       <% ucfirst($section || 'unclassified') %> configuration options
30     </th>
31   </tr>
32 % foreach my $i (grep $_->section eq $section, @config_items) { 
33
34     <tr>
35       <td><a name="<% $i->key %>">
36         <b><% $i->key %></b>&nbsp;-&nbsp;<% $i->description %>
37       </a></td>
38       <td><table border=0>
39 % foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) {
40 %             my $n = 0; 
41 % if ( $type eq '' ) { 
42
43             <tr>
44               <td><font color="#ff0000">no type</font></td>
45             </tr>
46 % } elsif (   $type eq 'textarea'
47 %                      || $type eq 'editlist'
48 %                      || $type eq 'selectmultiple' ) { 
49
50             <tr>
51               <td bgcolor="#ffffff">
52 <pre>
53 <% encode_entities(join("\n", $conf->config($i->key) ) ) %>
54 </pre>
55               </td>
56             </tr>
57 % } elsif ( $type eq 'checkbox' ) { 
58
59             <tr>
60               <td bgcolor="#<% $conf->exists($i->key) ? '00ff00">YES' : 'ff0000">NO' %></td>
61             </tr>
62 % } elsif ( $type eq 'text' || $type eq 'select' )  { 
63
64             <tr>
65               <td bgcolor="#ffffff">
66                 <% $conf->exists($i->key) ? $conf->config($i->key) : '' %>
67               </td></tr>
68 % } elsif ( $type eq 'select-sub' ) { 
69
70             <tr>
71               <td bgcolor="#ffffff">
72                 <% $conf->config($i->key) %>: 
73                 <% &{ $i->option_sub }( $conf->config($i->key) ) %>
74               </td>
75             </tr>
76 % } else { 
77
78             <tr><td>
79               <font color="#ff0000">unknown type <% $type %></font>
80             </td></tr>
81 % } 
82 % $n++; } 
83
84       </table></td>
85     </tr>
86 % } 
87
88   </table><br><br>
89 % } 
90
91
92 </body></html>