From 6a1d3fe46f65b0a24ec025c22afcdb75af3c9e9a Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 17 Apr 2009 08:02:29 +0000 Subject: show labels for select(select_hash) config options, RT#3997 --- httemplate/config/config-view.cgi | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'httemplate/config/config-view.cgi') diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi index f2ae892a6..41ecfd268 100644 --- a/httemplate/config/config-view.cgi +++ b/httemplate/config/config-view.cgi @@ -66,7 +66,7 @@ Click on a configuration value to change it. no type -% } elsif ( $type eq 'image' ) { +% } elsif ( $type eq 'image' ) { @@ -86,7 +86,7 @@ Click on a configuration value to change it. -% } elsif ( $type eq 'binary' ) { +% } elsif ( $type eq 'binary' ) { @@ -112,17 +112,36 @@ Click on a configuration value to change it. + % } 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' ) { @@ -131,6 +150,7 @@ Click on a configuration value to change it. <% &{ $i->option_sub }( $conf->config($i->key, $agentnum) ) %> + % } else { -- cgit v1.2.1