mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-23 03:11:48 +02: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');
|
include('../header.inc.php');
|
||||||
|
|
||||||
|
if ($appname == 'admin')
|
||||||
|
{
|
||||||
|
$appname = 'preferences';
|
||||||
|
}
|
||||||
$t = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir($appname));
|
$t = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir($appname));
|
||||||
|
$t->set_unknowns('keep');
|
||||||
$t->set_file(array(
|
$t->set_file(array(
|
||||||
'config' => 'config.tpl'
|
'config' => 'config.tpl'
|
||||||
));
|
));
|
||||||
@ -28,13 +33,6 @@
|
|||||||
$t->set_block('config','body','body');
|
$t->set_block('config','body','body');
|
||||||
$t->set_block('config','footer','footer');
|
$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 = CreateObject('phpgwapi.config',$appname);
|
||||||
$c->read_repository();
|
$c->read_repository();
|
||||||
|
|
||||||
@ -81,6 +79,9 @@
|
|||||||
$t->pparse('out','header');
|
$t->pparse('out','header');
|
||||||
|
|
||||||
$vars = $t->get_undefined('body');
|
$vars = $t->get_undefined('body');
|
||||||
|
|
||||||
|
$phpgw->common->hook_single('config',$appname);
|
||||||
|
|
||||||
while (list($null,$value) = each($vars))
|
while (list($null,$value) = each($vars))
|
||||||
{
|
{
|
||||||
$valarray = explode('_',$value);
|
$valarray = explode('_',$value);
|
||||||
@ -131,13 +132,18 @@
|
|||||||
$t->set_var($value,'');
|
$t->set_var($value,'');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "hook":
|
||||||
|
$newval = ereg_replace(' ','_',$newval);
|
||||||
|
$t->set_var($value,$newval($current_config));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$t->set_var($value,'');
|
$t->set_var($value,'');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$t->pparse('out','body');
|
|
||||||
|
|
||||||
$t->pparse('out','footer');
|
$t->pfp('out','body');
|
||||||
|
|
||||||
|
$t->pfp('out','footer');
|
||||||
$phpgw->common->phpgw_footer();
|
$phpgw->common->phpgw_footer();
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user