mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 17:14:44 +01:00
Allow apps to use a hook config for using special code in config.php,
preferences will be doing this
This commit is contained in:
parent
4b818b39a3
commit
e3c2d12172
@ -20,7 +20,12 @@
|
||||
);
|
||||
include('../header.inc.php');
|
||||
|
||||
if ($appname == 'admin')
|
||||
{
|
||||
$appname = 'preferences';
|
||||
}
|
||||
$t = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir($appname));
|
||||
$t->set_unknowns('keep');
|
||||
$t->set_file(array(
|
||||
'config' => 'config.tpl'
|
||||
));
|
||||
@ -28,13 +33,6 @@
|
||||
$t->set_block('config','body','body');
|
||||
$t->set_block('config','footer','footer');
|
||||
|
||||
function nextcolor()
|
||||
{
|
||||
global $phpgw,$trcolor;
|
||||
$trcolor = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
||||
echo $trcolor;
|
||||
}
|
||||
|
||||
$c = CreateObject('phpgwapi.config',$appname);
|
||||
$c->read_repository();
|
||||
|
||||
@ -81,6 +79,9 @@
|
||||
$t->pparse('out','header');
|
||||
|
||||
$vars = $t->get_undefined('body');
|
||||
|
||||
$phpgw->common->hook_single('config',$appname);
|
||||
|
||||
while (list($null,$value) = each($vars))
|
||||
{
|
||||
$valarray = explode('_',$value);
|
||||
@ -131,13 +132,18 @@
|
||||
$t->set_var($value,'');
|
||||
}
|
||||
break;
|
||||
case "hook":
|
||||
$newval = ereg_replace(' ','_',$newval);
|
||||
$t->set_var($value,$newval($current_config));
|
||||
break;
|
||||
default:
|
||||
$t->set_var($value,'');
|
||||
break;
|
||||
}
|
||||
}
|
||||
$t->pparse('out','body');
|
||||
|
||||
$t->pparse('out','footer');
|
||||
$t->pfp('out','body');
|
||||
|
||||
$t->pfp('out','footer');
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user