function imce_subdirectories_accessible in IMCE 6
Same name and namespace in other branches
- 6.2 inc/imce.page.inc \imce_subdirectories_accessible()
- 7 inc/imce.page.inc \imce_subdirectories_accessible()
Detect if the subdirectories are accessible through any directory(not just the current one) in the list.
1 call to imce_subdirectories_accessible()
- imce_process_profile in inc/
page.inc - Get files and folders of the actve directory. Do custom processing.
File
- inc/
page.inc, line 850
Code
function imce_subdirectories_accessible(&$imce) {
if (!empty($imce['subdirectories'])) {
$root = file_directory_path() . '/';
//checking only the first one is sufficient.
$dirname = ($imce['dir'] == '.' ? '' : $imce['dir'] . '/') . $imce['subdirectories'][0];
$dirpath = $root . $dirname;
//check if any setting is applicable for this subdirectory through any directory in the list.
foreach ($imce['directories'] as $name => $info) {
if ($info['subnav'] && $dirname != $name && file_check_location($dirpath, $root . $name)) {
return TRUE;
}
}
}
return FALSE;
}