- more work on froxlor-client settings (multiserver mode)

This commit is contained in:
Michael Kaufmann (d00p)
2010-10-19 20:42:55 +00:00
parent 58499a068f
commit d3fd4ee2f4
7 changed files with 104 additions and 19 deletions

View File

@@ -28,9 +28,20 @@ function loadConfigArrayDir()
$numargs = func_num_args();
if($numargs <= 0) { return null; }
// variable that holds all dirs that will
// be parsed for inclusion
$configdirs = array();
// if one of the parameters is an array
// we assume that this is a list of
// setting-groups to be selected
$selection = null;
for($x=0;$x<$numargs;$x++) {
$configdirs[] = func_get_arg($x);
$arg = func_get_arg($x);
if(is_array($arg) && isset($arg[0])) {
$selection = $arg;
} else {
$configdirs[] = $arg;
}
}
$data = array();
@@ -62,6 +73,23 @@ function loadConfigArrayDir()
$data = array_merge_recursive($data, include($data_filename));
}
}
// if we have specific setting-groups
// to select, we'll handle this here
// (this is for multiserver-client settings)
$_data = array();
if($selection != null
&& is_array($selection)
&& isset($selection[0])
) {
foreach($data['groups'] as $group => $data)
{
if(in_array($group, $selection)) {
$_data[$group] = $data;
}
}
$data = $_data;
}
return $data;
}