[eluser]Colin Williams[/eluser]
Just note that my use of the static variable $paths is probably not the most elegant solution (try calling the function twice... yeah). I would suggest rethinking this before you use it heavily!
==== UPDATE =============================================================
Okay.. here's a better function. I had nothing else to do. It is sad, really:
Code:
function directory_map_paths($wp = '', $map = array())
{
$paths = array();
if (!is_array($map) or !count($map))
{
if ($wp)
{
$map = directory_map($wp);
$wp = '';
}
else
{
show_error('No map or working path given to remap.');
}
}
if (count($map))
{
foreach ($map as $k => $v)
{
if (is_array($v))
{
$paths = array_merge($paths, directory_map_paths($wp . ($wp ? '/' : '') . $k, $v)); // Recurse
}
else
{
$paths[] = $wp . ($wp ? '/' : '') . $v;
}
}
}
return $paths;
}