917cc7316cfc8df994041e19b655c0c20b543363
[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   <FONT SIZE="-2">
12   <% foreach my $nav_section ( qw(required billing username password UI session
13                                   shell mail radius apache BIND
14                                  ),
15                                '', 'deprecated') { %>
16     <% if ( $section eq $nav_section ) { %>
17       [<A NAME="not<%= $nav_section || 'unclassified' %>" style="background-color: #cccccc"><%= ucfirst($nav_section || 'unclassified') %></A>]
18     <% } else { %>
19       [<A HREF="#<%= $nav_section %>"><%= ucfirst($nav_section || 'unclassified') %></A>]
20     <% } %>
21   <% } %>
22   </FONT><BR>
23   <A NAME="<%= $section || 'unclassified' %>"></A>
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' || $type eq 'editlist' ) { %>
41             <tr><td bgcolor="#ffffff">
42 <pre>
43 <%= encode_entities(join("\n", $conf->config($i->key) ) ) %>
44 </pre>
45             </td></tr>
46           <% } elsif ( $type eq 'checkbox' ) { %>
47             <tr><td bgcolor="#<%= $conf->exists($i->key) ? '00ff00">YES' : 'ff0000">NO' %></td></tr>
48           <% } elsif ( $type eq 'text' || $type eq 'select' )  { %>
49             <tr><td bgcolor="#ffffff"><%=  $conf->exists($i->key) ? $conf->config($i->key) : '' %></td></tr>
50           <% } else { %>
51             <tr><td>
52               <font color="#ff0000">unknown type <%= $type %></font>
53             </td></tr>
54           <% } %>
55         <% $n++; } %>
56       </table></td>
57     </tr>
58   <% } %>
59   </table><br><br>
60 <% } %>
61
62 </body></html>