diff options
Diffstat (limited to 'httemplate/config')
-rw-r--r-- | httemplate/config/config-process.cgi | 2 | ||||
-rw-r--r-- | httemplate/config/config-view.cgi | 6 | ||||
-rw-r--r-- | httemplate/config/config.cgi | 6 |
3 files changed, 8 insertions, 6 deletions
diff --git a/httemplate/config/config-process.cgi b/httemplate/config/config-process.cgi index 38d9af0db..259713260 100644 --- a/httemplate/config/config-process.cgi +++ b/httemplate/config/config-process.cgi @@ -34,7 +34,7 @@ } } elsif ( $type eq 'editlist' || $type eq 'selectmultiple' ) { if ( scalar(@{[ $cgi->param($i->key. $n) ]}) ) { - $conf->set($i->key, join("\n", $cgi->param($i->key. $n) )); + $conf->set($i->key, join("\n", @{[ $cgi->param($i->key. $n) ]} )); } else { $conf->delete($i->key); } diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi index d40c4dc10..f0ae2b2fd 100644 --- a/httemplate/config/config-view.cgi +++ b/httemplate/config/config-view.cgi @@ -37,7 +37,9 @@ my $n = 0; %> <% if ( $type eq '' ) { %> <tr><td><font color="#ff0000">no type</font></td></tr> - <% } elsif ( $type eq 'textarea' || $type eq 'editlist' ) { %> + <% } elsif ( $type eq 'textarea' + || $type eq 'editlist' + || $type eq 'selectmultiple' ) { %> <tr><td bgcolor="#ffffff"> <pre> <%= encode_entities(join("\n", $conf->config($i->key) ) ) %> @@ -46,7 +48,7 @@ <% } elsif ( $type eq 'checkbox' ) { %> <tr><td bgcolor="#<%= $conf->exists($i->key) ? '00ff00">YES' : 'ff0000">NO' %></td></tr> <% } elsif ( $type eq 'text' || $type eq 'select' ) { %> - <tr><td bgcolor="#ffffff"><%= $conf->exists($i->key) ? $conf->config($i->key) : '' %></td></tr> + <tr><td bgcolor="#ffffff"><%= $conf->exists($i->key) ? $conf->config($i->key) : '' %></td></tr> <% } else { %> <tr><td> <font color="#ff0000">unknown type <%= $type %></font> diff --git a/httemplate/config/config.cgi b/httemplate/config/config.cgi index 4f19ee961..2817e5f84 100644 --- a/httemplate/config/config.cgi +++ b/httemplate/config/config.cgi @@ -62,12 +62,12 @@ function SafeOnsubmit() { <input name="<%= $i->key. $n %>" type="checkbox" value="1"<%= $conf->exists($i->key) ? ' CHECKED' : '' %>> <% } elsif ( $type eq 'text' ) { %> <input name="<%= $i->key. $n %>" type="<%= $type %>" value="<%= $conf->exists($i->key) ? $conf->config($i->key) : '' %>"> - <% } elsif ( $type eq 'select' ) { %> - <select name="<%= $i->key. $n %>"> + <% } elsif ( $type eq 'select' || $type eq 'selectmultiple' ) { %> + <select name="<%= $i->key. $n %>" <%= $type eq 'selectmultiple' ? 'MULTIPLE' : '' %>> <% my %saw; foreach my $value ( "", @{$i->select_enum} ) { local($^W)=0; next if $saw{$value}++; %> - <option value="<%= $value %>"<%= $value eq $conf->config($i->key) ? ' SELECTED' : '' %>><%= $value %> + <option value="<%= $value %>"<%= $value eq $conf->config($i->key) || ( $type eq 'selectmultiple' && grep { $_ eq $value } $conf->config($i->key) ) ? ' SELECTED' : '' %>><%= $value %> <% } %> <% if ( $conf->exists($i->key) && $conf->config($i->key) && ! grep { $conf->config($i->key) eq $_ } @{$i->select_enum}) { %> <option value=<%= $conf->config($i->key) %> SELECTED><%= conf->config($i->key) %> |