- <% foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) {
- my $n = 0; %>
- <% if ( $type eq '' ) { %>
- <tr><td><font color="#ff0000">no type</font></td></tr>
- <% } elsif ( $type eq 'textarea' ) { %>
- <tr><td bgcolor="#ffffff">
-<pre>
-<%= encode_entities(join("\n", $conf->config($i->key) ) ) %>
-</pre>
- </td></tr>
- <% } elsif ( $type eq 'checkbox' ) { %>
- <tr><td bgcolor="#<%= $conf->exists($i->key) ? '00ff00">YES' : 'ff0000">NO' %></td></tr>
- <% } elsif ( $type eq 'text' ) { %>
- <tr><td bgcolor="#ffffff"><%= $conf->exists($i->key) ? $conf->config($i->key) : '' %></td></tr>
- <% } else { %>
+
+% my $n = 0;
+% foreach my $type (@types) {
+
+% if ( $type eq '' ) {
+
+ <tr>
+ <td><font color="#ff0000">no type</font></td>
+ </tr>
+% } elsif ( $type eq 'binary' ) {
+
+ <tr>
+ <% $conf->exists($i->key, $agentnum)
+ ? qq!<a href="config-download.cgi?key=!. $i->key. ';agentnum='. $agentnum. qq!">download</a>!
+ : 'empty'
+ %>
+ </tr>
+
+% } elsif ( $type eq 'textarea'
+% || $type eq 'editlist'
+% || $type eq 'selectmultiple' ) {
+
+ <tr>
+ <td id="<% $i->key.$n %>" bgcolor="#ffffff">
+<font size="-2"><pre>
+<% encode_entities(join("\n",
+ map { length($_) > 88 ? substr($_,0,88).'...' : $_ }
+ $conf->config($i->key, $agentnum)
+ ) )
+%>
+</pre></font>
+ </td>
+ </tr>
+% } elsif ( $type eq 'checkbox' ) {
+
+ <tr>
+ <td id="<% $i->key.$n %>" bgcolor="#<% $conf->exists($i->key, $agentnum) ? '00ff00">YES' : 'ff0000">NO' %></td>
+ </tr>
+% } elsif ( $type eq 'text' || $type eq 'select' ) {
+
+ <tr>
+ <td id="<% $i->key.$n %>" bgcolor="#ffffff">
+ <% $conf->exists($i->key, $agentnum) ? $conf->config($i->key, $agentnum) : '' %>
+ </td></tr>
+% } elsif ( $type eq 'select-sub' ) {
+
+ <tr>
+ <td id="<% $i->key.$n %>" bgcolor="#ffffff">
+ <% $conf->config($i->key, $agentnum) %>:
+ <% &{ $i->option_sub }( $conf->config($i->key, $agentnum) ) %>
+ </td>
+ </tr>
+% } else {
+