[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] admin/inc class.uiconfig.inc.php
From: |
Dave Hall |
Subject: |
[Phpgroupware-cvs] admin/inc class.uiconfig.inc.php |
Date: |
Tue, 19 Dec 2006 14:01:10 +0000 |
CVSROOT: /sources/phpgroupware
Module name: admin
Changes by: Dave Hall <skwashd> 06/12/19 14:01:10
Modified files:
inc : class.uiconfig.inc.php
Log message:
clean up
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/admin/inc/class.uiconfig.inc.php?cvsroot=phpgroupware&r1=1.26&r2=1.27
Patches:
Index: class.uiconfig.inc.php
===================================================================
RCS file: /sources/phpgroupware/admin/inc/class.uiconfig.inc.php,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- class.uiconfig.inc.php 17 Dec 2006 15:58:24 -0000 1.26
+++ class.uiconfig.inc.php 19 Dec 2006 14:01:10 -0000 1.27
@@ -10,7 +10,7 @@
* option) any later version. *
\**************************************************************************/
- /* $Id: class.uiconfig.inc.php,v 1.26 2006/12/17 15:58:24 Caeies Exp $ */
+ /* $Id: class.uiconfig.inc.php,v 1.27 2006/12/19 14:01:10 skwashd Exp $ */
class uiconfig
{
@@ -18,10 +18,11 @@
function index()
{
+ $errors = '';
$referer = '';
if ( isset($_GET['referer']) )
{
- $referer = urldecode( str_replace('&', '&',
$_GET['referer']) );
+ $referer = urldecode( $_GET['referer'] );
}
if($referer)
@@ -67,13 +68,11 @@
$t =& $GLOBALS['phpgw']->template;
$t->set_root($GLOBALS['phpgw']->common->get_tpl_dir($appname));
- $t->set_unknowns('keep');
+
$t->set_file(array('config' => 'config.tpl'));
- $t->set_block('config','header','header');
$t->set_block('config','body','body');
- $t->set_block('config','footer','footer');
- $c =& CreateObject('phpgwapi.config',$config_appname);
+ $c = CreateObject('phpgwapi.config',$config_appname);
$c->read_repository();
if ($c->config_data)
@@ -83,7 +82,7 @@
if ( isset($_POST['cancel']) && $_POST['cancel'] )
{
- Header('Location: ' . $_redir);
+ Header('Location: ' . str_replace('&', '&',
$_redir) );
}
$errors = '';
@@ -140,36 +139,46 @@
{
$GLOBALS['phpgw']->session->appsession('session_data','admin_config',-1);
Header('Location: ' . $_redir);
-
$GLOBALS['phpgw_info']['flags']['nodisplay'] = True;
+
$GLOBALS['phpgw_info']['flags']['nodisplay'] = true;
exit;
}
}
if(isset($errors) && $errors)
{
- $t->set_var('error',lang('Error') . ': ' .
$errors);
- $t->set_var('th_err','#FF8888');
+ $t->set_var(array
+ (
+ 'error' => lang('Error:
%1', $errors),
+ 'error_class' => 'error'
+ ));
unset($errors);
unset($GLOBALS['config_error']);
}
else
{
- $t->set_var('error','');
+ $t->set_var(array
+ (
+ 'error' => '',
+ 'error_class' => ''
+ ));
}
- $GLOBALS['phpgw']->common->phpgw_header(true);
- $t->set_var('title',lang('Site Configuration'));
-
$t->set_var('action_url',$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'admin.uiconfig.index',
'appname'=> $appname)));
- $t->pparse('out','header');
+ $t->set_var(array
+ (
+ 'action_url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'admin.uiconfig.index',
'appname'=> $appname) ),
+ 'lang_cancel' => lang('cancel'),
+ 'lang_save' => lang('save'),
+ 'title' => lang('Site
Configuration'),
+ ));
$vars = $t->get_undefined('body');
$GLOBALS['phpgw']->hooks->single('config',$appname);
- while (list($null,$value) = each($vars))
+ foreach ( $vars as $value )
{
- $valarray = explode('_',$value);
+ $valarray = explode('_', $value);
$type = $valarray[0];
$new = $newval = '';
@@ -187,7 +196,7 @@
case 'value':
$newval = ereg_replace('
','_',$newval);
/* Don't show passwords in the
form */
- if(ereg('passwd',$value) ||
ereg('password',$value) || ereg('root_pw',$value))
+ if (
!isset($current_config[$newval]) || ereg('passwd',$value) ||
ereg('password',$value) || ereg('root_pw',$value))
{
$t->set_var($value,'');
}
@@ -220,9 +229,10 @@
}
$config = implode('_',$configs);
/* echo $config . '=' .
$current_config[$config]; */
- if
(isset($current_config[$config]) && $current_config[$config] == $setting)
+ if (
isset($current_config[$config])
+ &&
$current_config[$config] == $setting)
{
- $t->set_var($value,'
selected="selected"');
+ $t->set_var($value,'
selected');
}
else
{
@@ -245,12 +255,8 @@
break;
}
}
-
- $t->pfp('out','body');
-
- $t->set_var('lang_submit', lang('submit'));
- $t->set_var('lang_cancel', lang('cancel'));
- $t->pfp('out','footer');
+ $GLOBALS['phpgw']->common->phpgw_header(true);
+ $t->pfp('out','config');
}
}
?>