From 0f11d8bc92f250b608a0ddcada330bed9b9d4c7d Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 14 Sep 2008 20:20:41 +0000 Subject: [PATCH] don't reload the whole page every time a config option is changed, RT#3989 --- httemplate/config/config-process.cgi | 39 +++++++++++++++++++++++++++++++++++- httemplate/config/config-view.cgi | 37 ++++++++++++++++++---------------- 2 files changed, 58 insertions(+), 18 deletions(-) diff --git a/httemplate/config/config-process.cgi b/httemplate/config/config-process.cgi index b0c8a7456..e220fd8ec 100644 --- a/httemplate/config/config-process.cgi +++ b/httemplate/config/config-process.cgi @@ -63,6 +63,43 @@ $conf->delete($_, $agentnum) foreach @delete; <% header('Configuration set') %> diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi index 4f6b5463a..b7e6f6797 100644 --- a/httemplate/config/config-view.cgi +++ b/httemplate/config/config-view.cgi @@ -12,10 +12,9 @@ Click on a configuration value to change it. <% include('/elements/init_overlib.html') %> % if ($FS::UID::use_confcompat) { - CONFIGURATION NOT STORED IN DATABASE -- USING COMPATIBILITY MODE

%} -% + % foreach my $section ( qw(required billing username password UI session % shell BIND % ), @@ -68,14 +67,16 @@ Click on a configuration value to change it. %>: <% $i->description %> + +% my $n = 0; % foreach my $type (@types) { -% my $n = 0; -% if ( $type eq '' ) { + +% if ( $type eq '' ) { -% } elsif ( $type eq 'binary' ) { +% } elsif ( $type eq 'binary' ) { <% $conf->exists($i->key, $agentnum) @@ -83,12 +84,13 @@ Click on a configuration value to change it. : 'empty' %> -% } elsif ( $type eq 'textarea' -% || $type eq 'editlist' -% || $type eq 'selectmultiple' ) { + +% } elsif ( $type eq 'textarea' +% || $type eq 'editlist' +% || $type eq 'selectmultiple' ) { - -% } elsif ( $type eq 'checkbox' ) { +% } elsif ( $type eq 'checkbox' ) { - + -% } elsif ( $type eq 'text' || $type eq 'select' ) { +% } elsif ( $type eq 'text' || $type eq 'select' ) { - -% } elsif ( $type eq 'select-sub' ) { +% } elsif ( $type eq 'select-sub' ) { - -% } else { +% } else { +% } +% $n++; % } -% $n++; }
no type
+
 <% encode_entities(join("\n",
      map { length($_) > 88 ? substr($_,0,88).'...' : $_ }
@@ -98,32 +100,33 @@ Click on a configuration value to change it.
 
YES' : 'ff0000">NO' %>YES' : 'ff0000">NO' %>
+ <% $conf->exists($i->key, $agentnum) ? $conf->config($i->key, $agentnum) : '' %>
+ <% $conf->config($i->key, $agentnum) %>: <% &{ $i->option_sub }( $conf->config($i->key, $agentnum) ) %>
unknown type <% $type %>
-- 2.11.0