*finally* seems to be working under Mason. sheesh.
[freeside.git] / httemplate / config / config.cgi
1 <!-- mason kludge -->
2 <%= header('Edit Configuration', menubar( 'Main Menu' => $p ) ) %>
3
4 <% my $conf = new FS::Conf; my @config_items = $conf->config_items; %>
5
6 <form action="config-process.cgi" METHOD="POST">
7
8 <% foreach my $section ( qw(required billing username password UI session
9                             shell mail radius apache BIND
10                            ),
11                          '', 'depreciated') { %>
12   <%= table("#cccccc", 2) %>
13   <tr>
14     <th colspan="2" bgcolor="#dcdcdc">
15       <%= ucfirst($section || 'unclassified') %> configuration options
16     </th>
17   </tr>
18   <% foreach my $i (grep $_->section eq $section, @config_items) { %>
19     <tr>
20       <td>
21         <% my $n = 0;
22            foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) {
23              #warn $i->key unless defined($type);
24         %>
25           <% if ( $type eq '' ) { %>
26             <font color="#ff0000">no type</font>
27           <% } elsif ( $type eq 'textarea' ) { %>
28             <textarea name="<%= $i->key. $n %>" rows=5><%= join("\n", $conf->config($i->key) ) %></textarea>
29           <% } elsif ( $type eq 'checkbox' ) { %>
30             <input name="<%= $i->key. $n %>" type="checkbox" value="1"<%= $conf->exists($i->key) ? ' CHECKED' : '' %>>
31           <% } elsif ( $type eq 'text' )  { %>
32             <input name="<%= $i->key. $n %>" type="<%= $type %>" value="<%= $conf->exists($i->key) ? $conf->config($i->key) : '' %>">
33           <% } else { %>
34             <font color="#ff0000">unknown type <%= $type %></font>
35           <% } %>
36         <% $n++; } %>
37       </td>
38       <td><a name="<%= $i->key %>">
39         <b><%= $i->key %></b> - <%= $i->description %>
40       </a></td>
41     </tr>
42   <% } %>
43   </table><br><br>
44 <% } %>
45
46 You may need to restart Apache and/or freeside-queued for configuration
47 changes to take effect.<BR>
48
49 <input type="submit" value="Apply changes">
50 </form>
51
52 </body></html>