You are here

function imce_directory_info in IMCE 6.2

Same name and namespace in other branches
  1. 6 inc/page.inc \imce_directory_info()
  2. 7 inc/imce.page.inc \imce_directory_info()

Return the permissions for a directory that is accessed directly or indirectly. A child of a predefined directory in the directory list takes its parent's properties. If it has multiple parents, it gets the properties of the latter in the list.

2 calls to imce_directory_info()
imce_tree_html in inc/imce.page.inc
Return tree html. This is not themable because it is complex and needs to be in a proper format for js processing.
imce_working_directory in inc/imce.page.inc
Return an available directory for the profile.

File

inc/imce.page.inc, line 922
Implements the file browser.

Code

function imce_directory_info($dirname, $imce) {
  if (isset($imce['directories'][$dirname])) {
    return $imce['directories'][$dirname];
  }
  $info = FALSE;
  $root = file_directory_path();
  $dirpath = $root . '/' . $dirname;
  if (imce_reg_dir($dirname) && file_check_directory($dirpath)) {
    foreach ($imce['directories'] as $name => $prop) {
      if ($prop['subnav'] && ($name === '.' || strpos($dirname . '/', $name . '/') === 0)) {
        $info = $prop;
        $info['name'] = $dirname;
      }
    }
  }
  return $info;
}