function imce_process_directories in IMCE 6.2
Same name and namespace in other branches
- 6 inc/page.inc \imce_process_directories()
- 7 inc/imce.page.inc \imce_process_directories()
Translate tokens and evaluate php in directory names. Convert directories into an associative array (dirname => info)
1 call to imce_process_directories()
- imce_initiate_profile in inc/
imce.page.inc - Initiate and return configuration profile for the $user.
File
- inc/
imce.page.inc, line 799 - Implements the file browser.
Code
function imce_process_directories(&$imce, $user) {
$directories = $imce['directories'];
$paths = array();
$translate = array(
'%uid' => $user->uid,
);
foreach ($directories as $directory) {
if (substr($directory['name'], 0, 4) == 'php:') {
$directory['name'] = eval(substr($directory['name'], 4));
//php may return an array of directories
if (is_array($directory['name'])) {
foreach ($directory['name'] as $name) {
$paths[$name] = array(
'name' => $name,
) + $directory;
}
continue;
}
}
else {
$directory['name'] = strtr($directory['name'], $translate);
}
if ($directory['name']) {
$paths[$directory['name']] = $directory;
}
}
$imce['directories'] = $paths;
}