Allow apps to use a hook config for using special code in config.php,

preferences will be doing this
This commit is contained in:
Miles Lott 2001-06-12 17:17:23 +00:00
parent 4b818b39a3
commit e3c2d12172

View File

@ -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();
?>