From 76693ae37b63d0d4078f9be5be6ff4f9391c45f1 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Fri, 1 Jun 2001 01:57:51 +0000 Subject: [PATCH] Possible admin tool to use current setup config.inc.php files --- admin/config.php | 76 +++++++++++++++++++++++ admin/templates/default/config.tpl | 15 +++++ admin/templates/default/config_footer.tpl | 15 +++++ admin/templates/default/config_head.tpl | 7 +++ 4 files changed, 113 insertions(+) create mode 100644 admin/config.php create mode 100644 admin/templates/default/config.tpl create mode 100644 admin/templates/default/config_footer.tpl create mode 100644 admin/templates/default/config_head.tpl diff --git a/admin/config.php b/admin/config.php new file mode 100644 index 0000000000..45e664f00d --- /dev/null +++ b/admin/config.php @@ -0,0 +1,76 @@ + * + * http://www.phpgroupware.org * + * -------------------------------------------- * + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + \**************************************************************************/ + + /* $Id$ */ + + $phpgw_info['flags'] = array( + 'noheader' => True, + 'nonavbar' => True, + 'currentapp' => "admin", + ); + include('../header.inc.php'); + + $t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); + $t->set_file(array( + 'header' => 'config_head.tpl', + 'footer' => 'config_footer.tpl' + )); + + $c = CreateObject('phpgwapi.config',$appname); + $c->read_repository(); + + if ($c->config_data) + { + $current_config = $c->config_data; + } + else + { + $c->appname = 'phpgwapi'; + $c->read_repository(); + $current_config = $c->config_data; + } + //echo print_r($current_config); exit; + + if ($cancel) + { + Header('Location: '.$phpgw->link('/admin/index.php')); + } + + if ($submit) + { + while (list($key,$config) = each($newsettings)) + { + //echo '
' . $key . ' = "' . $config . '"'; + $c->config_data[$key] = $config; + } + $c->save_repository(True); + + Header('Location: '.$phpgw->link('/admin/index.php')); + $phpgw->common->phpgw_exit(); + } + + $phpgw->common->phpgw_header(); + echo parse_navbar(); + + $t->set_var('title',lang('Site Configuration')); + $t->set_var('action_url',$phpgw->link('/admin/config.php')); + $t->pparse('out','header'); + + include(PHPGW_SERVER_ROOT . SEP . $appname . SEP . 'setup' . SEP . 'config.inc.php'); + if ($appname == 'admin') + { + include(PHPGW_SERVER_ROOT . SEP . 'preferences' . SEP . 'setup' . SEP . 'config.inc.php'); + } + + $t->pparse('out','footer'); + $phpgw->common->phpgw_footer(); +?> diff --git a/admin/templates/default/config.tpl b/admin/templates/default/config.tpl new file mode 100644 index 0000000000..9ddf6794ef --- /dev/null +++ b/admin/templates/default/config.tpl @@ -0,0 +1,15 @@ + + + +  + + + + + + + + + + + diff --git a/admin/templates/default/config_footer.tpl b/admin/templates/default/config_footer.tpl new file mode 100644 index 0000000000..5de5001727 --- /dev/null +++ b/admin/templates/default/config_footer.tpl @@ -0,0 +1,15 @@ + + + +  + + + + + + + + + + + diff --git a/admin/templates/default/config_head.tpl b/admin/templates/default/config_head.tpl new file mode 100644 index 0000000000..bcd2445b26 --- /dev/null +++ b/admin/templates/default/config_head.tpl @@ -0,0 +1,7 @@ + +
+ + + + +
 {title}