% unless ( $cgi->param('showagent') ) {
<% include('/elements/popup_link.html',
'action' => $action,
'width' => $width,
'height' => $height,
'actionlabel' => 'Enter configuration value',
'html_label' => "$label",
'aname' => $i->key,
)
%>:
% } else {
| <% $label %>:
% }
<% $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 '' ) {
no type |
% } elsif ( $type eq 'image' ) {
% my $args = 'key=' . $i->key . ";agentnum=$agentnum;locale=$locale";
<% $conf->exists($i->key, $agentnum)
? ''
: 'empty'
%>
|
<% $conf->exists($i->key, $agentnum)
? 'download'
: ''
%>
|
% } elsif ( $type eq 'binary' ) {
% my $args = 'key=' . $i->key . ";agentnum=$agentnum;locale=$locale";
<% $conf->exists($i->key, $agentnum)
? 'download'
: 'empty'
%>
|
% } elsif ( $type eq 'textarea'
% || $type eq 'editlist'
% || $type eq 'selectmultiple'
% )
% {
% my $escaped = eval { encode_entities(join("\n",
% map { length($_) > 88 ? substr($_,0,88).'...' : $_ }
% $conf->config($i->key, $agentnum)
% ) );
% };
% $escaped = $@ ? '('.encode_entities($@).')' : $escaped;
<% $escaped %>
|
% } elsif ( $type eq 'checkbox' ) {
YES' : 'ff0000">NO' %> |
% } 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 };
% }
<% $conf->exists($i->key, $agentnum) ? $hash{ $conf->config($i->key, $agentnum) } : '' %>
|
% } elsif ( $type eq 'text' || $type eq 'select' ) {
<% $conf->exists($i->key, $agentnum) ? $conf->config($i->key, $agentnum) : '' %>
|
% } elsif ( $type eq 'select-sub' ) {
% if ( $i->multiple ) {
<% join(' ',
map { $_ . ": " . &{ $i->option_sub }($_) }
$conf->config($i->key,$agentnum)
)
%>
% } else {
<% $conf->config($i->key, $agentnum) %>:
<% &{ $i->option_sub }( $conf->config($i->key, $agentnum) ) %>
% }
|
% } elsif ( $type =~ /^select-(part_svc|part_pkg|pkg_class|agent)$/ ) {
%
% my $table = $1;
% my $namecol = $namecol{$table};
% my $pkey = dbdef->table($table)->primary_key;
%
% my @keys = $conf->config($i->key, $agentnum);
<% join( ' ',
map {
my $key = $_;
my $record = qsearchs($table, { $pkey => $key });
$record ? "$key: ".$record->$namecol() : $key;
} @keys
)
%>
|
% } else {
unknown type <% $type %>
|
% }
% $n++;
% }
|
% } # foreach my $agentnum
% if ( @add_agents ) {
|
% } #if @add_agents
% } # foreach my $i