new client side Ajax admin user interface
[bse.git] / site / cgi-bin / modules / BSE / UI / API.pm
index 4d2979a6026d2f7d2d0f0b1f145cc3bb569cf3f5..ed083e0764368f579c075a2aee8c94c0d0c11edf 100644 (file)
@@ -2,7 +2,7 @@ package BSE::UI::API;
 use strict;
 use base "BSE::UI::Dispatch";
 
-our $VERSION = "1.000";
+our $VERSION = "1.001";
 
 my %actions =
   (
@@ -22,13 +22,28 @@ sub req_config {
   my ($self, $req) = @_;
 
   my $cfg = $req->cfg;
-  return $req->json_content
+  my %result =
     (
      success => 1,
      perlbal => $cfg->entry("basic", "perlbal", 0),
      access_control => $cfg->entry("basic", "access_control", 0),
      tracking_uploads => $req->_tracking_uploads,
     );
+
+  my %custom = $cfg->entries("extra a_config");
+  for my $key (keys %custom) {
+    exists $result{$key} and next;
+
+    my $section = $custom{$key};
+    $section =~ /\{(level|generator|parentid|template)\}/
+      and next;
+
+    $section eq "db" and die;
+
+    $result{$key} = { $cfg->entries($section) };
+  }
+
+  return $req->json_content(\%result);
 }
 
 sub req_fail {