| <% include('/elements/popup_link.html',
                       'action'      => 'config.cgi?key='.      $i->key.
                                                  ';agentnum='. $agentnum,
                       'width'       => $width,
                       'height'      => $height,
                       'actionlabel' => 'Enter configuration value',
                       'label'       => "$label",
                       'aname'       => $i->key, #agentnum
                                                 # if $cgi->param('showagent')?
                    )
          %>: <% $i->description %>
%       if ( $agent && $cgi->param('showagent') ) {
%         my $confnum = $conf->conf( $i->key, $agent->agentnum, 1 )->confnum;
          (delete agent override)
%       } elsif ( $i->base_key
%                 || ( $deleteable{$i->key} && $conf->exists($i->key) ) ) {
%         my $confnum =
%           $agent
%             ? $conf->conf( $i->key, $agent->agentnum, 1 )->confnum
%             : $conf->conf( $i->key )->confnum;
%         my $showagent = $cgi->param('showagent') ? '_showagent' : '';
          (delete configuration item)
%       } | 
% my $n = 0;
% foreach my $type (@types) {
%   if ( $type eq '' ) { 
            
              %   } elsif ( $type eq 'image' ) {| no type |  
              | <% $conf->exists($i->key, $agentnum)
                     ? '  '
                     : 'empty'
                %> |  
              %   } elsif ( $type eq 'binary' ) {| <% $conf->exists($i->key, $agentnum)
                     ? qq!download!
                     : ''
                %> |  
              %   } elsif (    $type eq 'textarea'
%             || $type eq 'editlist'
%             || $type eq 'selectmultiple'
%           )
%   {| <% $conf->exists($i->key, $agentnum)
                     ? qq!download!
                     : 'empty'
                %> |  
              %   } elsif ( $type eq 'checkbox' ) {| <% encode_entities(join("\n",
     map { length($_) > 88 ? substr($_,0,88).'...' : $_ }
         $conf->config($i->key, $agentnum)
   ) )
%> |  
              %   } elsif ( $type eq 'select' && $i->select_hash ) {
%
%     my %hash;
%     if ( ref($i->select_hash) eq 'ARRAY' ) {
%       tie %hash, 'Tie::IxHash', '' => '', @{ $i->select_hash };
%     } else {
%       tie %hash, 'Tie::IxHash', '' => '', %{ $i->select_hash };
%     }| YES' : 'ff0000">NO' %> |  
              %   } elsif ( $type eq 'text' || $type eq 'select' ) {| <% $conf->exists($i->key, $agentnum) ? $hash{ $conf->config($i->key, $agentnum) } : '' %> |  
              %   } elsif ( $type eq 'select-sub' ) {| <% $conf->exists($i->key, $agentnum) ? $conf->config($i->key, $agentnum) : '' %> |  
              %   } elsif ( $type =~ /^select-(part_svc|part_pkg|pkg_class)$/ ) {
%
%     my $table = $1;
%     my $namecol = $namecol{$table};
%     my $pkey = dbdef->table($table)->primary_key;
%
%     my @keys = $conf->config($i->key, $agentnum);| <% $conf->config($i->key, $agentnum) %>: 
                <% &{ $i->option_sub }( $conf->config($i->key, $agentnum) ) %> |  
              %   } else {| <% join( ' ',
                         map {
                           my $key = $_;
                           my $record = qsearchs($table, { $pkey => $key });
                           $record ? "$key: ".$record->$namecol() : $key;
                         } @keys
                       )
                %>
 |  %   }
%   $n++;
% }| unknown type <% $type %> |  | 
% } # foreach my $agentnum
% if ( @add_agents ) {
  
    |  | 
% } #if @add_agents
% } # foreach my $i