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