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