mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 16:48:49 +01:00
Possible admin tool to use current setup config.inc.php files
This commit is contained in:
parent
609b3b8fad
commit
76693ae37b
76
admin/config.php
Normal file
76
admin/config.php
Normal file
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - Admin config *
|
||||
* Written by Miles Lott <milosch@phpgroupware.org> *
|
||||
* 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 '<br>' . $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();
|
||||
?>
|
15
admin/templates/default/config.tpl
Normal file
15
admin/templates/default/config.tpl
Normal file
@ -0,0 +1,15 @@
|
||||
<!-- begin config_post_script.tpl -->
|
||||
<tr bgcolor="FFFFFF">
|
||||
<td colspan="2">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<input type="submit" name="submit" value="Submit">
|
||||
<input type="submit" name="cancel" value="Cancel">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<!-- end config_post_script.tpl -->
|
15
admin/templates/default/config_footer.tpl
Normal file
15
admin/templates/default/config_footer.tpl
Normal file
@ -0,0 +1,15 @@
|
||||
<!-- BEGIN footer -->
|
||||
<tr bgcolor="FFFFFF">
|
||||
<td colspan="2">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<input type="submit" name="submit" value="Submit">
|
||||
<input type="submit" name="cancel" value="Cancel">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<!-- END footer -->
|
7
admin/templates/default/config_head.tpl
Normal file
7
admin/templates/default/config_head.tpl
Normal file
@ -0,0 +1,7 @@
|
||||
<!-- BEGIN head -->
|
||||
<form method="POST" action="{action_url}">
|
||||
<table border="0" align="center">
|
||||
<tr bgcolor="486591">
|
||||
<td colspan="2"><font color="fefefe"> <b>{title}</b></font></td>
|
||||
</tr>
|
||||
<!-- END head -->
|
Loading…
Reference in New Issue
Block a user